IsLastBar and IsRealTime not working in referenced indicators
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); } } }
Replies
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
PanagiotisCharalampous
21 Feb 2018, 10:33
Hi tmc,
This has been fixed and will be released with the next update.
Best Regards,
Panagiotis
@PanagiotisCharalampous
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