Portfolio Mgmt - Optimizing for Priority and setting capital limits

Questions about MultiCharts and user contributed studies.
trader0311
Posts: 47
Joined: 28 Sep 2014
Has thanked: 7 times

Portfolio Mgmt - Optimizing for Priority and setting capital limits

Postby trader0311 » 05 Oct 2017

Good morning,

I have a portfolio of ETF's each having strategies applied to them. I would like to do some optimization at the portfolio level. Specifically:

1) In order to maximize the use of my capital, I would like to optimize for the entry priority of each strategy. For example, capital will be allocated sequentially, given a specific priority number that I can optimize for, until all capital is used up or all trading signals are entered. Is there a way that I can assign a line of code to each strategy in the Portfolio Trader that I can then optimize at the portfolio level, to give me the optimal entry priority of the strategies?

2) How do I avoid trading more than my account is worth? In the past, I have noticed that despite the money management settings in the Portfolio Trader (Initial Portfolio Capital), the portfolio trader will exceed capital in the account. For example, if I want to allocate $10,000 to 15 different strategies and only want to have maximum capital exposure to the market of $100,000, how is this accomplished? I have noticed that if all 15 strategies generate a trading signal, that all 15 strategies WILL trade resulting in $150,000 worth of exposure to the market, which exceeds my limit of $100,000 by $50,000.

So how does one limit the amount of capital deployed at any given time, subject to the entry priority mentioned earlier. In a nutshell the optimization would seek the ideal entry priority while maximizing capital deployment, but subject to some maximum capital allocation to avoid having orders placed on margin.

Any help from the MultiCharts gurus would be greatly appreciated. I was going to try to do this in excel, but would much rather attempt this in Portfolio trader first.

User avatar
Anna MultiCharts
Posts: 74
Joined: 14 Jul 2017
Has thanked: 2 times
Been thanked: 14 times

Re: Portfolio Mgmt - Optimizing for Priority and setting capital limits

Postby Anna MultiCharts » 06 Oct 2017

Hello, trader0311!

Let me address your questions in order:

1) You can try using the PortfolioEntriesPriority keyword in your strategies: https://www.multicharts.com/trading-sof ... esPriority

2) Portfolio cannot execute trades that exceed the specified capital. What you described can be caused by several reasons:
- Money Management settings are configured incorrectly;
- the symbols in Portfolio have incorrect settings;
- margin settings are not correct.
Please, verify the above mentioned settings.

trader0311
Posts: 47
Joined: 28 Sep 2014
Has thanked: 7 times

Re: Portfolio Mgmt - Optimizing for Priority and setting capital limits

Postby trader0311 » 06 Oct 2017

Thank you -

Yes, from my understanding, as I have posted about this before, the portfolio trader will exceed the amount of capital in your portfolio. To illustrate, Set the "Initial Portfolio Capital" to $100,000 and then set the Exposure and Max % capital per position to 100% each (these are the default perimeters. If you input SPY as the symbol and the apply the strategies Volatility Expansion LE and SE to the chart and set the strategy to allocate $100,000 to each trade, set bars back to 500 and then backtest you get about $12,000 in profits. Now clone that strategy such that you know have 2 volatility strategies each allocated $100,000. If you run the backtest you get exactly double that on one strategy - $24,000. So the strategy paid no attention to the money management settings mentioned above and you were trading twice what your account was worth.

I am not sure if this is a bug, but if it is, it is potentially a big one, especially if people think that the portfolio trader deploys cash based on the priority until all cash is used up. It could cause trades that far exceed your account value and will distort the actual backtested returns because the portfolio is trading on margin, and the user believes that it is not...

User avatar
Anna MultiCharts
Posts: 74
Joined: 14 Jul 2017
Has thanked: 2 times
Been thanked: 14 times

Re: Portfolio Mgmt - Optimizing for Priority and setting capital limits

Postby Anna MultiCharts » 10 Oct 2017

trader0311,

please, find the example of protfolio settings in the attached pws provided by our engineers.
Attachments
ThreeStrategies.pws
(129.38 KiB) Downloaded 23 times

trader0311
Posts: 47
Joined: 28 Sep 2014
Has thanked: 7 times

Re: Portfolio Mgmt - Optimizing for Priority and setting capital limits

Postby trader0311 » 11 Oct 2017

Hi,

Thank you for your response. However, I am still not convinced that the Portfolio Trader is monitoring your exposure and am not convinced that the "Money Management" settings are functioning as intended.

For example, I have a portfolio trading 7 strategies on different symbols. I have allocated $50,000 to each strategy so conceivably my total capital that can be traded is $350,000 if all the strategies are holding positions. I set my initial portfolio capital to 200,000.

Here are the outcomes of:

- Setting "max % of capital per position" to 100% generates $658,000 in profits for the portfolio
- Setting "max % of capital per position" to 25% generates $658,000 in profits for the portfolio
- Setting "Exposure (% of portfolio capital)" to 10% generates $658,000 in profits for the portfolio
- Setting "Exposure (% of portfolio capital)" to 25% generates $658,000 in profits for the portfolio

So given that me adjusting those money management settings has absolutely no effect on the strategy portfolio profits, tells me that somehow, they are not working as intended. Simply setting the Exposure to 10% should produce 90% less profits. Perhaps I am missing something here, but I have notice this problem before. My take is that 1) Portfolio Trader will trade more money than you allow it to and 2) the money management settings do not seem to work.

I am setting the capital to trade for each strategy within the strategy code. I am not setting the capital to trade within the strategy properties. I am not sure if that has anything to do with it.... I don't think it should?

trader0311
Posts: 47
Joined: 28 Sep 2014
Has thanked: 7 times

Re: Portfolio Mgmt - Optimizing for Priority and setting capital limits

Postby trader0311 » 11 Oct 2017

So I think I figured this out. When I specify the amount of dollars to be traded within the strategy code, the money management settings do not seem to apply and the exposure as well as margin get busted (ie you can make trades that exceed your account value).

When you specify the amount of dollars to be traded within the strategy properties "ie dollars per trade" then the money management settings seem to apply and margin is in tact.

Since I vary the amount of shares that I trade by scaling into a position, I need to regulate the shares per trade within the code and therefore cannot use the strategy properties to regulate the dollar value per trade. So I think this is a bug that needs addressed. Should I submit a bug report?

TraderWalrus
Posts: 48
Joined: 13 Sep 2016
Has thanked: 26 times
Been thanked: 5 times

Re: Portfolio Mgmt - Optimizing for Priority and setting capital limits

Postby TraderWalrus » 12 Oct 2017

There are many places where size can be set and it can be confusing.

- The size in "Strategy Properties" is just a *default* quantity and will be ignored if size is specified elsewhere.
- The settings in "Portfolio Settings" are restrictions.
- I never set size from trading signal code so I can't comment on that.
- The next place where size can be set is the Money Management Signal. I think it's best to set the size from there. The restrictions in the Portfolio Settings are adhered to in this case, at least in my experience.

User avatar
Anna MultiCharts
Posts: 74
Joined: 14 Jul 2017
Has thanked: 2 times
Been thanked: 14 times

Re: Portfolio Mgmt - Optimizing for Priority and setting capital limits

Postby Anna MultiCharts » 18 Oct 2017

Hello, Trader 0311!

trader0311 wrote:Since I vary the amount of shares that I trade by scaling into a position, I need to regulate the shares per trade within the code and therefore cannot use the strategy properties to regulate the dollar value per trade. So I think this is a bug that needs addressed. Should I submit a bug report?

Could you please provide more details about this?
Basically it doesn't matter whether you specify the amount of contracts in the code of your strategy or from Strategy Properties, Portfolio should not buy more thaт the capital allows.


Return to “MultiCharts”