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

[amibroker] Re: FORCE INDEX



PureBytes Links

Trading Reference Links

Sjaak,
Yes. 
As you see, there are two double FOR loops with 30*30=900 steps per 
loop.
It will be even slower if you extend the search area, if, for 
example, instead of
for(BuyFREQ=10;BuyFREQ<40;BuyFREQ++)
you try
for(BuyFREQ=10;BuyFREQ<80;BuyFREQ++)
to catch the higher harmonics.
As the time goes by some harmonics have better behavior. If, for 
example, the BFpass=25/SFpass=28 is the optimal choice after the 
first six months, the BFpass=25/SFpass=56 may appear as a better 
choice [56=2*28] or the BFpass=25/SFpass=84 [84=3*28]
 Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, sjaak haasnoot <sjaakhaasnoot@xxxx> 
wrote:
> Hello Dimitris,
> 
> I did everything, step by step, and it's working.
> However the chart comes very slowly and the computer is working 
slow with it.
> Is this normal?
> 
> Sjaak
> 
> 
> 
> 
> 
>   ----- Original Message ----- 
>   From: Dimitris Tsokakis 
>   To: amibroker@xxxxxxxxxxxxxxx 
>   Sent: Friday, February 27, 2004 10:44 AM
>   Subject: [amibroker] The ^AEX 2003timing
> 
> 
>   ^AEX example is an opportunity to describe this timing procedure 
for those who did not follow the related messages.
> 
>   STEP1. 
>   Find the first significant peak/trough of 2003
>   Although it is subjective, I will use an average zig(C,6) as a 
measure
>   Begin with
>    Plot(Zig(C,6),"",colorYellow,1);
>   Plot(C,"",colorBlack,64);
>   to see the first peak on Jan2, 2003 and the first trough on 
Feb10, 2003
>   STEP2.
>   By the end of May2003 run the
> 
>   // ^AEX 2003 timing Optimization
>   SYM="^AEX";
>   STARTBUY=DateNum()==1030210;
>   STARTSELL=DateNum()==1030102;
>   BuyFREQ=Optimize("bf",25,10,40,1);
>   SellFREQ=Optimize("sf",28,10,40,1);
>   Buy=BarsSince(STARTBuy)%Buyfreq ==0;
>   Sell=BarsSince(STARTSell)%Sellfreq==0;
>   Short=Sell;Cover=Buy;
>   Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);
>   Short=ExRem(Short,Cover);Cover=ExRem(Cover,Short);
> 
>   The top combination was bf=18, sf=28, ie buy every 18 bars/sell 
every 28 bars.
> 
>   STEP3. 
>   Since 18+28=46 and 46/2=23, we may define the period of 
Inspection Points as x=23 [or x=24, if you prefer even numbers].
>   It means we shall check the optimal bf/sf every 24 bars.
>   STEP4.
>    Insert these ^AEX numbers [the STARTBUY/STARTSELL/INSPECTION 
PERIOD]in the basic Ind. builder code
>   and...thats it !!
> 
>    // ^AEX 2003 timing
>   // The following 4 lines need to change for another index study
>   SYM="^AEX";
>   STARTBUY=DateNum()==1030210;// the datenum of the first 
significant trough
>   STARTSELL=DateNum()==1030102;// the datenum of the first 
significant peak
>   INSPECTIONPERIOD=24;// the average of the optimal bf+sf is a good 
point to start the period research
>   // The following lines are the same for any index study
>   x=INSPECTIONPERIOD;
>   startIP=DateNum()==1030530;in=DateNum()>=1030530;
>   EVENT=BarsSince(startIP)%x==0;
>   Plot(50,"",1,1);
>   // INSPECTION COUNTER
>   shape=33+2*(Cum(event)%10);
>   Color=colorIndigo;space=-40;
>   PlotShapes(shape*EVENT,color,0,Graph0,space);
>   event1=Cum(event)%10==0 AND Ref(Cum(event)%10,-1)!=0;
>   Counter1=Cum(event1);
>   shape1 = IIf(counter1==0,shapeNone,shapeDigit0 + 2 * ( Counter1%
10 )) ;
>   PlotShapes(event*shape1,color,0,Graph0,space+10);
>   Plot(0,"",1,1);
>   // OPTIMAL BF, SF SELECTION
>   G=0;
>   for(BuyFREQ=10;BuyFREQ<40;BuyFREQ++)
>   {
>   for(SellFREQ=10;SellFREQ<40;SellFREQ++)
>   {
>   Buy=BarsSince(STARTBuy)%Buyfreq ==0;
>   Sell=BarsSince(STARTSell)%Sellfreq==0;
>   Short=Sell;Cover=Buy;
>   Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);Short=ExRem
(Short,Cover);Cover=ExRem(Cover,Short);
>   e1=Equity(1,0);E11=ValueWhen(EVENT,E1);G=IIf(G>E11,G,E11);
>   }}
>   BFpass=0;SFpass=0;
>   for(BuyFREQ=10;BuyFREQ<40;BuyFREQ++)
>   {
>   for(SellFREQ=10;SellFREQ<40;SellFREQ++)
>   {
>   Buy=BarsSince(STARTBuy)%Buyfreq ==0;
>   Sell=BarsSince(STARTSell)%Sellfreq==0;
>   Short=Sell;Cover=Buy;
>   Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);Short=ExRem
(Short,Cover);Cover=ExRem(Cover,Short);
>   e1=Equity(1,0);
>   E11=ValueWhen(EVENT,E1);
>   BF1=IIf(E11==G,BuyFREQ,0);BFpass=BFpass+BF1;
>   SF1=IIf(E11==G,SellFREQ,0);SFpass=SFpass+SF1;
>   G=IIf(E11==G,0,G);
>   }}
>   Plot(BFPASS,"\nBFpass",colorBlack,8);Plot
(SFPASS,"SFpass",colorBlue,8);
>   // the trading system
>   Cb=in*BarsSince(STARTBuy)%BFpass ==0;
>   Cs=in*BarsSince(STARTSell)%SFpass==0;
>   Cb=ExRem(Cb,Cs);Cs=ExRem(Cs,Cb);
>   Buy=in*BarsSince(STARTBuy)%BFpass ==0;
>   Sell=in*BarsSince(STARTSell)%SFpass==0;
>   Short=Sell;Cover=Buy;
>   Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);Short=ExRem
(Short,Cover);Cover=ExRem(Cover,Short);
>   e1=Equity(1,0);Plot(e1,"Equity",colorBrightGreen,styleOwnScale);
>   PlotShapes(shapeUpTriangle*Cb,colorBrightGreen);
>   PlotShapes(shapeDownTriangle*Cs,colorRed);
>   PlotShapes(shapeUpArrow*Cb,colorDarkGreen);
>   PlotShapes(shapeDownArrow*Cs,colorDarkRed);
>   Plot( 2, "Ribbon",IIf( BarsSince(Buy)>BarsSince(Sell), colorRed, 
colorGreen), styleArea|styleNoLabel, -1, 100 );
>   GraphXSpace=5;
>   Title=sym+", BFpass="+WriteVal(BFpass,1.0)+", SFpass="+WriteVal
(SFpass,1.0)+", Equity="+WriteVal(e1);
> 
> 
>   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 
> 
> 
>         Yahoo! Groups Sponsor 
>               ADVERTISEMENT
>              
>        
>        
> 
> 
> --------------------------------------------------------------------
----------
>   Yahoo! Groups Links
> 
>     a.. To visit your group on the web, go to:
>     http://groups.yahoo.com/group/amibroker/
>       
>     b.. To unsubscribe from this group, send an email to:
>     amibroker-unsubscribe@xxxxxxxxxxxxxxx
>       
>     c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service. 
> 
> 
> --------------------------------------------------------------------
----------
>   Deze e-mail is door E-mail VirusScanner van Planet Internet 
gecontroleerd op virussen. Op http://www.planet.nl/evs staat een 
verwijzing naar de actuele lijst waar op wordt gecontroleerd.



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 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
     amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/