_SECTION_BEGIN("Moving Average");
x=Param("EMA 1",20,1,200,1);
y=Param("EMA 2", 50,1,200,1);
z=Param("EMA 3",100,1,200,1);
zz=Param("EMA 4",200,1,200,1);
EMA20= EMA(C,x);
EMA50=EMA(C,y);
EMA100= EMA(C,z);
EMA200=EMA(C,zz);
SUT=EMA(C,5)>EMA20;
SDT=EMA20>EMA(C,5);
mut= EMA20>EMA50;
mdt=EMA20<EMA50;
LUT=EMA50>EMA200;
LDT=EMA200>EMA50;
_SECTION_END();
_SECTION_BEGIN("Mid Term Price Trend");
MPT = IIf( mut, colorGreen, IIf( mdt, colorRed, colorYellow));
Plot( 3, "", MPT, styleArea|styleOwnScale|styleNoLabel, 0, 100);
_SECTION_END();
_SECTION_BEGIN("Short Term Price Trend");
SPT = IIf( EMA(C,5)>EMA20, colorBrightGreen, IIf( EMA20>EMA(C,5), colorPink, colorYellow));
Plot( 6, "", SPT, styleArea|styleOwnScale|styleNoLabel, 0, 100);
_SECTION_END();
_SECTION_BEGIN("Long Term Price Trend");
LPT = IIf( EMA(C,50)>EMA200, colorAqua, IIf( EMA200>EMA(C,50), colorOrange, colorYellow));
Plot( 9, "", LPT, styleArea|styleOwnScale|styleNoLabel, 0, 100);
_SECTION_END();