Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/29/2004(UTC) Posts: 1,394 Location: Glastonbury, CT
Was thanked: 2 time(s) in 2 post(s)
|
here is the code from Jose Silva and Metastocktools.com ====================== Elder's Impulse system ====================== ---8<------------------------------------------
{ Dr Elder's Impulse system interpretation v1.1 Plot signals on own window below daily chart. http://www.elder.com/MetaStock/Impulse.htm
http://www.metastocktools.com }
{ Variables user-input } pdsNoEntry:=Input("No entry x periods from last exit",0,21,5); pdsW:=Input("Weekly EMA periods",1,520,13)*5; pdsD:=Input("Daily EMA periods",1,252,13); pdsShort:=Input("Shorter MACD periods", 1,252,12); pdsLong:=Input("Longer MACD periods",2,2520,26); pdsSignal:=Input("MACD trigger signal periods", 2,252,9); tradeDelay:=0;
{ Indicators } EmaW:=Mov(C,pdsW,E); EmaD:=Mov(C,pdsD,E); Mac:=Mov(C,pdsShort,E)-Mov(C,pdsLong,E); MacTrig:=Mov(Mac,pdsSignal,E); Hist:=Mac-MacTrig;
{ System logic } Out:={EmaW<Ref(EmaW,-1) AND }EmaD<Ref(EmaD,-1) AND Hist<Ref(Hist,-1); In1:=EmaW>Ref(EmaW,-1) AND EmaD>Ref(EmaD,-1) AND Hist>Ref(Hist,-1); In:=In1 AND BarsSince(Out)>pdsNoEntry;
{ System signals } Init:=Cum(In+Out>-1)=1; InInit:=Cum(In)=1; flag:=Ref(BarsSince(Init OR In) <BarsSince(Init OR Out)+InInit,-tradeDelay); signals:=(InInit AND Alert(InInit=0,2) OR flag AND Alert(flag=0,2)) -(flag=0 AND Alert(flag,2));
{ Plot } 0;signals
---8<------------------------------------------
http://www.metastocktools.com
|