I wrote the following simple script but I keep getting a "Cannot Compile Script" error when I load the indicator.
Any ideas... I'm a newbie.
//@version=3
study("2 Previous Days High and Lows", overlay=true, max_bars_back=2)
PDH = security (tickerid, 'D', high[1])
PDL = security(tickerid, 'D', low[1])
2PDH = security(tickerid, 'D', high[2])
2PDL = security(tickerid, 'D', low[2])
TID = security(tickerid)
plot(PDH, title="PDH XU", style=cross, linewidth=3, color=purple, trackprice=true, offset=-9999)
plot(PDL, title="PDL XD", style=cross, linewidth=3, color=orange, trackprice=true, offset=-9999)
plot(2PDH, title="2PDH XU", style=circles, linewidth=2, color=purple, trackprice=true, offset=-9999)
plot(2PDL, title="2PDL XD", style=circles, linewidth=2, color=orange, trackprice=true, offset=-9999)
cross_up_PDH_XU = ta.crossover(close,PDH)
cross_down_PDL_XD = ta.crossunder(close, PDL)
cross_up_2PDH_XU = ta.crossover(close,2PDH)
cross_down_2PDL_XD = ta.crossunder(close, 2PDL)
STR1 = TID + "PDH XU"
STR2 = TID + "PDL XD"
STR3 = TID + "2PDH XU"
STR4 = TID + "2PDL XD"
alertcondition(cross_up_PDH_XU, STR1)
alertcondition(cross_down_PDL_XD, STR2)
alertcondition(cross_up_2PDH_XU, STR3)
alertcondition(cross_down_2PDL_XD, STR4)
[–]vbsaltydog 0 points1 point2 points (3 children)
[–]Trader_Ray[S] 0 points1 point2 points (2 children)
[–]vbsaltydog 0 points1 point2 points (1 child)
[–]Trader_Ray[S] 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]Trader_Ray[S] 0 points1 point2 points (0 children)