|Member since:||07 Jul 2020|
Last Forum Posts
@Get TickData for specific time Frame: 16 Aug 2021, 05:58
Is it possible to get tick data only for a specific time frame instead of getting *all the tick data*
Like if I do a .GetTicks() it will get all the ticks for ?? the current visible chart ?? I think for some strategies this is overkill. Is it possible to get for a specific time frame?
Like GetTicks from a start date to an end date without filling all the memory with all the ticks (as it seems that it is what cTrader is doing)
Thanks in advance
@Did IsLastBar stop working after a few updates?: 16 Aug 2021, 05:56
We were able to replicate this issue, we will investigate and update you as soon as possible.
Thanks, my fix is working so far, but yeah for other users will be nice
@Did IsLastBar stop working after a few updates?: 28 Jul 2021, 15:54
Interesting, which cTrader version? Have you tried on demo?
EDIT: Okay, it works if you just use the indicator as standalone, but if you include it in a bot as a custom indicator, it stops working, although i'm 100% sure it stopped working because i had this working in the past with 0 code changes
Ended up with this and it works so far
public bool IsLastBar2(int index)
return Bars[index].OpenTime == Bars.LastBar.OpenTime;
It works fine on my system, it works only if new ticks are coming and the market is open.
@Did IsLastBar stop working after a few updates?: 28 Jul 2021, 12:23
After some time trying to debug, it seems that IsLastBar stopped working, not even working at its simplest form like
public override void Calculate(int index)
At least since a month ago.
@Closing positions taking too long sometimes: 11 Jan 2021, 20:16
Hey PanagiotisCharalampous ,
After checking the ClosePositionAsync reply you gave me, i went and checked the code, and I already had that for a while, and it still locks the UI
TradeOperation tOperation = ClosePositionAsync(pos);
tResult = tOperation.TradeResult;
catch (InvalidOperationException IOX)
I havea full threaded implementation for the cBot, the call is outside of the ontick/onbar and runs on its own thread , sorry for the late reply btw
During peak hours, it might take some time for your order to be filled if the infrastructure (servers, LPs etc) is busy. If you want to avoid UI freezing, try using ClosePositionAsync.
@Closing positions taking too long sometimes: 08 Jan 2021, 14:56
Another thing i just thought of, we did some tests on demo and this did not occur, is it possible that when using demo, the LP's won't be an issue as the orders won't even go there?
@Closing positions taking too long sometimes: 08 Jan 2021, 14:49
So, since we have no idea how to mitigate the possible LP issue (it's not a thing that we can just switch, or am I wrong?), do you think trying it on another broker would fix the issue?
Or what would you suggest?
Thanks in advance!
@Closing positions taking too long sometimes: 08 Jan 2021, 14:15
By LP what do you mean? Broker? Liquidity Provider? Kind of lost here.
@Closing positions taking too long sometimes: 08 Jan 2021, 12:15
Good morning PanagiotisCharalampous,
Yeah the asynchronous will fix the ui lock, as doe the server response delays, do you think if we use openapi instead of regular cbot, this can be mitigated?
Or the behavior will be the same?
@Closing positions taking too long sometimes: 07 Jan 2021, 21:30
I sometimes have an issue, that it takes longer than expected to close a position, here's the journal log
07/01/2021 11:52:28.855 | Request to close position PID60993114 is sent to server
07/01/2021 11:52:42.809 | → Request to close position PID60993114 is ACCEPTED, order OID114294551 created (07/01/2021 11:52:33.381 UTC+0)
07/01/2021 11:52:42.840 | → Order OID114294551 is FILLED at 1.22659, position PID60993114 closed (07/01/2021 11:52:33.512 UTC+0)
07/01/2021 11:52:43.277 | Request to close position PID60997923 is sent to server
07/01/2021 11:53:38.512 | cBot "SC" was stopped for EURUSD, m15. (it was a manual stop)
07/01/2021 11:53:56.652 | → Request to close position PID60997923 is ACCEPTED, order OID114298182 created (07/01/2021 11:53:11.073 UTC+0)
07/01/2021 11:53:56.684 | → Order OID114298182 is FILLED at 1.22624, position PID60997923 closed (07/01/2021 11:53:11.188 UTC+0)
Notice the timestamps!
When opening positions it's fine, when closing sometimes this happens, and today it hurt performance a lot, also, while waiting for a ?server? response, we could not click the close all positions button, my co-worker had to open another ctrader on his desktop to close them manually.