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

[amibroker] Re: Setting back testing dates within AFL formular



PureBytes Links

Trading Reference Links


Hello,
i got this below for the rollovers in futures contracts, so i don't
need to test each contract by hand.
maybe you can use it in a similar way for walk-forward-analysis.

symbol = Name();
trade_start  = IIf(symbol == "GB Z4-DT", 1040908, 
	       IIf(symbol == "GB U4-DT", 1040608,
	       IIf(symbol == "GB M4-DT", 1040308,
	       IIf(symbol == "GB H4-DT", 1031208,
	       IIf(symbol == "GB Z3-DT", 1030908,
	       IIf(symbol == "GB U3-DT", 1030608,
	       IIf(symbol == "GB M3-DT", 1030308,
	       IIf(symbol == "GB H3-DT", 1021208,
	       IIf(symbol == "GB Z2-DT", 1020908,
	       IIf(symbol == "GB U2-DT", 1020608,
	       IIf(symbol == "GB M2-DT", 1020308,
	       IIf(symbol == "GB H2-DT", 1011208,
	       IIf(symbol == "GB Z1-DT", 1010908,
	       IIf(symbol == "GB U1-DT", 1010608,
	       IIf(symbol == "GB M1-DT", 1010308,
	       IIf(symbol == "GB H1-DT", 1001208,
	       IIf(symbol == "GB Z0-DT", 1000908,
	       IIf(symbol == "GB U0-DT", 1000608,				       IIf(symbol == "GB
M0-DT", 1000308,
	       IIf(symbol == "GB H0-DT", 991208,
		IIf(symbol == "GB Z99-DT", 990908,
		IIf(symbol == "GB U99-DT", 990608,
		IIf(symbol == "GB M99-DT", 990308,
		IIf(symbol == "GB H99-DT", 981208,
		IIf(symbol == "GB Z98-DT", 980908,
		IIf(symbol == "GB U98-DT", 980608,
		IIf(symbol == "GB M98-DT", 980308,
		IIf(symbol == "GB H98-DT", 971208,
		IIf(symbol == "GB Z97-DT", 970908,
		IIf(symbol == "GB U97-DT", 9710608,
		IIf(symbol == "GB M97-DT", 970308,
		IIf(symbol == "GB H97-DT",961208,0)))))))))))
)))))))))))))))))))));

trade_end   = IIf(symbol == "GB Z4-DT", 1041207,
		IIf(symbol == "GB U4-DT", 1040907,
		IIf(symbol == "GB M4-DT", 1040607,
		IIf(symbol == "GB H4-DT", 1040307,
		IIf(symbol == "GB Z3-DT", 1031207,
		IIf(symbol == "GB U3-DT", 1030907,
		IIf(symbol == "GB M3-DT", 1030607,
		IIf(symbol == "GB H3-DT", 1030307,
		IIf(symbol == "GB Z2-DT", 1021207,
		IIf(symbol == "GB U2-DT", 1020907,
		IIf(symbol == "GB M2-DT", 1020607,
		IIf(symbol == "GB H2-DT", 1020307,
		IIf(symbol == "GB Z1-DT", 1011207,
		IIf(symbol == "GB U1-DT", 1010907,
		IIf(symbol == "GB M1-DT", 1010607,
		IIf(symbol == "GB H1-DT", 1010307,
		IIf(symbol == "GB Z0-DT", 1001207,
		IIf(symbol == "GB U0-DT", 1000907,
		IIf(symbol == "GB M0-DT", 1000607,
		IIf(symbol == "GB H0-DT", 1000307,
		IIf(symbol == "GB Z99-DT", 991207,
		IIf(symbol == "GB U99-DT", 990907,
		IIf(symbol == "GB M99-DT", 990607,
		IIf(symbol == "GB H99-DT", 990307,
		IIf(symbol == "GB Z98-DT", 981207,
		IIf(symbol == "GB U98-DT", 980907,
		IIf(symbol == "GB M98-DT", 980607,
		IIf(symbol == "GB H98-DT", 980307,
		IIf(symbol == "GB Z97-DT", 971207,
		IIf(symbol == "GB U97-DT", 970907,
		IIf(symbol == "GB M97-DT", 970607,
		IIf(symbol == "GB H97-DT", 970307,0))))))))))
))))))))))))))))))))));

Buy = (trade_start <= DateNum() AND DateNum() <= trade_end) 
      AND Buycondition;

etc.



Regards
Robert


--- In amibroker@xxxxxxxxxxxxxxx, "see_change007" <cvt@xxxx> wrote:
> 
> 
> 
> Thanks for that Dimitris
> 
> 
> See Change 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS"
<TSOKAKIS@xxxx> 
> wrote:
> > 
> > You may creat various timing conditions.
> > Example:
> > d2003a=Year()==2003 AND Month()<=6;
> > d2003b=Year()==2003 AND Month()>6;
> > The first, d2003a will be equal to 1 for the first 6 months of
2003 
> > and equal to 0 for any other period.
> > Then, after you setup your general
> > Buy=...;
> > Sell=...;
> > you may write
> > Buy=d2003a*Buy;
> > Sell=d2003a*Sell;
> > and select the signals for the first 6 months of 2003.
> > Dimitris
> > --- In amibroker@xxxxxxxxxxxxxxx, "Anthony Faragasso" 
> <ajf1111@xxxx> 
> > wrote:
> > > See change,
> > > 
> > > I believe Dimitri presented such an example , maybe a year or
two 
> > ago.....You can check the archives or ask Dimitri if he can post 
> the 
> > formula....I do not remember exactly when it was....
> > > 
> > > Anthony
> > >   ----- Original Message ----- 
> > >   From: see_change007 
> > >   To: amibroker@xxxxxxxxxxxxxxx 
> > >   Sent: Wednesday, November 10, 2004 3:46 AM
> > >   Subject: [amibroker] Re: Setting back testing dates within
AFL 
> > formular
> > > 
> > > 
> > > 
> > >   Anthony 
> > > 
> > >   I'm not an expert with AFL  ( graham can testify to that )
but 
> > from 
> > >   what I can see , the function you've shown will return the 
> dates 
> > >   that are set in the date range of the AA function.
> > > 
> > >   That's not what I want to do.
> > > 
> > >   I want to be able to set the time frame of the testing period 
> as 
> > >   part of the AFL code of my system.
> > > 
> > >   The reason I want to do this is to set up a rolling time of
say 
> > two 
> > >   years , and then advance this on a monthly ( or what ever ) 
> > >   timeframe to see how robust my system is. I want to do this
as 
> an 
> > >   alternative to optimising in one time period and then 
> confirming 
> > >   this in another timeframe . I figure if a system is
consistent 
> in 
> > >   this fashion , it's more likely to be robust in real trading.
> > > 
> > >   See Change 
> > > 
> > > 
> > >   --- In amibroker@xxxxxxxxxxxxxxx, kaveman perth 
> > <kavemanperth@xxxx> 
> > >   wrote:
> > >   > I have never been able to work out what the above
selections 
> c, 
> > d, 
> > >   e,
> > >   > g, i . How exactly are they used?
> > >   > 
> > >   > 
> > >   > On Tue, 9 Nov 2004 23:55:54 -0500, Anthony Faragasso 
> > >   <ajf1111@xxxx> wrote:
> > >   > > 
> > >   > >      STATUS
> > >   > >      - get run-time AFL status information Miscellaneous 
> > >   functions
> > >   > >      (AFL 1.65)
> > >   > > 
> > >   > >      SYNTAX  status( ''statuscode'' )
> > >   > >      RETURNS ARRAY
> > >   > >      FUNCTION  Returns run-time status of the analysis 
> > engine. 
> > >   Supported status codes:
> > >   > >        a.. "stocknum" - gives you the ordinal number of 
> > >   currently analysed symbol
> > >   > >        b.. "action" - gives information in what context 
> given 
> > >   formula is run: 1 - INDICATOR, 2 - COMMENTARY, 3 - SCAN, 4 - 
> > >   EXPLORATION, 5 - BACKTEST / OPTIMIZE
> > >   > >        c.. "rangefromdate", "rangetodate" - return
current 
> > auto-
> > >   analysis From-To range as DateNums
> > >   > >        d.. "rangefromtime", "rangetotime" - return
current 
> > auto-
> > >   analysis From-To range as DateNums
> > >   > >        e.. "barinrange" - returns 1 when current bar is 
> > within 
> > >   current auto-analysis From-To range
> > >   > >        f.. "barvisible" - (custom indicators only)
returns 
> 1 
> > >   when current bar is visible in current view
> > >   > >        g.. "firstbarinrange" and "lastbarinrange". They 
> > return 1 
> > >   (or True) on the first/last bar of analysis range.
> > >   > >        
> > h.. "buydelay", "selldelay", "shortdelay", "coverdelay" - 
> > >   return delays set in the Settings window
> > >   > >        i.. "firstbarintest" and "lastbarintest" - similar 
> > >   to "firstbarinrange" and "lastbarinrange" but they return the 
> > >   settings of last BACKTEST/OPTIMIZATION and intermediate 
> > >   scans/explorations do not affect them
> > >   > > 
> > >   > >      EXAMPLE status( "stocknum" );
> > >   > > 
> > >   > >  ----- Original Message -----
> > >   > >  From: see_change007
> > >   > >  To: amibroker@xxxxxxxxxxxxxxx
> > >   > >  Sent: Tuesday, November 09, 2004 9:11 PM
> > >   > >  Subject: [amibroker] Setting back testing dates within
AFL 
> > >   formular
> > >   > > 
> > >   > >  I'm doing some back testing , but I want to set the time 
> > frame 
> > >   within
> > >   > >  the Formular.
> > >   > > 
> > >   > >  Is it possible to do this ?
> > >   > > 
> > >   > >  See Change
> > >   > > 
> > >   > >  Check AmiBroker web page at:
> > >   > >  http://www.amibroker.com/
> > >   > > 
> > >   > >  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.
> > >   > > 
> > >   > > [Non-text portions of this message have been removed]
> > >   > > 
> > >   > > 
> > >   > > Check AmiBroker web page at:
> > >   > > http://www.amibroker.com/
> > >   > > 
> > >   > > Check group FAQ at: 
> > >   http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > >   > > Yahoo! Groups Links
> > >   > > 
> > >   > > 
> > >   > > 
> > >   > > 
> > >   > > 
> > >   > 
> > >   > 
> > >   > -- 
> > >   > Cheers
> > >   > Graham
> > >   > http://e-wire.net.au/~eb_kavan/
> > > 
> > > 
> > > 
> > > 
> > > 
> > >   Check AmiBroker web page at:
> > >   http://www.amibroker.com/
> > > 
> > >   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. 
> > > 
> > > 
> > > 
> > > [Non-text portions of this message have been removed]





------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

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/