Especially if a year is a steady grind higher like 2013. Seemingly small hedge amounts can translate to drastic underperformance in strong markets. Same data but for the 5.0% hedge structures. The chart below shows the differences in annual performance between the 2.5% hedge structures and a 100% long position in SPY. This table shows the cumulative CAGR and max drawdown data for all structures and allocation amounts since April 2007. The graphs below show the same structures as above, but for a target quarterly allocation of 95% in SPY and 5% in the hedges. Markets are mostly efficient – after the 1987 crash traders have bid up the implied volatility of distant OTM puts (well beyond what Black-Scholes would suggest) to reflect the fact that tail risks do occur and stock market returns are not normally distributed. The main takeaway of the above chart is that the strike distance doesn’t really matter. For example, if at the end of a quarter the SPY allocation drifts to 99.0% and the hedge is 1.0%, the percentages are rebalanced to 97.5% and 2.5%. The first graphs show the compound return and max drawdown for a 2.5% allocation to the three structures. April 2007 is the start of my dataset and this 11-year period captures a full recession and expansion market cycle. Data in this post ranges from April 2007 to December 2018. The old $235 put would be rolled to a new $245 put, with a new six month maturity and adjusted strike price. Then at the end of Q2 on, SPY was trading at $271.28. For example, on, the expiration would be used for the next quarter. This rounding is done to use more liquid strikes.Įach option originally has six months to maturity. The closest strike interval of 5 was $235. An exactly 10% OTM price would be $236.84. For example, on (end of Q1) SPY closed at $263.15. Options are rolled on the last trading day of each quarter based on the nearest SPY strike interval of 5. The data in this post covers three types of hedge structures: 10% out-of-the-money (OTM) puts, 20% OTM puts, and 30% OTM puts. Being long a put option offers limited downside and unlimited upside, but this attractive payoff profile comes at a cost since traders are (mostly) smart and price options accordingly. There are many ways to hedge, and a common method is to overlay SPY puts to protect existing stock exposure. Interest in hedging strategies tends to increase as market volatility rises. But has it actually worked? This post examines the historical costs and benefits of hedging stock exposure with SPY puts. Highwatermark.Hedging sounds like a smart thing to do. May like to start further bug-tracing with a cross-check-ing of the state of objects and the call-signature: try:įor t in np.arange( 1, cumret.shape ): Where a tuple was attempted to get constructed on the right hand side of the value-assignment (well, actually an object-reference gets assigned in python, sure, but was trying to remain short here to tell that fast for an easy reading ), the first item of which was expected to get assigned to a returned value from a call to the above documented np.maximum(.) function. This simply fails to meet the expected behaviour once only one of the expected pair of values was delivered in the reported line ( see the closing parenthesis ), or a scalar or any other, non-array-like type of object(s) were attempted to be delivered into the call-signature: highwatermark = ( np.maximum( highwatermark ), cumret ) Your code uses a call to a numpy function having a defined a minimum-call-signature as: Q: What code do I need to change for my code to work? MaxDrawdown = calculateMaxDD(cumret.values)įile "Ex3_4.py", line 15, in calculateMaxDD MaxDD, i = np.min(drawdown, np.argmin(drawdown)) # drawdown Highwatermark = (np.maximum(highwatermark), cumret)ĭrawdown = ((1+ cumret )/(1 + highwatermark) - 1)ĭrawdownduration = drawdownduration + 1 # CALCUALTING MAXDD AND CREATING THE FUNCTION.ĭrawdownduration = np.zeros(cumret.shape) What code do I need to change for my code to work? import numpy as npįrom MaxDD_Function import calculateMaxDD I followed the code to the T and has worked perfectly up until now, and I seem to be getting a ValueError Exception. Im trying to follow an exercise on calculating the maximum drawdown and maximum drawdown duration of a market market neutral vs a long-only trading strategy.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |