Chaos Balance Lines ChaosBlueBL:= {Alligator Blue Balance Line - Jaw} {13 bar smoothed average offset 8 bars} Ref(Wilders(MP(),13),-8); ChaosRedBL:= {Alligator Red Balance Line - Teeth} {8 bar smoothed average offset 5 bars} Ref(Wilders(MP(),8),-5); ChaosGreenBL:= {Alligator Green Balance Line - Lip} {5 bar smoothed average offset 3 bars} Ref(Wilders(MP(),5),-3); ChaosBlueBL; ChaosGreenBL; ChaosRedBL; ChaosBlueBl ChaosGreenBL Difference ChaosBlueBL:= {Alligator Blue Balance Line - Jaw} {13 bar smoothed average offset 8 bars} Ref(Wilders(MP(),13),-8); ChaosGreenBL:= {Alligator Green Balance Line - Lip} {5 bar smoothed average offset 3 bars} Ref(Wilders(MP(),5),-3); A:=ChaosGreenBL-ChaosBlueBL; A; Chaos Balance Lines Strength M1:=MP()- Ref(Wilders(MP(),5),-3); M2:=MP()- Ref(Wilders(MP(),8),-5); M3:=MP()- Ref(Wilders(MP(),13),-8); Mov(Mov(Mov(M1+M2+M3,2,S),2,S),2,S) Chaos Balance Osc A1:=C-Ref(Wilders(MP(),5),-3); A2:=C-Ref(Wilders(MP(),8),-5); A3:=C-Ref(Wilders(MP(),13),-8); 0;A1;A2;A3; Chaos Fractal { Chaos Fractal (simple version +1=Up, -1=Dn) } High1 := Ref(HIGH,-2); High2 := Ref(HIGH,-1); High3 := Ref(HIGH,0); High4 := Ref(HIGH,1); High5 := Ref(HIGH,2); Low1 := Ref(LOW,-2); Low2 := Ref(LOW,-1); Low3 := Ref(LOW,0); Low4 := Ref(LOW,1); Low5 := Ref(LOW,2); Fractal := If((High3 > High1) AND (High3 > High2) AND (High3 > High4) AND (High3>High5), +1,0); Fractal := If((Low3 < Low1) AND (Low3 < Low2) AND (Low3 < Low4) AND (Low3 < Low5), If(Fractal > 0, 0, -1), Fractal); Fractal; ACC Blue Acc:= Mov(MP(),10,S)- Mov(MP(),70,S)- Mov(Mov(MP(),10,S)- Mov(MP(),70,S),5,S); SIG:=Mov(ACC,5,S); Per1:=Input("lookback",10,100,60); Perc1:=Input("percent uband",.800,.999,.950); Perc2:=Input("percent lband",1.010,1.200,1.050); UB:=Ref((HHV(ACC,Per1)*Perc1),-1); LB:=Ref((LLV(ACC,Per1)*Perc2),-1); MB:=(UB+LB)*.5; UB;LB;Sig;ACC; ACC Green Acc:= Mov(MP(),5,S)- Mov(MP(),17,S)- Mov(Mov(MP(),5,S)- Mov(MP(),17,S),5,S); SIG:=Mov(ACC,5,S); Per1:=Input("lookback",10,100,60); Perc1:=Input("percent uband",.800,.999,.950); Perc2:=Input("percent lband",1.010,1.200,1.050); UB:=Ref((HHV(ACC,Per1)*Perc1),-1); LB:=Ref((LLV(ACC,Per1)*Perc2),-1); UB;LB;SIG;ACC; ACC Red Acc:=Mov(MP(),5,S)- Mov(MP(),34,S)- Mov(Mov(MP(),5,S)- Mov(MP(),34,S),5,S); SIG:=Mov(ACC,5,S); Per1:=Input("lookback",10,100,60); Perc1:=Input("percent uband",.800,.999,.950); Perc2:=Input("percent lband",1.010,1.200,1.050); UB:=Ref((HHV(ACC,Per1)*Perc1),-1); LB:=Ref((LLV(ACC,Per1)*Perc2),-1); UB;LB;SIG;ACC; ---------------------------------------------- I have tried to build a System + Explorer + Expert (separate from Equis add-on which is password protected) based on the book "New Trading Dimensions". I took indicators from the list in www.guppytraders.com and your own list. Following the book, I built a System with Long Entry and Short Entry based on the Alligator Sign (AO, AC and Balance Line signals are used to acculate on profitable positions according to the book and have been included only in the explorer). I had two questions that I hope somebody will be able to answer : A. Some indicators included in your list are not included in the book strategies, namely "Chaos Balance Lines Strength", "Chaos Balance Osc ", "ACC Blue ", "ACC Green" and "ACC Red"; are they part of a more comprehensive Profitunity trading strategy (I did not read William's first book "Trading Chaos" nor did I purchase his educational products)? B. I have a programming problem with one of the exit strategies mentioned in the book; this states that after 5 consecutive bars in the "zone" (Green for longs and Red for shorts) the stop is placed at the low (for longs)/ high (for shorts) of the previous bar until it is hit. I do not know how to fix a point in time when the condition is satisfied from which he new stop rule should apply. The first results of the system are encouraging and would like to share it with you here if I can solve the above problem. Thanks and regards. ----------------------------------------------- ACC Blue Acc:= Mov(MP(),10,S)- Mov(MP(),70,S)- Mov(Mov(MP(),10,S)- Mov(MP(),70,S),5,S); SIG:=Mov(ACC,5,S); Per1:=Input("lookback",10,100,60); Perc1:=Input("percent uband",.800,.999,.950); Perc2:=Input("percent lband",1.010,1.200,1.050); UB:=Ref((HHV(ACC,Per1)*Perc1),-1); LB:=Ref((LLV(ACC,Per1)*Perc2),-1); MB:=(UB+LB)*.5; UB;LB;Sig;ACC; ACC Green Acc:= Mov(MP(),5,S)- Mov(MP(),17,S)- Mov(Mov(MP(),5,S)- Mov(MP(),17,S),5,S); SIG:=Mov(ACC,5,S); Per1:=Input("lookback",10,100,60); Perc1:=Input("percent uband",.800,.999,.950); Perc2:=Input("percent lband",1.010,1.200,1.050); UB:=Ref((HHV(ACC,Per1)*Perc1),-1); LB:=Ref((LLV(ACC,Per1)*Perc2),-1); UB;LB;SIG;ACC; ACC Red Acc:=Mov(MP(),5,S)- Mov(MP(),34,S)- Mov(Mov(MP(),5,S)- Mov(MP(),34,S),5,S); SIG:=Mov(ACC,5,S); Per1:=Input("lookback",10,100,60); Perc1:=Input("percent uband",.800,.999,.950); Perc2:=Input("percent lband",1.010,1.200,1.050); UB:=Ref((HHV(ACC,Per1)*Perc1),-1); LB:=Ref((LLV(ACC,Per1)*Perc2),-1); UB;LB;SIG;ACC; The ACC Red is closest to the original AC Osc, but I added a signal line and Upper and lower bands. The ACC Green and ACC Blue are based on the ideas from Tom Joseph and advanced get, faster and slower Oscillators The chaos Balance lines strength is developed from an idea by John Murphy finding out how far the Balance lines are from a median point ---------------------------------------- ATR Trailing Stop Expert Indicator Per1:=30; RWH:=(H-Ref(L,-Per1))/(ATR(Per1)*Sqrt(Per1)); RWL:=(Ref(H,-Per1)-L)/(ATR(Per1)*Sqrt(Per1)); Pk:=Mov((RWH-RWL),3,W); Val1.5:=If(Pk>0,HHV(H-1.5*ATR(5),10),LLV(L+1.5*ATR(5),10)); Val1.5; Highlights Tab Long Per1:=30; RWH:=(H-Ref(L,-Per1))/(ATR(Per1)*Sqrt(Per1)); RWL:=(Ref(H,-Per1)-L)/(ATR(Per1)*Sqrt(Per1)); Pk:=Mov((RWH-RWL),3,W); Val1.5:=If(Pk>0,HHV(H-1.5*ATR(5),10),LLV(L+1.5*ATR(5),10)); Buy:=C>Val1.5; Sell:=C-1 AND sell>-1)=1; x:=BarsSince(i OR buy)<=BarsSince(i OR sell)=0; X=0 Short Per1:=30; RWH:=(H-Ref(L,-Per1))/(ATR(Per1)*Sqrt(Per1)); RWL:=(Ref(H,-Per1)-L)/(ATR(Per1)*Sqrt(Per1)); Pk:=Mov((RWH-RWL),3,W); Val1.5:=If(Pk>0,HHV(H-1.5*ATR(5),10),LLV(L+1.5*ATR(5),10)); Buy:=C>Val1.5; Sell:=C-1 AND sell>-1)=1; x:=BarsSince(i OR buy)>=BarsSince(i OR sell)=0; X=0 Symbol Tab Long Per1:=30; RWH:=(H-Ref(L,-Per1))/(ATR(Per1)*Sqrt(Per1)); RWL:=(Ref(H,-Per1)-L)/(ATR(Per1)*Sqrt(Per1)); Pk:=Mov((RWH-RWL),3,W); Val1.5:=If(Pk>0,HHV(H-1.5*ATR(5),10),LLV(L+1.5*ATR(5),10)); Buy:=C>Val1.5; Sell:=C-1 AND sell>-1)=1; x:=BarsSince(i OR buy)<=BarsSince(i OR sell)=0; X=0 AND Ref(X,-1)>0 Short Per1:=30; RWH:=(H-Ref(L,-Per1))/(ATR(Per1)*Sqrt(Per1)); RWL:=(Ref(H,-Per1)-L)/(ATR(Per1)*Sqrt(Per1)); Pk:=Mov((RWH-RWL),3,W); Val1.5:=If(Pk>0,HHV(H-1.5*ATR(5),10),LLV(L+1.5*ATR(5),10)); Buy:=C>Val1.5; Sell:=C-1 AND sell>-1)=1; x:=BarsSince(i OR buy)>=BarsSince(i OR sell)=0; X=0 AND Ref(X,-1)>0 ---------------------------- Greetings, Would you mind giving an expanation of the code used for these formulae and the results that will be calculated. What I am looking for is an Indicator that will let me set an ATR Trailing stop in percentage and ATR multiplier terms. We do not have open "short" trading in this country (N.Z.) so the stops would only apply to stocks I hold. I am a relative newcomer to MetaStock and have a dislike of loading anything that I do not understand. Trust this makes sense to you. Regards and thanks, --------------------------------------- Per1:=30; RWH:=(H-Ref(L,-Per1))/(ATR(Per1)*Sqrt(Per1)); RWL:=(Ref(H,-Per1)-L)/(ATR(Per1)*Sqrt(Per1)); Pk:=Mov((RWH-RWL),3,W); {OSC} Val1.5:=If(Pk>0,HHV(H-1.5*ATR(5),10),LLV(L+1.5*ATR(5),10)); {ATR Stop} Buy:=C>Val1.5; {Buy Condition} Sell:=C-1 AND sell>-1)=1; x:=BarsSince(i OR buy)>=BarsSince(i OR sell)=0; X=0 AND Ref(X,-1)>0 we created an oscillator based on the high vs low of 30 days ago,the low vs the high of 30 days ago devided by the atr of 30 days time the square root of 30. If this osc is above 0 we use the highest value of the past ten periods of the high minus 1.5 times the ATR of 5 periods as a trailing stop for long positions. If this osc is Below 0 we use the lowest value of the past ten periods of the low plus 1.5 times the ATR of 5 periods as a trailing stop for short positions. ------------------------------- PowerPivots Plus Add-on new Indicators Auto Support & Resistance PPivot:=Input("P 1=minor 2=intermediate 3=major 4=primary",1,4,2); TPivot:=Input("T -1=minor -2=intermediate -3=major -4=primary",-4,-1,-2); FTrough := LastValue( ExtFml("Powerpivots.NthPivotPrice",Tpivot,0,1)); STrough := LastValue( ExtFml("Powerpivots.NthPivotPrice",Tpivot,1,1)); TTrough := LastValue( ExtFml("Powerpivots.NthPivotPrice",Tpivot,2,1)); FPeak := LastValue( ExtFml("Powerpivots.NthPivotPrice",Ppivot,0,1)); SPeak := LastValue( ExtFml("Powerpivots.NthPivotPrice",Ppivot,1,1)); TPeak := LastValue( ExtFml("Powerpivots.NthPivotPrice",Ppivot,2,1)); PH:=LastValue(ExtFml("Powerpivots.NthPivotPrice",PPivot,0,1)); PL:=LastValue(ExtFml("Powerpivots.NthPivotPrice",TPivot,0,1)); Dist:= LastValue(Max(ph,pl)-Min(ph,pl)/5); Trough1to2:=Abs((FTrough-STrough)/STrough); Trough1to3:=Abs((FTrough-TTrough)/TTrough); Sup:=ValueWhen(1,If(Trough1to2<=dist/100,(FTrough+STrough)/2, If(Trough1to3<=dist/100,FTrough+TTrough/3,0))<>0,If(Trough1to2<=dist/100,(FTrough+STrough)/2,If(Trough1to3<=dist/100,(FTrough+TTrough)/2,0))); Peak1to2:=Abs((FPeak-SPeak)/SPeak); Peak1to3:=Abs((FPeak-TPeak)/TPeak); Res:=ValueWhen(1,If(Peak1to20,If(Peak1to2Mov(D,5,S) AND TD=1; SE:=DMov(D,5,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B>0 Short Piv:=1; Per1:=7; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); D:=Mov((((Log(C/(Max(A1,A2)+(Min(B1,B2)/2))))+1)*50),Per1,E); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=D>Mov(D,5,S) AND TD=1; SE:=DMov(D,5,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B<0 Out Piv:=1; Per1:=7; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); D:=Mov((((Log(C/(Max(A1,A2)+(Min(B1,B2)/2))))+1)*50),Per1,E); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=D>Mov(D,5,S) AND TD=1; SE:=DMov(D,5,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B=0 Symbols Long entry Piv:=1; Per1:=7; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); D:=Mov((((Log(C/(Max(A1,A2)+(Min(B1,B2)/2))))+1)*50),Per1,E); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=D>Mov(D,5,S) AND TD=1; SE:=DMov(D,5,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B>0 AND Ref(B,-1)<=0 Short entry Piv:=1; Per1:=7; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); D:=Mov((((Log(C/(Max(A1,A2)+(Min(B1,B2)/2))))+1)*50),Per1,E); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=D>Mov(D,5,S) AND TD=1; SE:=DMov(D,5,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B<0 AND Ref(B,-1)>=0 Long Exit Piv:=1; Per1:=7; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); D:=Mov((((Log(C/(Max(A1,A2)+(Min(B1,B2)/2))))+1)*50),Per1,E); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=D>Mov(D,5,S) AND TD=1; SE:=DMov(D,5,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B=0 AND Ref(B,-1)>0 Short exit Piv:=1; Per1:=7; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); D:=Mov((((Log(C/(Max(A1,A2)+(Min(B1,B2)/2))))+1)*50),Per1,E); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=D>Mov(D,5,S) AND TD=1; SE:=DMov(D,5,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B=0 AND Ref(B,-1)<0 ---------------------------------------------- This Expert needs the Power Pivot Plus Add-On and needs to be used on daily Charts Highlights long Piv:=2; Per1:=20; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); D:=Mov((((Log(C/(Max(A1,A2)+(Min(B1,B2)/2))))+1)*50),Per1,E); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=D>Mov(D,5,S) AND TD=1; SE:=DMov(D,5,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B>0 Short Piv:=2; Per1:=20; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); D:=Mov((((Log(C/(Max(A1,A2)+(Min(B1,B2)/2))))+1)*50),Per1,E); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=D>Mov(D,5,S) AND TD=1; SE:=DMov(D,5,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B<0 Out Piv:=2; Per1:=20; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); D:=Mov((((Log(C/(Max(A1,A2)+(Min(B1,B2)/2))))+1)*50),Per1,E); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=D>Mov(D,5,S) AND TD=1; SE:=DMov(D,5,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B=0 Symbols Long entry Piv:=2; Per1:=20; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); D:=Mov((((Log(C/(Max(A1,A2)+(Min(B1,B2)/2))))+1)*50),Per1,E); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=D>Mov(D,5,S) AND TD=1; SE:=DMov(D,5,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B>0 AND Ref(B,-1)<=0 Short entry Piv:=2; Per1:=20; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); D:=Mov((((Log(C/(Max(A1,A2)+(Min(B1,B2)/2))))+1)*50),Per1,E); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=D>Mov(D,5,S) AND TD=1; SE:=DMov(D,5,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B<0 AND Ref(B,-1)>=0 Long Exit Piv:=2; Per1:=20; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); D:=Mov((((Log(C/(Max(A1,A2)+(Min(B1,B2)/2))))+1)*50),Per1,E); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=D>Mov(D,5,S) AND TD=1; SE:=DMov(D,5,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B=0 AND Ref(B,-1)>0 Short exit Piv:=2; Per1:=20; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); D:=Mov((((Log(C/(Max(A1,A2)+(Min(B1,B2)/2))))+1)*50),Per1,E); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=D>Mov(D,5,S) AND TD=1; SE:=DMov(D,5,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B=0 AND Ref(B,-1)<0 ------------------------------- Chaikin Money Flow Piv:=Input("pivot type",1,2,1); Per1:=Input("Period",1,50,21); TF:=Input("timeframe",1,30,1); A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); K:=Sum(((C-Min(B1,B2)-(Max(A1,A2)-C))/(Max(A1,A2)-Min(B1,B2))*V),Per1)/Sum(V,Per1); K;Mov(K,7,S); ----------------------------- This expert needs the PowerPivot plus Add-on and needs to be applied to Daily Charts Highlights Long Piv:=1; Per1:=21; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); K:=Sum(((C-Min(B1,B2)-(Max(A1,A2)-C))/(Max(A1,A2)-Min(B1,B2))*V),Per1)/Sum(V,Per1); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=K>0 AND K>Mov(K,7,S) AND TD=1; LX:=K>0 AND KMov(K,7,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B>0 Short Piv:=1; Per1:=21; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); K:=Sum(((C-Min(B1,B2)-(Max(A1,A2)-C))/(Max(A1,A2)-Min(B1,B2))*V),Per1)/Sum(V,Per1); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=K>0 AND K>Mov(K,7,S) AND TD=1; LX:=K>0 AND KMov(K,7,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B<0 Out Piv:=1; Per1:=21; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); K:=Sum(((C-Min(B1,B2)-(Max(A1,A2)-C))/(Max(A1,A2)-Min(B1,B2))*V),Per1)/Sum(V,Per1); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=K>0 AND K>Mov(K,7,S) AND TD=1; LX:=K>0 AND KMov(K,7,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B=0 Symbols Long entry Piv:=1; Per1:=21; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); K:=Sum(((C-Min(B1,B2)-(Max(A1,A2)-C))/(Max(A1,A2)-Min(B1,B2))*V),Per1)/Sum(V,Per1); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=K>0 AND K>Mov(K,7,S) AND TD=1; LX:=K>0 AND KMov(K,7,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B>0 AND Ref(B,-1)<=0 Short entry Piv:=1; Per1:=21; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); K:=Sum(((C-Min(B1,B2)-(Max(A1,A2)-C))/(Max(A1,A2)-Min(B1,B2))*V),Per1)/Sum(V,Per1); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=K>0 AND K>Mov(K,7,S) AND TD=1; LX:=K>0 AND KMov(K,7,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B<0 AND Ref(B,-1)>=0 Long exit Piv:=1; Per1:=21; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); K:=Sum(((C-Min(B1,B2)-(Max(A1,A2)-C))/(Max(A1,A2)-Min(B1,B2))*V),Per1)/Sum(V,Per1); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=K>0 AND K>Mov(K,7,S) AND TD=1; LX:=K>0 AND KMov(K,7,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B=0 AND Ref(B,-1)>0 Short exit Piv:=1; Per1:=21; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); K:=Sum(((C-Min(B1,B2)-(Max(A1,A2)-C))/(Max(A1,A2)-Min(B1,B2))*V),Per1)/Sum(V,Per1); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=K>0 AND K>Mov(K,7,S) AND TD=1; LX:=K>0 AND KMov(K,7,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B=0 AND Ref(B,-1)<0 -------------------------------------- This expert needs the PowerPivot plus Add-on and needs to be applied to Daily Charts Highlights Long Piv:=2; Per1:=42; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); K:=Sum(((C-Min(B1,B2)-(Max(A1,A2)-C))/(Max(A1,A2)-Min(B1,B2))*V),Per1)/Sum(V,Per1); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=K>0 AND K>Mov(K,7,S) AND TD=1; LX:=K>0 AND KMov(K,7,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B>0 Short Piv:=2; Per1:=42; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); K:=Sum(((C-Min(B1,B2)-(Max(A1,A2)-C))/(Max(A1,A2)-Min(B1,B2))*V),Per1)/Sum(V,Per1); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=K>0 AND K>Mov(K,7,S) AND TD=1; LX:=K>0 AND KMov(K,7,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B<0 Out Piv:=2; Per1:=42; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); K:=Sum(((C-Min(B1,B2)-(Max(A1,A2)-C))/(Max(A1,A2)-Min(B1,B2))*V),Per1)/Sum(V,Per1); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=K>0 AND K>Mov(K,7,S) AND TD=1; LX:=K>0 AND KMov(K,7,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B=0 Symbols Long entry Piv:=2; Per1:=42; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); K:=Sum(((C-Min(B1,B2)-(Max(A1,A2)-C))/(Max(A1,A2)-Min(B1,B2))*V),Per1)/Sum(V,Per1); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=K>0 AND K>Mov(K,7,S) AND TD=1; LX:=K>0 AND KMov(K,7,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B>0 AND Ref(B,-1)<=0 Short entry Piv:=2; Per1:=42; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); K:=Sum(((C-Min(B1,B2)-(Max(A1,A2)-C))/(Max(A1,A2)-Min(B1,B2))*V),Per1)/Sum(V,Per1); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=K>0 AND K>Mov(K,7,S) AND TD=1; LX:=K>0 AND KMov(K,7,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B<0 AND Ref(B,-1)>=0 Long exit Piv:=2; Per1:=42; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); K:=Sum(((C-Min(B1,B2)-(Max(A1,A2)-C))/(Max(A1,A2)-Min(B1,B2))*V),Per1)/Sum(V,Per1); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=K>0 AND K>Mov(K,7,S) AND TD=1; LX:=K>0 AND KMov(K,7,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B=0 AND Ref(B,-1)>0 Short Exit Piv:=2; Per1:=42; TF:=1; A1:=ExtFml("PowerPivots.NthPivotPrice",Piv,1,TF); A2:=ExtFml("PowerPivots.NthPivotPrice",Piv,2,TF); B1:=ExtFml("PowerPivots.NthPivotPrice",-Piv,1,TF); B2:=ExtFml("PowerPivots.NthPivotPrice",-Piv,2,TF); K:=Sum(((C-Min(B1,B2)-(Max(A1,A2)-C))/(Max(A1,A2)-Min(B1,B2))*V),Per1)/Sum(V,Per1); TD:=ExtFml("PowerPivots.TrendDirection",1,2); LE:=K>0 AND K>Mov(K,7,S) AND TD=1; LX:=K>0 AND KMov(K,7,S); B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!"); B=0 AND Ref(B,-1)<0 ---------------------