Hi all,
I was hoping for a little help/clarification as I seem to be having a little trouble here-
I've been working on implementing a delta-neutral straddle strategy and decided I'd calculate delta and hedge quantities myself. I used a method that backs into BSM for IV, calculates delta, then determines the ideal hedge quantity and places the corresponding order. The method takes the following inputs:
S = # Underlying Price
K = # Strike Price
T = # Time to Expiry (in years)
r = # Interest Rate
q = # Dividend Rate
call_price = # Call Price
put_price = # Put Price
position_type = # Position Type (Long or Short)
spread_quantity = # Quantity of spreads
existing_pos = # existing position in underlying
The idea was that these values from my open straddle position would be actively updated so that when the DeltaHedge function is executed, the updated inputs are used. My question: I'm not quite sure how to monitor my open straddle position and keep these live updated input values so that I can hedge whenever I want. If anybody knows how this could be done, I'd really appreciate the input. Thank you!
Ashutosh
Hi Jack
Interesting thought.
QuantConnect allows you various object parameters and methods to trigger events based on various positions and events.
One helpful method is the “OnOrderEvent” which is triggered at any event. You can make use of this to keep tract of events in your code.
You can also schedule methods using Schedule method to keep a check on portfolio positions and update the values.
Adding some reference links:
1) Schedule events
2) Portfolio object
Hope this helps and gives you proper direction. Also, check out our discord channel where people brainstorm ideas.
Best,
Ashutosh
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.
Jack
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!