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

[amibroker] Re: Backtesting with difference tickers everyday


  • Date: Thu, 25 Feb 2010 16:08:52 -0000
  • From: "ramoncummins" <ramoncummins@xxxxxxxxxxx>
  • Subject: [amibroker] Re: Backtesting with difference tickers everyday

PureBytes Links

Trading Reference Links

Hi Bill,

The way I approach this problem is to have a watchlist with ALL relevant tickers in it (in your case, it would be 6)and then have a dateCheck function in my Buy Signal that specifies the allowed dates for each ticker. Note that the dates need to be entered in Amibroker Date format ). I am writing this post without amibroker in front of me, so no doubt the code has some minor mistakes, but I'm sure you can fix them. I can post verified code later if needed.

function datecheck (myTicker) {
datecheck = false;
switch (myTicker) {
case "AAA": iff(datenum()> startDate and datenum()<enddate,true,false); break;
Case "BBB": etc . . . .
}
}

Buy = EntryConditions and datecheck(name());

Make sure you select the watchlist with all the tickers in it when you run AA.

Hope this helps

Ramon



--- In amibroker@xxxxxxxxxxxxxxx, "longt3rm" <longt3rm@xxx> wrote:
>
> Hello,
> 
> I have a backtest model I would like to develop where the basket of stocks used will change on a daily basis.
> 
> For example:
> On October 5 2009, the backtest would use tickers:
> AAA
> BBB
> CCC
> 
> On October 6 2009, the backtest would use tickers:
> DDD
> EEE
> FFF
> 
> I am looking for ideas on how to approach this. The two ways I've pondered are:
> 1) Create separate CSV files using the naming convention:
> ticker20091005.csv
> ticker20091006.csv
> 
> Then use FGets to parse the file to build that days tickers.
> 
> 2) Store the tickers / dates in a Microsoft SQL database and call a stored procedure via ODBC.
> 
> Would anyone have thoughts / ideas on which approach would be:
> 1) Faster for backtest
> 2) Easier to maintain
> 
> Any sample code would be fantastic.
> 
> Thank you,
> 
> 
> Bill
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

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

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/