Hello,
On a 1 min timeframe, and I would like to know the Open, close, highest and lowest of the previous hour.
How to do it?
Thank you
Use OpenMinute as an index (not tested):
OpenH1 = open[OpenMinute+1]
CloseH1 = close[OpenMinute+1]
HighH1 = high[OpenMinute+1]
LowH1 = low[OpenMinute+1]
It returns the previous minute candle
It’s impossible, the previous minute is [1], [OpenMinute+1] is the same minute of the previous hour.
I think I found it.
T = 10000
If (Time mod T) = 0 then
HH = Highest[60](High)
O = Open[59]
C = Close
LL = Lowest[60](Low)
Endif
return HH As “High”, O As “Open”, C As “Close”, LL As “Low”
That’s a pretty smart solution 😉
Now I understand what you meant.
Always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read.
Clean and simple way would be to use the 1-hour timeframe with MTF instruction:
timeframe(1 hour, updateonclose)
OpenH1 = open
CloseH1 = close
HighH1 = high
LowH1 = low
return openh1,closeh1,highh1,lowh1
Thank you Nicolas,
Does it work with proOrder?