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

Re: [amibroker] Re: DIMITRIS- Question



PureBytes Links

Trading Reference Links




Dimitris,
 
This doesn't seem to plot or show anything. Is there a step missing? I have 
the ~sumCMO25 composite. What next?
 
Steve
<BLOCKQUOTE 
><FONT 
  face=Arial size=2><FONT face=Arial 
  size=2>m25=Foreign("~sumCMO25","C");// after creating the ~sumCMO25 
  in 
  AAm=Foreign("~count","v");meanCMO25=m25/m;DD=DEMA(MEANCMO25,15);H=dd;L=dd;// 
  the replacementcc=SAR(0.01,0.2 );This 0.01 works well for the N100 
  database, it would be better to vary from 0.01 to 0.08 according to the 
  trend evolution.The same for 0.2, it would be better to go up to 0.8 
  sometimes.Dimitris Tsokakis--- In amibroker@xxxxxxxxxxxxxxx, 
  "bluesinvestor" <investor@xxxx> wrote:> Hello 
  Dimitris,> > A little modification from Tomasz original code and 
  'kitakste edho'> (excuse my lousy Greek ;)> > 
  Regards,> Peter> > function SARafl( Cvar, Hvar, Lvar, 
  IAF, MaxAF )> {>       //IAF = 
  0.02;       // acceleration factor> 
        //MaxAF = 0.02;     // max 
  acceleration> >       psar = 
  Cvar;            // 
  initialize>       long = 
  1;        // assume long for initial 
  conditions>       af = 
  IAF;         // init acelleration 
  factor>       ep = Lvar[ 0 ];   // 
  init extreme point>       hp = Hvar [ 0 
  ];>       lp = Lvar [ 0 ];> > 
        for( i = 2; i < BarCount; i++ )> 
        {>       
        if ( long )> 
              {> 
              
        psar [ i ] = psar [ i-1 ] + af * ( hp - psar 
  [> i-1 ] );>       
        }>       
        else>       
        {>       
              psar [ i ] = 
  psar [ i-1 ] + af * ( lp - psar [> i-1 ] );> 
              }> 
  >             reverse 
  =  0;>       
        //check for reversal> 
              if ( long 
  )>             
  {>             
        if ( Lvar [ i ] < psar [ i ]  )> 
              
        {>       
              
        long = 0; reverse = 1; // reverse> 
  position to Short>       
              
        psar [ i ] =  
  hp;       // SAR is Hvar> point in prev 
  trade>             
              lp = Lvar [ i 
  ];>             
              af = 
  IAF;>             
        }>       
        }>       
        else>       
        {>       
              if ( Hvar [ i ] 
  > psar [ i ]  )>       
              {> 
              
              long = 1; 
  reverse = 1;        //reverse> 
  position to long>       
              
        psar [ i ] =  lp;> 
              
              hp = Hvar [ i 
  ];>             
              af = 
  IAF;>             
        }>       
        }> > 
              if ( reverse == 
  0 )>             
  {>             
        if ( long )> 
              
        {>       
              
        if ( Hvar [ i ] > hp ) > 
              
              {> 
              
              
        hp = Hvar [ i ]; > 
              
              
        af = af + IAF; > 
              
              
        if( af > MaxAF ) af = MaxAF; > 
              
              
  }>              
  >             
              if( Lvar[ i - 1 
  ] < psar[ i ] ) psar[ i> ] = Lvar[ i - 1 ];> 
              
              if( Lvar[ i - 2 
  ] < psar[ i ] ) psar[ i> ] = Lvar[ i - 2 ];> 
              
        }>       
         else> 
              
        {>       
              
        if ( Lvar [ i ] < lp )  > 
              
              { > 
              
              
        lp = Lvar [ i ]; > 
              
              
        af = af + IAF; > 
              
              
        if( af > MaxAF ) af = MaxAF; > 
              
              
  }      >       
              
        >       
              
        if( Hvar[ i - 1 ] > psar[ i ] ) psar[ 
  i> ] = Hvar[ i - 1 ];>       
              
        if( Hvar[ i - 2 ] > psar[ i ] ) psar[ 
  i> ] = Hvar[ i - 2 ];> > 
              
        }>       
        }>       
  }>       return psar;> }> 
  > Plot( Close, "Price", colorBlack, styleCandle );> Plot( psar, 
  "SAR", colorRed, styleDots | styleNoLine | styleThick );> > 
  Filter=1;> AddColumn(SAR(.02,.02),"SAR");> 
  AddColumn(SARafl(C,H,L,0.02,0.02),"SARafl");> > -----Original 
  Message-----> From: DIMITRIS TSOKAKIS [mailto:TSOKAKIS@xxxx] > 
  Sent: Friday, May 02, 2003 3:40 AM> To: 
  amibroker@xxxxxxxxxxxxxxx> Subject: [amibroker] Re: DIMITRIS- 
  Question> > Wally,> You may go to> <A 
  href="">http://groups.yahoo.com/group/amibroker/message/38370> 
  <A 
  href="">http://groups.yahoo.com/group/amibroker/message/38424> 
  for the two alternatives.[I hope enough explained].> I try to introduce 
  variable smoothing to an already useful trend > detector, the 
  DEMA(StochD(40),20).> It has nothing to do with PSAR, it is a 
  stand-alone indicator.> Since it is quite smooth, I use 3-bars peak to 
  signal the change of > the direction.> DT> PS. We will 
  follow a similar procedure, when PSAR will accept > variable 
  parameters, to improove PSAR results.> > --- In 
  amibroker@xxxxxxxxxxxxxxx, "netbull2000" <netbull2000@xxxx> > 
  wrote:> > I read in one of the messages here that you came up with 
  some new > > trend indicator that seems to be better than PSAR. 
  Could you please > > point me to your relevant message 
  concerning this indicator. I am > > interested in this as PSAR is 
  about the only indicator I have some > > respect for.> 
  > > > Thanks...> > Wally> > > 
  > Send BUG REPORTS to bugs@xxxx> Send SUGGESTIONS to 
  suggest@xxxx> -----------------------------------------> Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx > (Web 
  page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)> 
  --------------------------------------------> Check group FAQ 
  at:> <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  > > Your use of Yahoo! Groups is subject to> <A 
  href="">http://docs.yahoo.com/info/terms/Send 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


ADVERTISEMENT









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.