Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Combine two strategies

I have two strategies, A and B. I want to (automatically) make a new strategy C that does both A trades and B trades.

To make things concrete, say that on day 7, at the opening, A buys 100 apple shares; B buys 50 apple shares and 100 google shares. I want to automatically generate a strategy C that buys 150 apple shares and 100 google shares, so I can backtest it.

Is this possible out of the box, or do I have to write an (error prone) script to parse A and B and try to output C?

4 responses

I see A+B = C...but what's really going on in-between? Are you selling anything? What are you monitoring? I'd be happy to help if you come up with a more concrete relationship.

I'm not sure I explained myself well. The reason I want to do this is simply to see how combining multiple unrelated strategies would perform. I'm not thinking about any strategies in particular, I am just now experimenting with my first one; I'm a newbie at this.

I use a context variable/dictionary to keep track of the buy/ sell signals from each strategy and then add them together to place the order.