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

[amibroker] Re: Multiple Strategies in one backtest - help needed



PureBytes Links

Trading Reference Links


There was a long discussion on this back in July.  Search "Multiple Strategy System" in this yahoo group.  The solution entails:

1. Duplicating the instrument data for each strategy with different names (e.g. ZZZ_1, ZZZ_2, ZZZ_3 where ZZZ is the instrument ticker symbol).  I do this by renaming the historical source data ASCII files and re-importing each duplicated instrument.  If you are testing futures or Forex, make sure you manually update the contract specification information for each duplicate instrument.

2. Creating a watchlist for each strategy.  Put the duplicated instruments for each strategy in each individual strategy watchlist (e.g. for strategy 1 watchlist, put all instruments with the name ZZZ_1, for strategy 2 watchlist, put all instruments with the name ZZZ_2, etc.).

3. Creating a master watchlist with all duplicated instruments (e.g. ZZZ_1, ZZZ_2, and ZZZ_3).

4. In your system AFL, use the function InWatchListName() to determine which strategy code to execute:

  if (InWatchListName("Strategy_1") {
     Strategy 1 code...
  }
  else if (InWatchListName("Strategy_2"){
     Strategy 2 code...
  }

5. SetPositionSize to 1/3 of Equity:

  SetPositionSize( 33, spsPercentOFEquity );

6. In Automatic Analysis, use your master watchlist with all the instruments as a filter (Apply to: use filter->Define...)

The backtester will pass all the duplicated instruments in your master watchlist to your system AFL code which determines the strategy logic to apply.

All this is a little time consuming to setup and a major pain to maintain, but it enables portfolio testing across multiple strategies...

Regards,

David

--- In amibroker@xxxxxxxxxxxxxxx, "jens_lueckhof" <jens_lueckhof@xxx> wrote:
>
> Hi, I need some help in AFL.
> 
> Suppose I have 3 strategies set-up and want to backtest them together.
> On each entry 1/3 of the equity should be invested.
> 
> How do I do that in one backtest?
> 
> Many thanks
> J
>



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

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