Hi guys,
Will you be so kind to make an indicator that shows:
high (blue) / low (blue) / close (yellow) of the previous day
with Monday showing the previous Friday
with time setting (for example from 09.00 – 17.35 hours)
for use in intraday charts
Thank you in advance!
I had already noticed this one, an impressive indicator.
The only thing missing are the time settings.
I use 24-hour charts, but I would like to see the high / low / close of the opening hours, the cashtrade business.
Can this be added?
ZigoParticipant
Master
// For Friend (Zigo)
defparam drawonlastbaronly = true
if intradaybarindex >1 then
DRAWHLINE(Dhigh(1))coloured(0,125,255,255)
DRAWHLINE(Dlow(1))coloured(0,125,255,255)
DRAWHLINE(Dclose(1))coloured(255,255,0,255)
endif
return
Thank you Zigo,
But this doesn’t solve what I asked above, the time settings
I’m sorry, this is not what I’m looking for
Try this one:
ONCE FromD = 090000
ONCE ToD = 160000
ONCE CurC = close
ONCE PrevC = close
ONCE CurH = high
ONCE PrevH = high
ONCE CurL = low
ONCE PrevL = low
dCond = (OpenDayOfWeek >= 1 AND OpenDayOfWeek <= 5)
tCond = OpenTime >= FromD AND OpenTime <= ToD
IF OpenDay <> OpenDay[1] THEN
IF dCond THEN
PrevC = CurC
PrevH = CurH
PrevL = CurL
CurH = high
CurL = low
CurC = close
ENDIF
ENDIF
IF dCond AND tCond THEN
CurC = close
CurL = min(CurL,low)
CurH = max(CurH,high)
ENDIF
RETURN PrevC coloured(238,238,0,255) AS "close",PrevH coloured(0,0,255,255) AS "high",PrevL coloured(0,0,255,255) AS "low
Mille grazie, Roberto!
This is exactly what I meant
After reading again my indicator, I spotted a logical error that makes it not as accurate due to incorrect time detection, this is correct:
ONCE FromD = 090000
ONCE ToD = 160000
ONCE CurC = close
ONCE PrevC = close
ONCE CurH = high
ONCE PrevH = high
ONCE CurL = low
ONCE PrevL = low
dCond = (OpenDayOfWeek >= 1 AND OpenDayOfWeek <= 5)
tCond = OpenTime >= FromD AND OpenTime <= ToD
IF OpenDay <> OpenDay[1] THEN
PrevC = CurC
PrevH = CurH
PrevL = CurL
CurH = 0
CurL = 999999
CurC = 0
ENDIF
IF dCond AND tCond THEN
CurC = close
CurL = min(CurL,low)
CurH = max(CurH,high)
ENDIF
RETURN PrevC coloured(238,238,0,255) AS "close",PrevH coloured(0,0,255,255) AS "high",PrevL coloured(0,0,255,255) AS "low
Hi, coming in late to this thread. Thank you so much for this. Just one question – how would you modify the code to add in the previous day’s Open (@ 8.00am UK time)? Thanks.
There you go:
ONCE FromD = 090000
ONCE ToD = 160000
ONCE CurC = close
ONCE PrevC = close
ONCE CurH = high
ONCE PrevH = high
ONCE CurL = low
ONCE PrevL = low
ONCE CurO = open
ONCE PrevO = open
dCond = (OpenDayOfWeek >= 1 AND OpenDayOfWeek <= 5)
tCond = OpenTime >= FromD AND OpenTime <= ToD
IF OpenDay <> OpenDay[1] THEN
PrevC = CurC
PrevH = CurH
PrevL = CurL
PrevO = CurO
CurH = open
CurL = open
CurO = open
//CurC = close
ENDIF
IF dCond AND tCond THEN
IF CurL = CurO THEN
CurL = low
CurH = high
ENDIF
CurC = close
CurL = min(CurL,low)
CurH = max(CurH,high)
ENDIF
RETURN PrevC coloured(238,238,0,255) AS "close",PrevH coloured(0,0,255,255) AS "high",PrevL coloured(0,0,255,255) AS "low",PrevO coloured(0,255,255,255) AS "open"
am getting some funny results with the above. Shouldn’t it be
CurH = high
CurL = low
CurO = close
in lines 18-20? Thanks
You need that at line 24 to detect when it all needs to start.
It just ignores any value prior to the starting time.