How to use the portfolio drawdown to modify the position size
Author: AchimLamatsch
Creation Date: 11/2/2020 6:06 PM
profile picture

AchimLamatsch

#1
I tried to implement a position sizing based on the actual drawdown of the entire dataset and the drawdown of the dataset of the previous days to calculate the SMA of the drawdown.

Is there any possibility to get access to these data in order to modify the percentage of equity of an individual buy at market order as LastPosition.tag in the strategy code?

Or is the only way to handle that to build an individual PosSizer?
profile picture

Eugene

#2
QUOTE:
Or is the only way to handle that to build an individual PosSizer?

The way WL6 is programmed, scripts don't have access to the portfolio equity and other metrics. First the Strategy is executed on each symbol bar by bar, then the results are compiled into a Portfolio backtest. So the proper way to handle it is to build a PosSizer.

An alternative solution might be to obtain the portfolio equity via "shadow trading" and calculate the drawdown:

Interacting Dynamically with Portfolio Level Equity
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).