Option FanaticOptions, stock, futures, and system trading, backtesting, money management, and much more!

Practice Trades BWB+Cal 1.2 (Part 2)

Per the suggested guidelines, this trade was a loser. Surely we can always come up with tweaks to improve the outcome.

One alternative would be to close current positions and enter a calendar above the money at 2 DIT. This is making a blatant directional bet albeit one that coincides with the general tendency of stocks to go up more often than they go down:

Proposed directional adjustment (1-18-21)

This adjustment would put trade down $1,830 on $9,235 margin with TD = 4. Despite a subsequent down day, we see a nice recovery through 3/11/21:

Progress of proposed directional adjustment (1-18-21)

Trade is now completely directional to the downside, which blatantly taunts the general tendency. We could exit for a loss of $955, which is lower than the 2 DIT loss of $1,410.

If we choose to press onward, then we could roll to first above-the-money [10-point] strike. This would take PnL back to -$1,375 since the adjustment involves 20 contracts. Be aware that each adjustment takes days from which to recover (unless I’m being far too aggressive in my TF assumptions).

One day before expiration, this trade is down $375. Given what we’ve been through, we should take this and consider it a huge moral victory.

Rolling the dice to expiration:

Exit of proposed directional adjustment 1 (1-18-21)

That’s a 10% return of $925. Lucky Charms!

But wait… there’s more?! Watch for it next time.

Practice Trades BWB+Cal 1.2 (Part 1)

This trade begins 3/3/21 (14 DTE) down $840 (max DD). MR is $6,065 (five contracts) and PT is $6,065 * 0.05 = $304. At inception, TD = 44, IV 21.9, NPD = 1.59, and NPV = -122.

After one day, market is down 1.3 SD to force adjustment. Trade now down $1,360 on margin of $9,235.

On very next day, market is up 1.6 SD to force adjustment with trade down $1,410. Second adjustment looks like this after calendar repositioning and rolling out upper wing:

T+x lines underwater at second adjustment (1-18-21)

Since most T+x lines are underwater, I would close the trade for a loss of 15.3%. The problem with T+x lines being underwater is that I would have to wait nearly to expiration to be profitable—and even at that, only if the market remains in a range. The market is 0/2 so far at remaining “within range,” which seems like a very ominous sign.

With trade opened near close of first bar, the underlying price chart looks like this:

Price chart (1-18-21)

Recovery from such a whipsaw is difficult in a short-term strategy. I would be fine without the first adjustment, which occurred with the market still under the profit tent. These guidelines dictate adjustment nevertheless.

I will continue next time with some potential alternatives to managing this trade.

Practice Trades BWB+Cal 1.1

Practice Trades BWB+Cal correspond to the following general guidelines:

The wings may be adjusted to 30/40, 50/60, 40/50, etc. in order to limit initial NPD, which should ideally be slightly negative. The short strike may also be split although this may make execution more complex.

This trade begins 3/18/21 (14 DTE) down $840 (max DD). MR is $7,015 (five contracts), PT is $7,015 * 0.05 = $351.
At trade inception, TD = 36, IV 17.1, NPD = -1.78, and NPV = -122.

First adjustment occurs very next trading day with max margin increasing to $11,285.

Second adjustment occurs on 3/26/21 (8 DIT) by rolling up calendar and calendarizing two of the five upside wing contracts. This increases margin to $14,238.

On 3/30/21 (2 DIT), exit trade for 7.2% on max margin with market up 0.32 SD in 12 days. IV decreased 18%.

I have two general comments.

First, I suspect $21/contract TF is much more than I should normally see in live trading (this amounts to ~12% initial margin with a PT of 5%, which seems preposterous). If this works out okay in backtesting or on paper, then it should work out well. As I do some of these live, I should get a good feel for what number to expect.

Finally, I’m a bit unclear as to whether I should use PT as a percentage of initial margin, current margin, or max margin. Until I see reason to change, I will use the latter. This does mean, however, that the trade should always be done with a limited portion to account for margin more than doubling upon adjustment.

Practice Trades: IC 1.1

Whether important or not, I’m not happy about my trade diversity last year. In an attempt to push the envelope and improve, I’m going to start spending more blog time posting practice trades.

A practice trade may be live, paper, or backtested. Live and paper trades are both followed in real-time. Backtested trades are done completely in hindsight.

My goal in doing this is to gain more familiarity. Period. I want to be able to place these trades as if they are second nature. My bread-and-butter strategy has been repeated daily for months. I want to feel equally comfortable with others.

As seen in the post title, I am calling these “Practice Trades.” The subsequent code describes type of trade, trade number of the methodology referenced, and methodology (seen after the dot). I may or may not go into detail about the specific trade plan since my goal is not to wax eloquently about the pros, cons, and potential strategy variants. You’re always welcome to post questions or comments below.

Today, I will include the following methodology:

This trade begins 1/4/21 (74 DTE) down $336. MR is $18,036 (two contracts), PT is 1964 * 0.8 = 1572, and ML = 3144.

At trade inception, TD = 46, IV 21.31, NPD = -0.69, and NPV = -239.72.

On 3/4/21 (59 DIT), this trade closed for ROI of 9.1% with market up 0.19 SD. IV increased 17.5% over the following:

Practice Trades IC 1.1 (underlyling price) (1-10-22)

Chalk up one for the good guys. Remember though, the focus here is on developing “muscle memory.” To that end, losses must be welcomed as they are a reality of trading.

Dictionary Struggles in Python (Part 2)

Today I want to continue discussion from last time about problems I had coding a dictionary application in Python.

Despite the fix already described, I remained puzzled with regard to speed of the original program. I added some #debug lines for timing purposes and also to display progress:

Python code (3) (12-24-21)

The last line prints out as ~50 seconds, but it takes an additional ~100 seconds before the graph renders and execution concludes. What’s taking the additional 100 seconds? And why does it take even 50 seconds to loop through the dictionary? The dictionary has 717 key-value pairs, which doesn’t seem like that much. These questions remain unanswered.

Iterating over the dictionary is not uniform. It goes slowly until about 200-300 and then prints up to 500 in an instant, to 700 and done. The last 400 or so are lightning fast while the first 200-300 are really slow. I get similar results with this code in Spyder and Jupyter Notebook.

The if statement explains this lack of uniformity. The program should go faster for keys > 250 since nothing is to be done. Only qualifying keys are to be plotted.

Is the conditional statement evaluating dictionary order or value of the key (not to be confused with the key’s corresponding value)? Consider the dictionary {3:29, 8:32, 1:16}. Keys under 10 include the first and second one (or 0th and 1st one given zero-indexing). If this referred to order, then all keys would be under 10 since only the dictionary has only three keys. This doesn’t make logical sense since dictionaries are unordered.

That keys are evaluated in terms of inherent value is verified by this code:*

Python code (4) (12-24-21)

As I run this code over and over several times, I get a varying number of keys > 5 in the last line. If the conditional referred to order, then five keys > 5 would always be identified (i.e. the sixth, seventh, eighth, ninth, and tenth).

The moral of this story is hard to say. I definitely don’t want to plot every point every time. I want to iterate over each point and plot if it qualifies. Even better, probably, would be plotting all points at once. That might also save more time. I need to study the code closer to figure out how to do that.

* — Line 2 should read: “generate 10 random numbers between 1 and 20.”

Dictionary Struggles in Python (Part 1)

Today I want to go over some dictionary lessons learned from a recent Python exercise.

My goal was to go through the 2021 .csv file and sum/graph number of rows by DTE. I had trouble to start, so I capped the initial range at 250.

I started with this:

Initial Python code (1) (12-24-21)

The result was this:

Initial Python graph(1) (12-24-21)

Two unexpected things happened: x-values larger than 250 show up and the program takes nearly two minutes to run.

My first mistake is using .keys() and .values(), which generate lists of all keys and all values when I only want keys < 251 and their single corresponding values. Not only are all key-value pairs plotted, what can't be seen is that they are plotted many times. All key-value pairs are plotted whenever a key under 251 is found. The dictionary has length 751 with 184 keys < 251. I believe a total of 751 * 184 = 138,184 total points are plotted.

I eventually modified the code as follows:

Python code (2) (12-24-21)

Python graph(2) (12-24-21)

This takes ~0.5 seconds, which is a substantial performance improvement. In addition, when a qualifying key is detected through the iteration process, only the corresponding key-value pair (rather than the whole dictionary) is plotted.

I will continue next time.

Calendar Backtesting the COVID-19 Crash (Part 7)

I have been discussing impressions from calendar trade backtesting the 2020 COVID-19 crash.

One loose end from Part 6 was directional bias in my second backtest (top graph):

Directional bias check (12-27-21)

I calculated strike price minus SPX price (“Diff”) for 46 cases of trade entry or adjustments. In the top row, positive (negative) numbers indicate a bullish (bearish) bias. 3.41 points represents a mean bullish bias of 0.1% based on the mean SPX price 3654: hardly anything at all. Standard deviation for positive/negative differences ranges from 7-12 points, which suggests 3.41 will not be statistically significant.

My backtesting guidelines for the bullish single calendar are as follows:

Here are the ONE results:

Single bullish calendar ONE results (12-27-21)

Profit factor is 3.9 with 88% winning trades. This is really too good to be true, and you know what that means…

Directional bias here is ridiculous. The market won’t always be rallying like it did from Mar 2020 through Oct 2021:

Directional bias check bullish single only (12-27-21)

Mean bias is 3% bullish with the average DIT 32. This implies an average annual SPX return of 34% when over decades this is said to be closer to 9-10%. For the longer term, I can see leaning 1% bullish. Perhaps that is my next backtest to run.

This strategy is dangerous because it lacks downside management. Trades beginning on 7/26/19 and 2/21/20 have maximum drawdowns of 90% and 84%, respectively. Being so close to -100%, this does not leave much room for a stop and it can destroy account equity (based on three losing trades, which is a very small sample size). The risk graph shows when leaning this bullish, losses can be hit even with the market slightly down:

Single calendar risk graph (12-27-21)

I’m also including this graph to get additional perspective on why DCs are not as advertised. Note how this tent peaks around +191%. With a DC in place, even if one of the two calendars suffers huge losses (e.g. 50-100%), the potential for +191% is enough to offset that. Unfortunately, +191% is not available 32 days into the trade. At that point the highlighted line, which peaks at +27%, is a more realistic estimate (assuming no IV changes). If one calendar is up 27% and the other is down 54% then we will still have major losses to deal with. Holding until 14 DTE gets the highlighted line closer to +68%, which still falls short if the second calendar is facing drawdowns akin to those mentioned two paragraphs above.

As option traders, we would probably benefit by hiding the expiration curve entirely since it’s usually too good to be true.

Calendar Backtesting the COVID-19 Crash (Part 6)

Today I continue discussing my impressions from calendar trade backtesting the 2020 COVID-19 crash.

I left off showing results for a single-only calendar strategy, which is a contrast to guidelines from Part 1. When I said these results are not encouraging, I was comparing with backtest #2 (summarized in Part 3) whose ONE results look like this:

2020 COVID-19 crash Cal backtest No 2 (12-21-21)

PF is 2.2 and average win is 2.5x average loss. Net profit is much better. I would certainly consider trading this. The DC allows me to hold a losing calendar longer because it also includes one that is winning.

I’m still not totally sold on DCs. Perhaps single calendar results can be improved if I hold a losing trade longer.

This is really suggesting a directional bet. Holding a losing calendar longer means dropping the TD > 4 criterion. This usually happens when the market is above or below the calendar strike, which implies a bearish or bullish bet, respectively.

Given directional choice, I would certainly bet bullish. I mentioned the upward bias to equities in the fourth paragraph here, in the last paragraph here, and in the tenth paragraph here.

Before I decide how to implement this, I want to consider how even the ONE results shown above might be improved. Number of losers still exceeds number of winners, which is not ideal. Also, profitability is concentrated between Apr 2020 through Feb 2021 (10 months). The rest is equity curve chop, which makes me question consistency. A larger sample size of years leading up to 2020 would broaden the context.

I should check to see what directional bias I already have in the trade. I did not intend any, but starting each trade at the nearest 25-point strike implies a tiny bit. Number of times I leaned bearish and bullish should roughly balance out.

I will continue next time with backtesting a bullish calendar trade.

Incidentally, I clicked [the lower box] to see the following ONE results:

Single cal 2020-1 backtest results without TF (12-21-21)

Compare this to the graph shown above. This also has a PF 2.2 and number of winners exceeds number of losers. This appears to be a more consistent strategy.

Unfortunately, these results are a mistake. I accidentally turned off commissions, which eliminates transaction fees. This is fantasyland and we have known this for a long time (see third-to-last paragraph here and fourth-to-last paragraph here).

If I significantly overestimated slippage, then the single-only calendar strategy with no directional bias might be worth doing. This would then be another instance like that described in the second paragraph here. Any backtest where I stack the odds against and performance still comes shining undeniably through is a strategy with which I really want to go live.

Calendar Backtesting the COVID-19 Crash (Part 5)

Today I continue discussing my impressions from calendar trade backtesting the 2020 COVID-19 crash.

The bigger point with which I left off is that a cursory check (at least) to authenticate a backtest should always be done. No backtest is Truth and live trading is often not exactly per guidelines. Some traders are more discretionary than others and some couldn’t replicate a set of backtested trades even if they really wanted to. Nevertheless, in a backtest like this or this with a limited number of trades and a short time horizon, one mistake can materially affect results.

I’m not sold on double calendars (DCs) because overall, they don’t seem to grow profit as quickly as singles. This is subjective and anecdotal, but I’m going to try and put some reasoning behind it.

DCs are more risky than single calendars for two reasons. First as mentioned in Part 4, being established through adjustment implies less time to recoup transaction fees. Second, being established later means more gamma risk where substantial market moves can result in big losses. DCs need not be riskier from a margin standpoint, but the greater gamma risk is pervasive and insidious. This matters in the face of large market moves, which are a reality in trading.

To control gamma risk, I could implement a minimum DTE limit beyond which only closing contracts and re-entering farther out in time would be permitted. Theoretical determination of this optimal drop-dead date would be very challenging.

Another possibility would be to allow just single calendars. When an adjustment point is hit, exit and enter anew with at least 56 DTE. Here are the OptionNet Explorer (ONE) results of such a single calendar backtest:

Single cal 2020-1 backtest results with TF (12-21-21)

This is not encouraging. Profit factor (PF) is only 1.2 and number of losers exceed number of winners.

In running this backtest, I felt the market often moves around too much for a single calendar to contain it. This led to more frequent whipsaws than backtest #2 (Part 3) where DCs are permitted.

In running this backtest, I also became very cognizant of how quickly a single can lose money when the market moves away from the strike. DCs looks appealing with the wide profit tent, but one calendar is always losing money as the market trends. This may explain why profit seems to develop slowly. Day steps would do a better job at revealing extent to which the expiration curve is mere mirage. This is usually the case with my option trading, but perhaps it’s more pronounced here.

I will continue next time.

Calendar Backtesting the COVID-19 Crash (Part 4)

I left off asking about a subtlety that would probably be identified by only serious option traders. Submitted for your approval is a question about why one backtested calendar is ~30% more expensive than all the others. Were you able to explain it?

The nuance here is that calendars generally get more expensive when purchased closer to expiration. To lower the cost, I would generally go farther from expiration, but that is not the case with the Sep/Oct calendar I mentioned in the second-to-last paragraph of Part 3. The calendar I backtested was an Oct 3225 put priced at 24.09% IV and a Nov 3225 put priced at 26.24% IV. Is that normal contango? I’d have to survey a large sample size to find out but my guess is no.

I suspect two factors have contributed to make this calendar atypically expensive. First, it is 35 days wide. This happens four times per year [(4 * 5 weeks in between mos) + (8 * 4 weeks in between mos) = 32 + 20 = 52 weeks for the full 12 mos] and it means paying for one extra week of extrinsic value in the long leg.

Second, and what I believe to be of greater importance, is the 2020 presidential election. I think the Nov options are priced rich due to election uncertainty.* On 7/31/20, IV for Nov and Dec are 24.55% and 24.66%, respectively (beyond which term structure decreases). Purchasing the Nov/Dec 2020 112/140 (DTE) calendar would cost $4,650: much less than the $8,840 seen here. The horizontal skew on the Nov/Dec would be -0.19, which is much lower in magnitude than -2.15 for the backtested Oct/Nov. Term structure rises steeply through November and then starts to trail off. This is unusual.

Incidentally, I’m puzzled why I exited this adjusted DC at 43 DTE when a third adjustment point was hit on 9/3/20 to open a single Nov (78 DTE)/Dec calendar. I could have rolled to ATM, as the presenter’s guidelines suggest (green):

Proposed roll for 11940 TD 7 (1) (12-16-21)

I could have also gone an extra 100 points OTM (green):

Proposed roll for 11730 TD 17 (2) (12-16-21)

Theta is comparable for both and cost is slightly less for the latter. TD is even higher for the latter (17 vs. 7). Either of them look doable. Every time I adjust a calendar, PnL gets dragged down a bit by transaction fees. Since it usually takes a few days of positive theta to recoup that, maybe I should never adjust too close to my drop-dead 21 DTE. That is no excuse here with 43 DTE and plenty of time left.

I will continue next time.

*—As an exercise for another post, I should plot this term structure in Python. An additional
     detail would be to scale the x-axis properly since data points start one month apart and
     later increase to points that are three months apart.