TimeFrameSet(in5Minute);
ema5Min=EMA(C,20);
TimeFrameRestore();
EMA_5=TimeFrameExpand(ema5Min, in5Minute, mode=expandFirst);
Plot(EMA_5, "EMA_5_MIN", colorLime, styleThick);
TimeFrameSet(in15Minute);
ema15Min=EMA(C,20);
TimeFrameRestore();
EMA_15=TimeFrameExpand(ema15Min, in15Minute, mode=expandFirst);
Plot(EMA_15, "EMA_15_MIN", colorBlueGrey, styleThick);
TimeFrameSet(30*in1Minute);
ema30Min=EMA(C,20);
TimeFrameRestore();
EMA_30=TimeFrameExpand(ema30Min, 30*in1Minute, mode=expandFirst);
Plot(EMA_30, "EMA_30_MIN", colorRed, styleThick);
TimeFrameSet(inHourly);
ema60Min=EMA(C,20);
TimeFrameRestore();
EMA_60=TimeFrameExpand(ema60Min, inHourly, mode=expandFirst);
Plot(EMA_60, "EMA_60_MIN", colorBlue, styleThick);
P = Param("Points Difference", 5,0.5,25,0.5);
Filter = abs(EMA_5- EMA_15) < P AND abs(EMA_5- EMA_30) < P AND abs(EMA_5-EMA_60) < P AND
abs(EMA_15-EMA_30) < P AND abs(EMA_15-EMA_60) < P AND abs(EMA_30-EMA_60) < P;
AddColumn(EMA_5, "5minTF-20ema");
AddColumn(EMA_15,"15minTF-20ema");
AddColumn(EMA_30,"30minTF-20ema");
AddColumn(EMA_60,"60minTF-20ema");