in Search

how to make Elder's Impulse expert system

Last post 02-10-2010, 18:59 by johnl. 5 replies.
Sort Posts: Previous Next
  •  02-08-2010, 12:05 31869

    how to make Elder's Impulse expert system

    I got the formula from
    http://www.meta-formula.com/Metastock-Formulas-E.html#Elders_AutoEnvelope_
    Elder's Impulse system

    { Dr Elder's Impulse system interpretation v1.1}{ Plot signals on own window below daily chart }

    { 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

    I would like to know how can i make this into a expert system so that I can get the alert.
    thanks.
  •  02-09-2010, 18:39 31877 in reply to 31869

    Re: how to make Elder's Impulse expert system


     There shouldn't be any programming to convert the indicator to an expert. Look at how a similar expert is done that you like and follow that example. Use the user manual as a reference. Creating the indicator is usually the difficult part. If you get stuck, post your results.
  •  02-09-2010, 19:29 31879 in reply to 31869

    Re: how to make Elder's Impulse expert system

    this section has undefined errors listed in bold
    { System logic }
    Out:={EmaW AND }EmaD AND HistIn1:=EmaW>Ref(EmaW,-1)
    AND EmaD>Ref(EmaD,-1)
    AND Hist>Ref(Hist,-1);
    In:=In1 AND BarsSince(Out)>pdsNoEntry;

    if you correct those the code will work in metastock

    it looks like code from Jose Silva, so look in metastocktools.com
  •  02-09-2010, 19:37 31880 in reply to 31879

    Re: how to make Elder's Impulse expert system

    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

  •  02-10-2010, 13:26 31892 in reply to 31880

    Re: how to make Elder's Impulse expert system

    thanks for all the reply, in metastock expert system, most of them I try before do not has the user input, is there some example in ms10 that use this function, so that I can try to follow it and apply the code into my charts.
    I am using 3 in no entry x periods from last exit.
    thanks.
  •  02-10-2010, 18:59 31893 in reply to 31892

    Re: how to make Elder's Impulse expert system

       Work backwards from simple to hard. Redefine the user inputs to something like:

      pdsNoEntry:=5;
      pdsW:=13*5;
      pdsD:=13;

      etc. to create the expert.
     
     
     
     
     
     

     
View as RSS news feed in XML