Hi Guys,
I'm trying to wrap my head around writing portfolio strategies in MultiCharts. I've stepped through the examples with the debugger and I'm getting closer. There are a couple of questions I have:
a) It seems as though Portfolio Strategies need to be coded differently than standard strategies in that the strategy logic is split between the base signals and the portfolio money management scripts. Could you suggest some best practices on how to ensure that the signals I write are usable in both single instrument backtests (or chart backtests) and portfolio trader?
b) I am still struggling with is the best way to implement Position Sizing approaches in Portfolio Trader and keep the strategy usable as a stand alone strategy. Since the position sizing sits in the Money Market Portfolio Script it needs knowledge of the underlying strategies to use the appropriate Position Sizing formula. I really would like that to reside in the strategy since I would like to use different sizing functions for different strategies. Any thoughts on this?
c) One of the questions I was hoping the Portfolio Trader would help me answer is which strategies work the best together. Imagine I have 20 viable strategies, I want to optimize which group of 5 strategies give the best result based on some custom fitness. What do you think is the best way to approach that?
Thanks for your help.
Strategies in Portfolio Trader
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Strategies in Portfolio Trader
Hello GTrader,Hi Guys,
I'm trying to wrap my head around writing portfolio strategies in MultiCharts. I've stepped through the examples with the debugger and I'm getting closer. There are a couple of questions I have:
a) It seems as though Portfolio Strategies need to be coded differently than standard strategies in that the strategy logic is split between the base signals and the portfolio money management scripts. Could you suggest some best practices on how to ensure that the signals I write are usable in both single instrument backtests (or chart backtests) and portfolio trader?
If you want to run the same code on a chart then you should not use the interfaces specific for the Portfolio (ex. IPortfolioPerformance, PortfolioHelpFunctions, IPortfolioData, etc.). Alternatively you may add a logic to have them activated only when the code is running in the PortfolioTrader (IApplicationInfo.ApplicationCode Property).
It depends on your Position sizing logic. Orders are generated by the individual signals only. Money management signal allows/denies orders and can do some emergency like closing position with a market order, or correct the amount of contracts generated by the individual strategy. If your individual strategy can handle the position sizing logic then you don't need to move it to the PMMS.b) I am still struggling with is the best way to implement Position Sizing approaches in Portfolio Trader and keep the strategy usable as a stand alone strategy. Since the position sizing sits in the Money Market Portfolio Script it needs knowledge of the underlying strategies to use the appropriate Position Sizing formula. I really would like that to reside in the strategy since I would like to use different sizing functions for different strategies. Any thoughts on this?
You need to test each set of strategies individually to check which one is the best. Unfortunately there is no way to have it found out automatically.c) One of the questions I was hoping the Portfolio Trader would help me answer is which strategies work the best together. Imagine I have 20 viable strategies, I want to optimize which group of 5 strategies give the best result based on some custom fitness. What do you think is the best way to approach that? Thanks for your help.