I often hesitate to help with code (as I’m great either! 🙂 ) but substitute values in your cond 1 and 2 and you will see. E.g. high 11230 high – 11210 low / 2 = 10 so it is always going to be lower than ST and never higher … unless you get the biggest spike ever seen? 🙂
1
2
cond1=((High[0]-Low[0])/2)>Supertrend[3,10]// Conditions for long positions
cond2=((High[0]-Low[0])/2)<Supertrend[3,10]// Conditions for short positions
If you use Close > Supertrend etc then it will work.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.