I’m new in programming.
I would to write backtesting for “super Trend” indicator.
How to detect when the indicator changed it’s color ?
There you go:
ST = Supertrend[3,10]
Bullish = close > ST
Bearish = close < ST
Change = (Bullish AND Bearish[1]) OR (Bullish[1] AND Bearish)
The variable CHANGE will be true when there’s been a change in the colour. You can use either BULLISH or BEARISH to know whare it is sitting on the chart.
It happens when the Close crosses over or crosses under:
red = close crosses under supertrend[3,10]
green = close crosses over supertrend[3,10]