Hi All,
Apologies in advance for the noob question but I’ve tried to find the answer to this and can’t!
Can anyone tell me how to define a range as the 12x 5m candles opening from 07:00 to 07:55.
This needs to happen upon the close of the 07:55 candle (ie at 8am).
Oh, I’d also like to add +1 pip to the high, and -1 pip from the low of the range, if this is possible?
Thanks in advance,
Kev
Try this (not tested):
IF OpenTime = 070000 THEN
MaxRange = high
MinRange = low
ENDIF
IF OpenTime >= 070000 AND OpenTime <= 075500 THEN
MaxRange = max(MaxRange,high)
MinRange = min(MinRange,low)
ENDIF
IF time = 080000 THEN
MaxRange = MaxRange + 1 * pipsize
MinRange = MinRange - 1 * pipsize
ENDIF
At 080000 MaxRange and MinRange will contain both extremes with +- 1 pip.
Thanks Roberto, I’ll give it a go.. Much appreciated.
Link to above code added to here
Snippet Link Library