Did IsLastBar stop working after a few updates?
Did IsLastBar stop working after a few updates?
28 Jul 2021, 12:23
Hey guys,
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)
{
if (IsLastBar)
{
Print("TEST");
}
}
At least since a month ago.
Any ideas?
Replies
tperalta82
28 Jul 2021, 15:54
( Updated at: 28 Jul 2021, 17:17 )
RE:
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
EDIT2:
Ended up with this and it works so far
public bool IsLastBar2(int index)
{
return Bars[index].OpenTime == Bars.LastBar.OpenTime;
}
amusleh said:
Hi,
It works fine on my system, it works only if new ticks are coming and the market is open.
@tperalta82
tperalta82
16 Aug 2021, 05:56
RE:
amusleh said:
Hi,
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
@tperalta82
amusleh
28 Jul 2021, 14:42
Hi,
It works fine on my system, it works only if new ticks are coming and the market is open.
@amusleh