IsLastBar is not set for indicators that are part of a cBot

Created at 26 Aug 2024, 20:21
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
TO

tomas.bell.255

Joined 20.08.2024

IsLastBar is not set for indicators that are part of a cBot
26 Aug 2024, 20:21


I have a couple of custom indicators that render chart objects perfectly when used as standalone indicators. I use the IsLastBar property to only perform logic on realtime bars.

When I add the indicators to a cBot, the IsLastBar property is always false and the code block that relies on it is never hit.

For now I have worked around the problem by changing my logic to:

Bars.Count -1 == index  

 

Can you confirm if this is a bug or is the behaviour different to what im expecting when used with cbots?

Thanks


@tomas.bell.255
Replies

PanagiotisCharalampous
27 Aug 2024, 06:35

Hi there,

Please share the complete code of both the cBot and indicator as well as steps to reproduce this behavior.

Best regards,

Panagiotis


@PanagiotisCharalampous