I have a stream, eg. 15 min, and i want to find out the high of the last two days.
function Init()
...
indicator:requiredSource(core.Bar);
indicator:type(core.Indicator);
...
end
function Prepare()
source= instance.source;
...
end
function Update(period)
if source:hasData(period) then
-- with source.high[period] i can find out the high values
source.high[period]
-- with source:date(period) the date
source:date(period)
...
end
What is the easiest and fastest way to find out the high of the last two days. Consider my stream is eg 15 minutes.
Then I want to draw a horizontal line of the last two days high in my current view. Or at least from the high to the end of the stream.
that will be done with: core.host:execute(...)
Theoretical it's enough to make the line on the screen only (on the visible area only). If I make a horizontal line with Marketscope is it only on the screen or is it all over the stream? (i hope that question is clear)
Some suggestions are welcome.
btw: function Update(period) runs always first through the complete stream from 0 to source:size()-1. Is that correct? And then with every new update of period in realtime. Correct?