I have a pine script to draw previous day high/open/low as shown below:
//@version=4
strategy("Plot Lines", overlay=true)
PDH = security(syminfo.tickerid,"D",high)
PDO = security(syminfo.tickerid,"D",open)
PDL = security(syminfo.tickerid,"D",low)
plot(PDH, title="High",color=color.red,linewidth=2,trackprice=true)
plot(PDO, title="Open",color=color.yellow,linewidth=2,trackprice=true)
plot(PDL, title="Low",color=color.green,linewidth=2,trackprice=true)
The script work well but I only want previous day to be shown and ignore the others day before previous day so that the chart will not be that messy.
This is what I get from the script above:
As you can see, it plot the PDH/PDO/PDL for every previous day, but I just want previous day (one day) only. Any help or advice will be greatly appreciated!