Learning Pine Script, I wonder why this simple code doesn’t do the job. I wan’t to mark every candle with a lower high than next candles close. Here is my code:
condition = high < close[1]
plotshape(condition, title="High < Next Close", style=shape.arrowup, location=location.abovebar, color=color.red)
The result ist something like this. Can anyone help to fix this?
Your current condition is not marking the high of the current candle to the low or the close of the next candle.Try this code instead:
indicator("Mark Lower High Than Next Close", overlay=true)
condition = high < close[1]
plotshape(series=condition, title="High < Next Close", style=shape.arrowup,
location=location.abovebar, color=color.red)
New contributor
pranjal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.