Strategies in Portfolio Trader

Questions about MultiCharts .NET and user contributed studies.
GTrader
Posts: 83
Joined: 30 Oct 2012
Has thanked: 24 times
Been thanked: 8 times

Strategies in Portfolio Trader

Postby GTrader » 29 Jan 2016

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.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Strategies in Portfolio Trader

Postby Henry MultiСharts » 17 Mar 2016

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?
Hello GTrader,

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).
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?
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.
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.
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.


Return to “MultiCharts .NET”