//% chg in mtf
TimeFrameSet(inDaily);
diffd = (C / Ref(C,-1))*100-100;
TimeFrameRestore();
diffd1=TimeFrameExpand(diffd,inDaily);
TimeFrameSet(inHourly);
diffh = (C / Ref(C,-1))*100-100;
TimeFrameRestore();
diffh1=TimeFrameExpand(diffh,inHourly);
TimeFrameSet(in15Minute*2);
diff30 = (C / Ref(C,-1))*100-100;
TimeFrameRestore();
diff30a=TimeFrameExpand(diff30,in15Minute*2);
TimeFrameSet(in15Minute);
diff15 = (C / Ref(C,-1))*100-100;
TimeFrameRestore();
diff15a=TimeFrameExpand(diff15,in15Minute);
TimeFrameSet(in5Minute);
diff5 = (C / Ref(C,-1))*100-100;
TimeFrameRestore();
diff5a=TimeFrameExpand(diff5,in5Minute);
Plot(C,"",47,128);
Filter=1;
AddColumn(diffd1,"daily chg",1.2, textcolor=IIf( Ref(C,- 1)>C,colorGreen,colorRed)) ;
AddColumn(diffh1,"60m chg",1.2, textcolor=IIf( Ref(C,- 1)>C,colorGreen,colorRed)) ;
AddColumn(diff30a,"30m chg",1.2, textcolor=IIf( Ref(C,- 1)>C,colorGreen,colorRed)) ;
AddColumn(diff15a,"15 chg",1.2, textcolor=IIf( Ref(C,- 1)>C,colorGreen,colorRed)) ;
AddColumn(diff5a,"5m chg",1.2, textcolor=IIf( Ref(C,- 1)>C,colorGreen,colorRed)) ;
Filter=2;
Buy=diffd1>0 AND diffh1>0 AND diff30a>0 AND diff15a>0 AND diff5a>0;
Sell=diffd1<0 AND diffh1<0 AND diff30a<0 AND diff15a<0 AND diff5a<0;
AddColumn(Filter,"Buy/Sell",1.2, textcolor=IIf(Ref(Buy,0)>0,colorGreen,colorRed)) ;