Portfolio Optimization: Position Sizing

Questions about MultiCharts .NET and user contributed studies.
clonardo
Posts: 16
Joined: 27 Sep 2013
Has thanked: 1 time
Been thanked: 1 time

Portfolio Optimization: Position Sizing

Postby clonardo » 21 Jan 2014

Hi All,

First, I'd like to say that now that I've been using MultiCharts.NET for a few months, it's really an impressive effort. I hope that the documentation continues to improve- definitely building up a good knowledge base here in addition to the programming guide.

I have a question on position sizing. Let's say that I wanted to use a simple algorithm for position sizing in a portfolio backtest (e.g., size positions according to output of a PL.NET function). Is there any way to do this without Global Variables, or if not, does anyone have relevant sample code using Global Variables?

Basically, the following pieces of data would need to be visible to the sizing/optimization function at each bar:
-Positions + quantities held
-Portfolio market value
-Cash remaining

Sample code to work from would be greatly appreciated. Thanks in advance!

clonardo
Posts: 16
Joined: 27 Sep 2013
Has thanked: 1 time
Been thanked: 1 time

Re: Portfolio Optimization: Position Sizing

Postby clonardo » 21 Jan 2014

Forgot to mention that I would like to be able to use the same code in real-time trading as well as backtesting, if possible. Thanks.

SysInv
Posts: 28
Joined: 25 Nov 2012
Has thanked: 1 time
Been thanked: 1 time

Re: Portfolio Optimization: Position Sizing

Postby SysInv » 23 Jan 2014

It's my understanding that MC does not offer this. They say Portfolio trading will be available in version 9, which I assume will allow us to code portfolio specific rules before each symbol is executed, but I'm not sure yet.

I've solved similar issues by creating a "portfolio class" with static variables that can be accessed from each strategy. This works in both the backtester and realtime. Just make sure each pair has updated the portfolio class with the most recent data before you run your optimization.

It's not the best solution, and I'm hoping we will see something similar to what SmartQuant and RightEdge use. MC is still a symbol-by-symbol trading software and needs to take the step to portfolio trading.

clonardo
Posts: 16
Joined: 27 Sep 2013
Has thanked: 1 time
Been thanked: 1 time

Re: Portfolio Optimization: Position Sizing

Postby clonardo » 23 Jan 2014

I've got something in mind that I'm going to try to implement.. will share with the community if it looks promising

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

Re: Portfolio Optimization: Position Sizing

Postby Henry MultiСharts » 24 Jan 2014

Hello clonardo,

Currently available portfolio backtesting properties are listed in PowerLanguage.NET Help under IPortfolioPerformance Members section. More portfolio backtesting/portfolio realtime trading functionality/properties are coming in MultiCharts 9.0 later this year.


Return to “MultiCharts .NET”