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. 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.
Do you think it would be possible for you to cook up an iteration that takes two moving averages and then loops through every combination of lengths (between, say, 3 - 50 or something similar) to see what is the most profitable? I assume the logic would be similar to what you're doing here, but I'm not too sure.
Either way, well done, you're a gift
So out of curiosity, if I was to extend your logic from this script, it should work for the idea you have, right? I might try my hand at it (don’t think I’ll get half the distance you did) and send on to you whatever I come up with.
But yeah, I’ve noticed this is a profitable idea and I’ve been waiting for a knight in open-source armor to come and liberate us all.
I'll definitely pass on any revelations to you, but don't hold your breath, I don't know how well I'll do. You're leading the charge at the moment.