YES, thanks!
I am also trying to add one horizontal line showing open price NY-midnight. This line I only want to be printed for the current day, no history needed.
And one more little help would be appreciated, I would like one horizantal line across the daily chart showing previos weeks high and low.
Thank you!
Or the weekly high and low line would be greta if it was only printed from the actual high and low and forward.
There you go:
DEFPARAM DrawOnLastBarOnly = True
ONCE NYtime = 060000
ONCE CurO = open
ONCE CurH = high
ONCE PrevH = high
ONCE CurL = low
ONCE PrevL = low
ONCE CurHw = high
ONCE CurLw = low
ONCE PrevHw = high
ONCE PrevLw = low
ONCE OdW = 0
IF OpenDayOfWeek < OpenDayOfWeek[1] THEN
OdW = 1
ENDIF
IF (OpenTime = NYtime) OR ((OpenTime > NYtime) AND (OpenTime[1] < NyTime)) THEN
IF OdW = 1 THEN
PrevHw= CurHw
PrevLw= CurLw
CurHw = high
CurLw = low
OdW = 0
ENDIF
CurO = open
PrevH = CurH
PrevL = CurL
CurH = high
CurL = low
Start = BarIndex
ENDIF
CurH = max(high,CurH)
CurL = min(low,CurL)
CurHw = max(high,CurHw)
CurLw = min(low,CurLw)
DrawSegment(Start,CurO,BarIndex,CurO) coloured("Green") style(Line,2)
RETURN PrevH coloured("Blue") style(Line,2) AS "Previous DAY high",PrevL coloured("Red") Style(Line,2) AS "Previous DAY low",PrevHw coloured("Gold") style(Line,2) AS "Previous WEEK high",PrevLw coloured("Fuchsia") Style(Line,2) AS "Previous WEEK low"
Thank you!
Just the previous weekly high/low that gives a strange result (or a result I didnt had in mind).
On the daily chart I want just a line from the high/low of the previous week and covering the current week. I dont want any lines for the weeks before the previous week.