Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipelining / stacking strategies #34

Open
flipdazed opened this issue Oct 4, 2020 · 2 comments
Open

Pipelining / stacking strategies #34

flipdazed opened this issue Oct 4, 2020 · 2 comments

Comments

@flipdazed
Copy link
Contributor

Hey Saeed - been looking your finmarketpy library - looks nice!

What wasn't clear to me from looking at it was if you can stack strategies upon each other?

For example:

  • I have 4 building-block strats which solely roll commodity futures contracts.
  • I have 2 strategies, say Seasonality and Momentum taking roll strats as an underlying "asset".
  • Combine as a portfolio with some smart switching taking all 8 as inputs

Is that achievable ?

I couldn't see how it would be set up and return risk metrics at each constituent level.

@saeedamen
Copy link
Contributor

Thanks @flipdazed - one way to do this, would be to construct TradingModel classes for each of your building blocks. You'd then create a another portfolio based TradingModel strategy, and you'd fill the load_asset method to construct all the building blocks. The construct_signal method could be filled with all your weightings. You can then access all the return risk metrics for the whole portfolio, do all the sensitivity analysis (using TradeAnalysis) too.

At the moment there are automatic processes for doing things like vol targeting, but can imagine that people might want more complicated portfolio construction too.

However, I can add additional functionality to make this stacking of strategies a bit nicer/easier with TradingModel? One way I thought of doing this, would be simply to add your substrategies as parameters to the BacktestRequest and all the load_assets stuff would get filled automatically. You'd just need to write the scheme for construct_signals (and could default that to equal weighting). How does that sound?

@flipdazed
Copy link
Contributor Author

Ok I'll check how that works and get back to you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants