LonesomeTheBlue

Intelligent Moving Average

For 4 simple moving averages, the script tests every single combination for maximum profitability and finds the best pair.

Combinations:
sma1 and sma2,
sma1 and sma3,
sma1 and sma4,
sma2 and sma3,
sma2 and sma4,
sma3 and sma4

And then paint the pair which get best performance. sma lengths are optional, so you can change lengths as you wish.

You will see in some charts that for example sma1 and sma2 pair was best perfrmance and colored on the chart but then sma2 and sma3 pair got better performance, so script starts to paint sma2 and sma3. so it's dynamic based on best performance.

keep in mind => length1 < length2 < length3 < length4 will be better


I didn't have enough time to test the script, so please comment when you test it.



by LonesomeTheBlue
Release Notes:
upgraded to v4

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?