import TradingView/ta/5
s21 = supertrend(21,1)
s14 = supertrend(14,2)
s7 = supertrend(17,3)
long = color(s21)=color(s14)=color(s7)=color.green
short = color(s21)=color(s14)=color(s7)=color.red
start = timestamp(IST,2020,1,1,0,0,0)
end = timestamp(IST,2023,6,250,0,0,0)
strategy.entry("Buy",strategy.long,100,when = long)
strategy.close("buy",when = short)
I want to buy when the specified supertrends are in an up trend(green) and sell when they are in a down trend(red). I am trying to convert it to version 5 but sends an error please help...
I tried correcting it in chatgpt,bard and all others did not work ta.supertrend is not recognized