I tried using the code provided in the QuantConnect livestream video on "Tail Risk Hedging". After running the backtest and downloading the trade log, I'm seeing that the value of the option hedges traded are off by a factor of 100. Why is this?
For example, with a 1% allocation to SPY put hedges (with remaining 99% in SPY) and a $1mm portfolio, the value of each put is only $100 when it should be $10,000. I can't figure out why. Am I reading the trade log incorrectly, or perhaps there's an error in the posted code? Any help with this would be much appreciated!
Jared Broad
Thanks The Dude we'll look into it. We had a similar report recently I appreciate you letting us know. We'll post back when we know more =)
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Bodhi
Any update on this? Curious if you were able to figure out the issue. Thanks, Jared.
Alexandre Catarino
Hi The Dude ,
Sorry about the wait.
The value of an order is generally defined as:
value = price * quantity * conversion_rate * contract_multiplier
where conversion_rate is the currency conversion rate between the security quote currency and the account currency, In this case, its value is 1 because the option and the account are USD denominated. The contract_multipliter is the number of shares that each unit represents. For US Equity Options, this value is usually 100.
Looking at the values of the first two trades from that algorithm, we have:
Buy 10894 shares of SPY @90.64. Holdings value of 987432.16 (= 10894 * 90.64 * 1 * 1 )
which is roughly 98.7% of portfolio value
Buy 54 contracts of SPY 091218P00050000 @ 1.90: market value 10260.0 (= 54 * 1.90 * 1 * 100)
which is roughly 1% of portfolio value
Bodhi
Thanks for this detailed explanation. That's also my understanding, but what's throwing me off is the 'Value' column in the downloaded trade log (ie, "Download Orders" link). When I open that CSV, the value of that the first option trade is shown as $102.60 instead of $10,260.
Perhaps I'm reading the CSV incorrectly, and 'Value' doesn't imply dollar value of the contracts purchased, but dollar value of options divided by contract_multiplier...? The title of 'Value' for that column is a bit ambiguous.
Alexandre Catarino
Hi The Dude ,
The variable used to create the values in the Value column is not rightfully set.
I have created a GuitHub issue to address the problem:
Order.Value Property Does Not Take Into Account Currency and Multiplier #4571
Bodhi
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!