IsLastBar and IsRealTime not working in referenced indicators

Created at 09 Nov 2017, 12:50
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!
whis.gg's avatar

whis.gg

Joined 31.08.2015

IsLastBar and IsRealTime not working in referenced indicators
09 Nov 2017, 12:50


Hey Spotware,

 

It looks like IsLastBar and IsRealTime always return false when called in a referenced indicator, please investigate.

See the code which I used for testing.

 

Regards,

Jiri

 

using cAlgo.API;

namespace cAlgo
{
    [Indicator(AccessRights = AccessRights.None)]
    public class Test : Indicator
    {
        private ReferencedIndicator _referencedIndicator;

        protected override void Initialize()
        {
            _referencedIndicator = Indicators.GetIndicator<ReferencedIndicator>();
        }

        public override void Calculate(int index)
        {
            _referencedIndicator.Calculate(index);
        }
    }

    public class ReferencedIndicator : Indicator
    {
        public override void Calculate(int index)
        {
            Print("IsLastBar = {0}; IsRealTime = {1}", IsLastBar, IsRealTime);
        }
    }
}

 


@whis.gg
Replies

PanagiotisCharalampous
09 Nov 2017, 15:06

Hi tmc.

This is probably happening because the ReferencedIndicator is not the one attached to the chart. Would like to tell us what you are trying to achieve so that we can propose a workaround? 

Best Regards,

Panagiotis


@PanagiotisCharalampous

whis.gg
09 Nov 2017, 16:49

Hi Panagiotis,

It's still receiving the chart tick data with same MarketSeries, therefore it should be able to tell whether it's last bar and live data or not, shouldn't it? I am not looking for a workaround but rather finding this as a bug, so I am reporting it.


@whis.gg

PanagiotisCharalampous
10 Nov 2017, 17:23

Hi tmc.

Thanks for reporting then :) It has been confirmed that it is a bug and will be resolved soon.

Best Regards,

Panagiotis


@PanagiotisCharalampous

whis.gg
20 Feb 2018, 21:19

Any update?


@whis.gg

whis.gg
20 Feb 2018, 21:57

It's happening inside of robot as well, which makes it really annoying since the robot hasn't IsRealTime property which I could pass to the referenced indicator. Please fix it!


@whis.gg

PanagiotisCharalampous
21 Feb 2018, 10:33

Hi tmc,

This has been fixed and will be released with the next update.

Best Regards,

Panagiotis


@PanagiotisCharalampous