Did IsLastBar stop working after a few updates?

Created at 28 Jul 2021, 12:23
CT

ctid+customer-238980

Joined 07.07.2020

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?


@ctid+customer-238980
Replies

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

ctid+customer-238980
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.

 


@ctid+customer-238980

amusleh
29 Jul 2021, 09:44 ( Updated at: 29 Jul 2021, 10:37 )

Hi,

We were able to replicate this issue, we will investigate and update you as soon as possible.


@amusleh

ctid+customer-238980
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


@ctid+customer-238980