How to get day-by-day exposure data (both long and short)?
Author: wbzhang
Creation Date: 1/30/2012 2:53 PM
profile picture

wbzhang

#1
Hi I am running some backtesting strategies, and we are interested to get the daily exposure numbers (both long and short exposures). Then I need to computer both long and short positions everyday, aggregate them, and then I can know daily long/short/net exposures. I am running portfolio backtesting mode (single symbol simulation), and thus the position.Shares number is always 1. I cannot get real shares number, so cannot compute the exposure numbers.

I also looked at the equity curve, there is a green line for "long", and a red line for "short", however this is not our portfolio. Is there anyway I can get daily (long/short/total/net) exposures? thanks.
profile picture

Eugene

#2
WealthScript Programming Guide > Programming Trading Strategies > Strategy Code Limitations:
QUOTE:
Strategies based on Portfolio Equity, Cash, or Drawdown

Due to the Wealth-Lab Developer Version 6 architecture, it is not possible to create trading strategies that enter or exit trades as a function of Portfolio Equity, which includes Portfolio Cash and Drawdown. Refer to the QuickRef when selecting WealthScript functions or object properties for information regarding their use in Strategy code.

This also applies to exposure whose calculation depends on Strategy Equity.

Here's an unsupported workaround:

WealthScript Techniques | Interacting Dynamically with Portfolio Level Equity

Having obtained the equity DataSeries this way you need to calculate exposure on a bar-by-bar basis.
profile picture

Christos

#3
Just to add my 2 cents (since I have faced the same problem) I think that the best way to do it is by writing some code by using the trades' tab data to rebuild exsposures after the strategy has been backtested(apparently on a differnt platform other than WL).

Check the link below as it may help you with some of the tools that WL already provides

/Forum/Posts/Position-Export-32001
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).