Topics
Replies
firemyst
25 Nov 2023, 09:27
( Updated at: 26 Nov 2023, 07:27 )
Same here! I've noticed too
And have posted about it previously, but nobody from @Spotware has responded nor addressed the issue:
https://ctrader.com/forum/calgo-support/41630
@firemyst
firemyst
21 Nov 2023, 01:30
Positions.FindAll(yourPosition.yourLabel, Symbol.Name)
You need to give each of your positions a unique label when creating them.
Then, when you start your bot, check for them if you know there's open positions:
Positions.FindAll(yourPosition.yourLabel, Symbol.Name)
@firemyst
firemyst
10 Nov 2023, 05:40
( Updated at: 10 Nov 2023, 06:26 )
RE: RE: CheckBox alwyas clicked
eynt said:
Thank you.
It does work, however, I have another problem. I changed the code so it would change the indicator's parameter which is called LOAD_INDICATOR. However, although the print says its value is changed, when I go to the object manager to see the indicator's parameter value, over there it's not changed.
[Parameter(DefaultValue = false)] public bool LOAD_INDICATOR { get; set; }private void CheckBox_Changed(CheckBoxEventArgs e) { Print("CheckBox_Changed 1"); LOAD_INDICATOR = (bool)e.CheckBox.IsChecked; Print("LOAD_INDICATOR= " + LOAD_INDICATOR); }
Looks to me like your cast is wrong.
You appear to be converting “e” to a bool, which I'm sure isn't what you want to do. :-)
@firemyst
firemyst
10 Nov 2023, 01:21
( Updated at: 10 Nov 2023, 06:26 )
Try contacting @PanagiotisCharalampous
@firemyst
firemyst
10 Nov 2023, 01:15
You haven't added any event handlers to your checkbox.
You also need to add the checkbox to a canvas, and then add the canvas to the chart.
checkBox.Checked += CheckBox_Checked;
checkBox.Unchecked += CheckBox_Unchecked;
Canvas checkboxCanvas = new Canvas();
checkboxCanvas.AddChild(checkBox);
Chart.AddControl(checkboxCanvas);
@firemyst
firemyst
31 Oct 2023, 04:03
RE: RE: Bug in History/HistoricalTrade
VEI5S6C4OUNT0 said:
firemyst said:
Have you written anything to the logs or confirmed that the HIST object actually has data and isn't null?
var HIST = History.OrderByDescending ( trade => trade.ClosingTime ) .Take ( 1 ) ;
Yes I tried adding an ExecuteMarketOrder (…….. as part of OnStart and still no trades after that one , it just does nothing.
UPdate the entirety of your code with a Print statement after every conditional check to see where it gets to.
Unless you're using Visual studio and can debug?
@firemyst
firemyst
26 Oct 2023, 01:12
( Updated at: 26 Oct 2023, 05:35 )
It would be even better if you post this in the appropriate forum:
https://ctrader.com/forum/suggestions
@firemyst
firemyst
18 Oct 2023, 11:52
RE: RE: Is there any way to retrieve the bar's bar count at which the position was entered?
JINGXUAN said:
and it says :
‘Position[]’ does not contain a definition for ‘EntryTime’ and no accessible extension method ‘EntryTime’ accepting a fist argument of type ‘Position[]’ could be found
Of course it doesn't contain a definition. Your getting Long/Short positions returns arrays of Position objects; my example is with a single Position object.
The property “EntryTime” is for a single Position object, not an array of Position objects.
@firemyst
firemyst
25 Nov 2023, 09:30 ( Updated at: 26 Nov 2023, 07:27 )
__
You have to code it yourself to do the calculation if you don't want to use the chart tool to manually show the distance.
@firemyst