Hello has any one managed to code the daily (Session) high, low and mid ([(High – Low)/2]+Low )price? I can’t seem to find it in the indicators library?
Many regards
Joe
There you go:
IF IntraDayBarIndex = 0 THEN
DailyHigh = high
DailyLow = low
ENDIF
DailyHigh = max(DailyHigh,high)
DailyLow = min(DailyLow,low)
DailyMid = DailyLow + ((DailyHigh - DailyLow) / 2)
RETURN DailyHigh AS "Dhigh",DailyLow AS "Dlow",DailyMid AS "Dmid"
Possible to add specific market hour into the script you posted <span class=”bbp-author-name”>robertogozzi</span>?
BR
Mathias
Yes, you have to set both the StartTime and EndTime (not tested):
ONCE StartTime = 090000
ONCE EndTime = 170000
ONCE DailyHigh = 0
ONCE DailyLow = 0
ONCE DailyMid = 0
IF EndTime >= StartTime THEN
IF (OpenTime >= StartTime) AND (OpenTime <= StartTime) THEN
IF (OpenTime = StartTime) OR ((OpenTime > StartTime) AND (OpenTime[1] < StartTime))
DailyHigh = high
DailyLow = low
ENDIF
DailyHigh = max(DailyHigh,high)
DailyLow = min(DailyLow,low)
DailyMid = DailyLow + ((DailyHigh - DailyLow) / 2)
ENDIF
ELSE
IF (OpenTime >= StartTime) OR (OpenTime <= EndTime) THEN
IF (OpenTime = StartTime) OR ((OpenTime > StartTime) AND (OpenTime[1] < StartTime)) OR ((OpenTime > 000000) AND (OpenTime[1] > OpenTime)) THEN
DailyHigh = high
DailyLow = low
ENDIF
DailyHigh = max(DailyHigh,high)
DailyLow = min(DailyLow,low)
DailyMid = DailyLow + ((DailyHigh - DailyLow) / 2)
ENDIF
ENDIF
RETURN DailyHigh AS "Dhigh",DailyLow AS "Dlow",DailyMid AS "Dmid"
@mathiasKN
Do not double post. Ask your question only once and only in one forum. All double posts will be deleted anyway so posting the same question multiple times will just be wasting your own time and will not get you an answer any quicker.
Double posting just creates confusion in the forums.
Thank you 🙂
Thanks Roberto, much obliged!
Absolutely, wont happen again!