If 1 moving average is a fine thing, 2 averages should be even better. But judge for yourself and test this colour coded double sma indicator.
On the properties page you can set the periods of the two moving averages. the indicator will give you a green chart if the market trades above the short moving average & the short average is above the long average & the long average is rising. (reverse conditions for red condition)
The chart shows the german DAX index on a weekly basis using the 54/21 setting.
Trading idea:
Buy if the chart is green and breaks its previous local high. Sell if it falls below last local low.
Indicator code:
Meta: subchart(true);
Inputs: periodLong(54), periodShort(21);
variables: smaL, smaS, colour;
smaL=average(close,periodLong); // use xaverage for exponential moving average
smaS=average(close,periodShort);
colour=black;
if smaS>smaL and close>smaS then colour=darkgreen;
if smaS<smaL and close
drawbar(o,h,l,c,colour,colour);
drawline(smaS);
drawline(smaL);