Exposure for Futures Trades
Author: dansmo
Creation Date: 1/7/2011 3:05 AM
profile picture

dansmo

#1
Hello,

how is Exposure calculated for Futures trades?
Why is Exposure always shown as an absolute value for short trades? Whats the reason behind this?

dansmo
profile picture

Eugene

#2
Hello,

1. Exactly like for stock trades without modification. Exposure is a metric that takes portfolio equity into account, measuring "the area of portfolio equity that was exposed to the market" (User Guide > Preferences > Performance Visualizers > Performance).

2. Exposure is not always shown as an absolute value and is shown as a percentage for short trades as well as for long trades.
profile picture

dansmo

#3
Hi Eugene,

QUOTE:
1. Exactly like for stock trades without modification.

From my perspective that is a problem and there should at least be a option to calculate exposure as:
Futures Size * PointValue * Price
whereas in equities it is:
Size * Price
Do you understand the difference?

QUOTE:
2. Exposure is not always shown as an absolute value and is shown as a percentage for short trades as well as for long trades.

I meant absolute like in Math.Abs().
I have a short only system and exposure is shown as, i.e. 25% instead of -25%.
profile picture

dansmo

#4
Since this is a really urgent issue for me:
how do I think I could achieve fastest results? Building my own visualizer?
Do I understand correctly, that in a visualizer I have access to:
- position size (after PosSizers)
- Bar series of given symbols, so I can calculate Size * PointValue * Close[bar]
?
profile picture

Eugene

#5
1 - There probably is some misconception. Since Market Exposure is a portfolio equity performance metric, it does not take prices and/or point values into consideration regardless of security type. They simply do not matter for it.

Adding new performance metrics to the standard visualizer tabs is pretty unlikely. Nonetheless, everything is set up to let you calculate custom performance metrics on the Performance+ tab. Grab the MS123 Visualizers source code from the project's home page, read on the basics of creating your own Performance Visualizers, code your metric in the PerformanceEngine.cs class and utilize it on the Performance+ tab.

If you have a thorough description that makes sense, complete formula and/or code, I may take a look at adding it to the Performance+ visualizer.

2 - You're still exposing some equity to the market regardless of trade type, ain't you? That's why it should be a positive figure I believe.

p.s. Negative exposure could be produced by WL5 under certain cirumstances (2008?) but I believe it was reported and should be subsequently fixed.
profile picture

Eugene

#6
QUOTE:
Do I understand correctly, that in a visualizer I have access to:
- position size (after PosSizers)
- Bar series of given symbols, so I can calculate Size * PointValue * Close[bar]

Your understanding is correct. Refer to the "Performance Visualizers" link in my previous reply for the official guide on building visualizers. The complete source code of the MS123 Visualizers will also be a considerable help.
profile picture

dansmo

#7
QUOTE:
1 - There probably is some misconception. Since Market Exposure is a portfolio equity performance metric, it does not take prices and/or point values into consideration regardless of security type. They simply do not matter for it.


On a certain day portfolio equity is 100.000 and there are four scenarios:
1) you are long 100 MSFT @ price 28.50.
2) you are short 100 MSFT @ price 28.50.
3) you are long 1 Dax Future @ 6950, point value is 25.
4) you are long 100 MSFT @ 28.50 and short 100 ORCL @ 28.50.

What is the portfolio exposure in each of those four scenarios and how do you differentiate between 1) and 2)?

I need a visualizer that will list the exposure for a given period (like the "By Period" Visualizer) and list for every period:
- starting date
- long exposure
- short exposure
- net exposure.

Where I calculate these exposures as:
1) date | +2,85% | 0% | +2,85%
2) date | 0% | -2,85% | 0%
3) date | +173,75% | 0 | +173,75%
4) date | +2,85% | -2,85% | 0

Do you understand what (and why) I am looking for?



profile picture

dansmo

#8
Okay, I started creating my own visualizer for this.
I thought the best way would be to run through all the bars:
CODE:
Please log in to see this code.

and then figure out at each bar which position(s) were open.
How would the easiest solution be? Is there a function that returns false/true to Positions if they were open at give bars?
profile picture

Eugene

#9
QUOTE:
Do you understand what (and why) I am looking for?

Yes I do. The (partial) formula in your reply @ 1/7/2011 4:09 AM (Futures Size * PointValue * Price) reminds me of the way the Portfolio Inspector is calculating exposure %.
QUOTE:
How would the easiest solution be?

The Portfolio Inspector.
profile picture

dansmo

#10
Somehow I cannot find the source of the Portfolio Inspector. I only can find PVPortfolioInspector.resx.

However, the PI only shows positions that were open at the end of the day. I also would like to take positions into account that were closed the same trading day.
profile picture

Eugene

#11
Oops, the Portfolio Inspector is closed source.
profile picture

dansmo

#12
Are you able to provide the piece of code for exposure?
profile picture

Eugene

#13
Exposure for today. Hope that helps:
CODE:
Please log in to see this code.
profile picture

dansmo

#14
I finished it in a very simple form. Thank you for your help. Any interest in adding it to Community.Visualizers?
However, for publication it probably should include some more features.
profile picture

dansmo

#15
Can you please investigate the following:

using this in a Visualizer in a test that was run on 5 min data results as "false".
CODE:
Please log in to see this code.

where sr is
CODE:
Please log in to see this code.
profile picture

Eugene

#16
Yep, can confirm the bug using any intraday data I can reach out e.g. IQFeed, Google, Database. Thanks. CashCurve is affected as well. Note: the SystemPerformance.IsIntraday property isn't affected so you may use that. Please consider creating a support ticket for tracking. tia.
profile picture

dansmo

#17
Yep, thanks for confirming. I am already using your suggestion. It is working fine.
profile picture

Eugene

#18
Update:

Just found out that PosSizers are affected just the same as Visualizers. The IsIntraday and DataScale properties of DrawDownCurve, DrawDownPctCurve, and EquityCurve return incorrect values ("false" / "Daily") using intraday data.
profile picture

dansmo

#19
I have just entered a support ticket for tracking the bug.
profile picture

Eugene

#20
Thanks.
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).