When I tried to write a test indicator which use bar_stream as its data source, one thing looks very strange to me: each bar will trigger 8 times in the Indicator Debugger program.
my Update() function:
- Code: Select all
function Update(period)
if period >= first and source:hasData(period) then
print("OHLC(@serial" .. source:serial (period) .. "): "
.. source.open[period] .. ","
.. source.high[period] .. ","
.. source.low[period] .. ","
.. source.close[period])
end
when I ran it in debugger, one bar will be triggered 8 times.
E.g. for this bar: "DAT;24.02.2011 17:00:00;1.379670;1.383700;1.372250;1.374390;1.380390;1.383970;1.372500;1.374630;163984;163984", it produces:
OHLC(@serial3859): 1.37967,1.37967,1.37967,1.37967
OHLC(@serial3859): 1.37967,1.38168,1.37967,1.38168
OHLC(@serial3859): 1.37967,1.3837,1.37967,1.3837
OHLC(@serial3859): 1.37967,1.3837,1.37967,1.37988
OHLC(@serial3859): 1.37967,1.3837,1.37606,1.37606
OHLC(@serial3859): 1.37967,1.3837,1.37225,1.37225
OHLC(@serial3859): 1.37967,1.3837,1.37225,1.37332
OHLC(@serial3859): 1.37967,1.3837,1.37225,1.37439
and we can see only the last one is correct.
Anyone who knows if this is a bug or something else??