T Average w Trend Direction Expert You will need the Power Pivots Plus Add-on for this Expert to work. This is designed for a daily chart Highlights Long A1:= ExtFml("PowerPivots.TrendDirection",1,1); A2:= ExtFml("PowerPivots.TrendDirection",1,2); TD:=If(A1=1,1,If(A1=-1,-1,0))+If(A2=1,2,If(A2=-1,-2,0)); htfData:=ExtFml("PowerPivots.TDataCreate",3,2); x:=Mov(htfData,10,S); MA:=ExtFml("PowerPivots.TDataLocalize",x,2,0); LE:=C>MA AND TD>0; SE:=CMA; B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B>0 Short A1:= ExtFml("PowerPivots.TrendDirection",1,1); A2:= ExtFml("PowerPivots.TrendDirection",1,2); TD:=If(A1=1,1,If(A1=-1,-1,0))+If(A2=1,2,If(A2=-1,-2,0)); htfData:=ExtFml("PowerPivots.TDataCreate",3,2); x:=Mov(htfData,10,S); MA:=ExtFml("PowerPivots.TDataLocalize",x,2,0); LE:=C>MA AND TD>0; SE:=CMA; B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B<0 Out A1:= ExtFml("PowerPivots.TrendDirection",1,1); A2:= ExtFml("PowerPivots.TrendDirection",1,2); TD:=If(A1=1,1,If(A1=-1,-1,0))+If(A2=1,2,If(A2=-1,-2,0)); htfData:=ExtFml("PowerPivots.TDataCreate",3,2); x:=Mov(htfData,10,S); MA:=ExtFml("PowerPivots.TDataLocalize",x,2,0); LE:=C>MA AND TD>0; SE:=CMA; B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B=0 Symbols Long Entry A1:= ExtFml("PowerPivots.TrendDirection",1,1); A2:= ExtFml("PowerPivots.TrendDirection",1,2); TD:=If(A1=1,1,If(A1=-1,-1,0))+If(A2=1,2,If(A2=-1,-2,0)); htfData:=ExtFml("PowerPivots.TDataCreate",3,2); x:=Mov(htfData,10,S); MA:=ExtFml("PowerPivots.TDataLocalize",x,2,0); LE:=C>MA AND TD>0; SE:=CMA; B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B>0 AND Ref(B,-1)<=0 Short entry A1:= ExtFml("PowerPivots.TrendDirection",1,1); A2:= ExtFml("PowerPivots.TrendDirection",1,2); TD:=If(A1=1,1,If(A1=-1,-1,0))+If(A2=1,2,If(A2=-1,-2,0)); htfData:=ExtFml("PowerPivots.TDataCreate",3,2); x:=Mov(htfData,10,S); MA:=ExtFml("PowerPivots.TDataLocalize",x,2,0); LE:=C>MA AND TD>0; SE:=CMA; B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B<0 AND Ref(B,-1)>=0 Long Exit A1:= ExtFml("PowerPivots.TrendDirection",1,1); A2:= ExtFml("PowerPivots.TrendDirection",1,2); TD:=If(A1=1,1,If(A1=-1,-1,0))+If(A2=1,2,If(A2=-1,-2,0)); htfData:=ExtFml("PowerPivots.TDataCreate",3,2); x:=Mov(htfData,10,S); MA:=ExtFml("PowerPivots.TDataLocalize",x,2,0); LE:=C>MA AND TD>0; SE:=CMA; B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B=0 AND Ref(B,-1)>0 Short exit A1:= ExtFml("PowerPivots.TrendDirection",1,1); A2:= ExtFml("PowerPivots.TrendDirection",1,2); TD:=If(A1=1,1,If(A1=-1,-1,0))+If(A2=1,2,If(A2=-1,-2,0)); htfData:=ExtFml("PowerPivots.TDataCreate",3,2); x:=Mov(htfData,10,S); MA:=ExtFml("PowerPivots.TDataLocalize",x,2,0); LE:=C>MA AND TD>0; SE:=CMA; B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B=0 AND Ref(B,-1)<0