
Topics
Replies
Waxy
18 Dec 2022, 01:16
( Updated at: 21 Dec 2023, 09:23 )
RE: Still not working for me With VS2022 17.3.4 and Ctrader Automate version 1.0.4 (which is the latest version)
So, in case someone is still experiencing this issue, I was able to sort it out by changing the kind of debug symbols, inside the project properties, changed it to PDB file, current platform:
The System.Private.Core issue is still present in some of my solutions though
Regards,
@Waxy
Waxy
04 Nov 2022, 08:42
RE: RE: RE:
That's different, not sure but something like:
var checkPrice = 1.5;
var crossedBar = Bars.Select((bar, index) => (bar, index)).LastOrDefault(x => x.bar.Low <= checkPrice && x.bar.High >= checkPrice);
if (crossedBar.index != 0)
Print($"Bar Index is {crossedBar.index}");
@Waxy
Waxy
01 Nov 2022, 21:04
RE:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
namespace cAlgo
{
[Indicator(AccessRights = AccessRights.None)]
public class NewIndicator : Indicator
{
private ChartVerticalLine _verticalLine;
/*
-- I was wondering if it were possible for me to get the Bars info (eg. OpenPrices, ClosePrices, etc.) from a ChartObject's (such as a vertical line) Time index?
-- Any help is appreciated, thanks.
*/
protected override void Initialize()
{
_verticalLine = Chart.DrawVerticalLine("VerticalLine", Bars.OpenTimes.LastValue, Color.Red);
var index = Bars.OpenTimes.GetIndexByTime(_verticalLine.Time);
var bar = Bars[index];
Print("Open: {0}, High: {1}, Low: {2}, Close: {3}", bar.Open, bar.High, bar.Low, bar.Close);
}
public override void Calculate(int index)
{
// Calculate value at specified index
// Result[index] =
}
}
}
@Waxy
Waxy
13 Oct 2022, 13:05
RE: RE:
I'm having some reference issues with WebView and Window
- Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'Window' could not be found (are you missing a using directive or an assembly reference?) WindowSample C:\Users\USUARIO\Documents\cAlgo\Sources\Indicators\WindowSample\WindowSample\WindowSample.cs 23 Active
- Severity Code Description Project File Line Suppression State
Error CS0103 The name 'WindowStartupLocation' does not exist in the current context WindowSample C:\Users\USUARIO\Documents\cAlgo\Sources\Indicators\WindowSample\WindowSample\WindowSample.cs 73 Active
- Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'WebView' could not be found (are you missing a using directive or an assembly reference?) WebViewOnWindow C:\Users\USUARIO\Documents\cAlgo\Sources\Indicators\WebViewOnWindow\WebViewOnWindow\WebViewOnWindow.cs 8 Active
- Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'WebViewLoadedEventArgs' could not be found (are you missing a using directive or an assembly reference?) WebViewOnWindow C:\Users\USUARIO\Documents\cAlgo\Sources\Indicators\WebViewOnWindow\WebViewOnWindow\WebViewOnWindow.cs 41 Active
I'm using latest version of Spotware cTrader, these references should not be missing.
Also, when I build with "Embedded" compiler, these errors are not shown, but it doesn't let me add any instance.
@Waxy
Waxy
12 Oct 2022, 08:14
Assign a label to the positions, it should be an unique label per instance, so there's no risk of conflict.
Example
private string _label;
protected override void OnStart()
{
_label = "BotName" + Server.Time.Ticks;
}
//Then everytime you trade use this label, i.e. and check for positions with that label
protected override void OnBar()
{
if (Positions.Count(x => x.Label == _label) < 5)
ExecuteMarketOrder(TradeType.Buy, SymbolName, 10000, _label, InputStopLoss, InputTakeProfit);
}
@Waxy
Waxy
10 Oct 2022, 22:57
RE: RE: RE:
Hello Spotware,
Here are my steps to reproduce this issue, I find little info about this on internet, and never happened to me before, would appreciate your help.
10.10.2022-14.51.58 (screencast.com)
Regards,
@Waxy
Waxy
01 Jun 2021, 06:23
( Updated at: 21 Dec 2023, 09:22 )
RE:
PanagiotisCharalampous said:
Hi Waxy,
Can you please provide us with the following?
- Application scale
- Windows scale
- Display resolution
Also please send us troubleshooting information. Paste the link to this discussion in the text box.
Best Regards,
Panagiotis
It seems it only happens when using "Change the size of text, apps and other items" to 150%
@Waxy
Waxy
10 Jan 2023, 21:34 ( Updated at: 21 Dec 2023, 09:23 )
RE:
Spotware said:
Hello Spotware,
You can see I have Load all modules checked, but still, it doesn't work, would appreciate your support:
Regards,
@Waxy