Horizontal Line On Previous Candle High & Low
- This topic has 5 replies, 2 voices, and was last updated 7 months ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
Similar topics:
Forums › ProRealTime English forum › ProBuilder support › Horizontal Line On Previous Candle High & Low
Hi all! May I ask someone to kindly code me an indicator that shows a horizontal line from the previous daily candle high and low. I’ve seen various codes for highs and lows of daily timeframes but I’m after a horizontal line from the previous daily candle itself (not the timeframe) to the current day
I’ve been looking through the forum to find what I thought must be a request or feature by someone but…nope!
Can someone help with this for me please?
I’ve attached a screenshot of what I’m trying to describe.
There you go:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
DEFPARAM DrawOnLastBarOnly = true Timeframe(Daily,UpdateOnClose) lowD = low highD = high // timeframe(default) ONCE StartBAR = BarIndex IF (lowD <> lowD[1]) OR (highD <> highD[1]) THEN StartBAR = BarIndex ENDIF DrawSegment(StartBAR,highD,BarIndex + 1,highD) coloured("Cyan") style(line,4) DrawSegment(StartBAR,lowD, BarIndex + 1,lowD) coloured("Cyan") style(line,4) RETURN |
There you go:
Press CTRL+C to Copy, CTRL+V to Paste
12345678910111213 DEFPARAM DrawOnLastBarOnly = trueTimeframe(Daily,UpdateOnClose)lowD = lowhighD = high//timeframe(default)ONCE StartBAR = BarIndexIF (lowD <> lowD[1]) OR (highD <> highD[1]) THENStartBAR= BarIndexENDIFDrawSegment(StartBAR,highD,BarIndex + 1,highD) coloured(“Cyan”) style(line,4)DrawSegment(StartBAR,lowD, BarIndex + 1,lowD) coloured(“Cyan”) style(line,4)RETURN
Bless you, thanks Roberto, I’ve applied it but its showing the current high and low, not the previous candle. Can you adjust it for me please?
You are appreciated! Thank you!
Replace lines 3-4 by:
12 lowD = low[1]highD = high[1]
I guess you can tell I’m not good with coding. This is much appreciated. Enjoy your weekend. Thank you!
My lines weren’t prepositioned at low and close so Just to let any one else interested in this code know, I replaced the 1’s with 0’s. The original code is just as useful for lower timeframes and reading price but you can essentially do the same thing with the final code. Thanks so much once again.
Find exclusive trading pro-tools on