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

[amibroker] Re: DIMITRIS- Question



PureBytes Links

Trading Reference Links

Steve,
sorry, it was not a full code.
The curves to plot are DD and cc, ie the smoothed MeanCMO and its SAR 
companion.
Plot(DD,"",(dd>Cc)*5+(dd<=Cc)*4,8);
Plot(Cc,"",2,8);

--- In amibroker@xxxxxxxxxxxxxxx, "Steve Almond (F)" <steve@xxxx> 
wrote:
> Dimitris,
> 
> This doesn't seem to plot or show anything. Is there a step 
missing? I have the ~sumCMO25 composite. What next?
> 
> Steve
> 
>   m25=Foreign("~sumCMO25","C");// after creating the ~sumCMO25 in AA
>   m=Foreign("~count","v");
>   meanCMO25=m25/m;
>   DD=DEMA(MEANCMO25,15);
>   H=dd;L=dd;// the replacement
>   cc=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@x...] 
>   > Sent: Friday, May 02, 2003 3:40 AM
>   > To: amibroker@xxxxxxxxxxxxxxx
>   > Subject: [amibroker] Re: DIMITRIS- Question
>   > 
>   > Wally,
>   > You may go to
>   > http://groups.yahoo.com/group/amibroker/message/38370
>   > 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: 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
>   > http://docs.yahoo.com/info/terms/
> 
> 
>         Yahoo! Groups Sponsor 
>        
>        
> 
>   Send BUG REPORTS to bugs@xxxx
>   Send SUGGESTIONS to suggest@xxxx
>   -----------------------------------------
>   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.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Rent DVDs from home.
Over 14,500 titles. Free Shipping
& No Late Fees. Try Netflix for FREE!
http://us.click.yahoo.com/BVVfoB/hP.FAA/uetFAA/GHeqlB/TM
---------------------------------------------------------------------~->

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 http://docs.yahoo.com/info/terms/