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

[amibroker] Re: Multiple Strategy System



PureBytes Links

Trading Reference Links

Soham,

I faced the same issue except I have 12 models that use a portfolio of 27 futures instruments.  The issues involved with running multiple systems simultaneously are much more difficult than dividing the system logic by symbols or watchlists.  For example because you are considering trending and counter-trending systems, there is the possibility of being long and short in the same instrument in two separate models each with a different trade size.  I tried combining my models in AmiBroker, but my custom stop handling and dynamic position sizing just became a nightmare to manage.  After reading through most of the multiple systems threads on this forum, I started thinking about alternative solutions.

I decided to run my models separately in AmiBroker and then export the trades to a database.  From there I would write a simplistic back-tester that would step through the combined trades, recalculating the trade quantities using a shared equity pool.  At this point I did some googling to see if there was any Excel, or C# libraries, or any other software that would give me a simplistic back-tester framework.  I thought about feeding the trades back into AmiBroker as signals, but that would amount to a lot of AFL code to handle the models by scaling in and out positions with the possibility of managing long and short positions simultaneously.  Also I want to vary the number and mix of models I test in the future, so the AFL programming would have to be generic which makes the task even more daunting.

Anyways through my googling, I found a software product called Market System Analyzer by Adaptrade (www.adaptrade.com) that already had implemented the approach I was pursuing.  The primary purpose of the MSA software is to explore position sizing models (all of which I think can be written in AmiBroker).  I'm able to import my AmiBroker trades into the MSA software.  MSA can treat my 12 models as a single portfolio and generate a combined equity curve and other back-tester statistics from a shared equity pool.  It recalculates trade sizes (i.e. shares) based on the position sizing model selected.  The caveat is that MSA uses trade information for all it's statistics and has no knowledge of the chart data used to create those trades.  So statistics like Max System Drawdown are different than the much more accurate AmiBroker MDD because AmiBroker can look at each chart bar and determine the actual intra-trade MDD while MSA only knows the entry and exit prices of each trade.  

MSA has been a decent solution for me to fill a void that I wasn't able to complete with AmiBroker.  Instead of spending days or weeks writing my own multiple system handling logic, within a few hours I had all my 35,000 trades loaded into MSA and was creating the combined system statistics I was after all without any programming (other than a database query to export the AmiBroker trades by symbol into an MSA import format).

I'm weary to bring up another software product on the AmiBroker user forum especially since AB can do about 90% of what MSA does, but in this case I have not found anything posted that has given me a doable solution to combining multiple back-testing trading systems.

Best of luck with your system development.

Regards,

David

--- In amibroker@xxxxxxxxxxxxxxx, "Mike" <sfclimbers@xxx> wrote:
>
> You could probably use the same technique as is used for pairs trading. Specifically, check for the name of the symbol and apply the applicable logic.
> 
> http://finance.groups.yahoo.com/group/amibroker/message/134492
> 
> If you don't want to have a bunch of if (Name() == ...)statements, you could probably add some symbols to watchlist1, the others to watchlist2, all of the above to watchlist3. Then use InWatchList() in your code instead of checking the name. You would run your backtst/optimization/etc. on watchlist3. The danger of that though is if you add a symbol to watchlist3 but forget to also add it to either watchlist1 or watchlist2.
> 
> if (InWatchList(1)) {
>   ... // Strategy 1
> } else if (InWatchList(2)) {
>   ... // Strategy 2
> }
> 
> Any custom money management would probably have to be implemented in custom backtester code.
> 
> Mike
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Soham" <sohamdas@> wrote:
> >
> > Any help on this?
> > --- In amibroker@xxxxxxxxxxxxxxx, "Soham" <sohamdas@> wrote:
> > >
> > > Hello Everyone,
> > > 
> > > I believe, I have seen this question here itself or one of its forms. But given the "fantastic" search results of Yahoo groups, I am posting this once again.
> > > 
> > > Is there any method, to simulate multiple strategy on a portfolio level?For example, consider I want to use a trend following system for Cotton, Coffee, Copper, EuroDollars and FAZ. While, I want to "simultaneously" simulate a trend fading system for SPX,NDX and RYDER.
> > > 
> > > Is there any way to do it?
> > > 
> > > And very related to this stuff, the one possible way, I can think of is, using multithreaded programming. Is it possible? Interfacing say C# with Ami and handling the two strategies with their own money mgmt algos, and instruments etc?
> > > 
> > > It is to be reminded that, they draw their "juice"[$$$] from the same account.
> > > 
> > > Thanks, for any light on this
> > > Soham
> > >
> >
>



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

**** 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:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto: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/