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!
Portfolio Optimization: Position Sizing
Re: Portfolio Optimization: Position Sizing
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.
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.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Portfolio Optimization: Position Sizing
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.
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.