I have an indicator that detects the last bar when an event occurred, then reports the number of seconds ago for that bar.
This relies on accurate information being returned by Time[]
This works fine when my indicator is applied to a basic Price input series (such as High).
But if my indicator uses another indicator (such as SMA(20)) as input series, it seems that NT loses the Time[] info, so everything in the Time[] series contains 1 Jan 1800 !
Does anyone know if this bug has been fixed in v 23?
Is there any workaround to force Time[] to populate in nested indicators?
Steps to reproduce the problem:
1) Create a simple indicator called SecondsSinceLastBar (no parameters) using this code in OnBarUpdate()
double val = Time[0].Subtract(Time[1]).TotalSeconds;
Value.Set(val);
Now set the SecondsSinceLastBar indicator to use another indicator, such as SMA(20) as the input series. It displays 0. This is because the Time[] array is zeroed (treated as 1 Jan 1800).
Erratic bar durations for sub-minute charts in beta 22:
I thought this test indicator would be useless, but if I apply the indicator to say a 5 second chart (applying the indicator to the default input series (close)), I would expect to see a line at value 5. But the line fluctuates wildly between 5 and 15, showing that NT beta 22 has used erratic bar durations. Has this been fixed by v 23?
Comment