[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

1,2,3,4...I declare a systems war, Part II



PureBytes Links

Trading Reference Links

NO Guarentees. I'm not a CTA. Take the idea and test it!! The numbers in the
inputs are the standard numbers the orignators of the ideas used.

{System: Macd Extrm Zones}

Input: Rd(12),Sd(26),Qd(9),Lbck(50),Pct(.95);
Vars: Mod(0),Avgd(0),Upper(0),Lower(0),HH(0),LL(0),Rng(0),VrRng(0);


Mod=Macd(Closed(1),Rd,Sd);
Avgd=XAverage(Macd(CloseD(1),Rd,Sd),Qd);
HH=Highest(Mod,Lbck);
LL=Lowest(Mod,Lbck);
Rng=HH-LL;
VrRng=Rng*Pct;
Upper=LL+VrRng;
Lower=HH-VrRng;

Condition1=Mod crosses above Avgd;
Condition2=Mod crosses below Avgd;
Condition3=Mod crosses above Lower;
Condition4=Mod crosses below Upper;

if currentbar>maxbarsback then begin
 If Condition1 and Condition3  then buy on close;
 If Condition2 then exitlong on close;
 If Condition2 and Condition4  then sell on close;
 If Condition1 then exitshort on close;
end;