Plotting the previous day high/low on intraday chart
Forums › ProRealTime English forum › ProBuilder support › Plotting the previous day high/low on intraday chart
- This topic has 6 replies, 3 voices, and was last updated 1 year ago by pableitor.
-
-
02/06/2023 at 8:35 AM #209192
Hello!
With the great help from this forum I have the indicator below on my charts. Thanks!
But I realise I need some modification which I am struggling with. What I want is that the line of the previous high and low should be drawn (one single horisantal line not connected with the other days) on each day, not just the current day. Keeping in mind that the day in the intraday chart should be defined as midnight to midnight according to the set timezone.
Anyone could help me with this?
Thank you!
1234567891011121314151617181920212223242526272829303132333435363738DEFPARAM DrawOnLastBarOnly = TrueONCE NYtime = 000000ONCE CurO = openONCE CurH = highONCE PrevH = highONCE CurL = lowONCE PrevL = lowONCE CurHw = highONCE CurLw = lowONCE PrevHw = highONCE PrevLw = lowONCE OdW = 0IF OpenDayOfWeek < OpenDayOfWeek[1] THENOdW = 1ENDIFIF (OpenTime = NYtime) OR ((OpenTime > NYtime) AND (OpenTime[1] < NyTime)) THENIF OdW = 1 THENPrevHw= CurHwPrevLw= CurLwCurHw = highCurLw = lowOdW = 0ENDIFCurO = openPrevH = CurHPrevL = CurLCurH = highCurL = lowStart = BarIndexENDIFCurH = max(high,CurH)CurL = min(low,CurL)CurHw = max(high,CurHw)CurLw = min(low,CurLw)DrawSegment(Start,CurO,BarIndex,CurO) coloured("Black") style(Line,2)DrawSegment(start,PrevH,BarIndex,PrevH) coloured("red") style(Line,2)DrawSegment(start,PrevL,Barindex,PrevL) coloured("red") 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"02/06/2023 at 11:28 AM #20921802/06/2023 at 11:56 AM #20922302/06/2023 at 12:11 PM #20922502/06/2023 at 12:21 PM #20922602/06/2023 at 4:51 PM #209249Hi, I used this trick with some indicator sometime ago and it worked:
123456789if opentime >=235900 and opentime <= 000100 then //if we work in the 1min TFalpha = 0elsealpha = 255endif.....return prevh coloured (0,0,255,alpha) //repeat with the rest of the linesAs you see the trick is just zero the alpha (intensity of the color ) between the last and first candles of the day (235900 and 000100 in the 1 min TF) to hide the ugly vertical lines.
1 user thanked author for this post.
02/06/2023 at 8:01 PM #209258 -
AuthorPosts
Find exclusive trading pro-tools on