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

Mean-Reversion Study (Part 1)

Conventional trading wisdom often suggests to “sell when the market is high and buy when the market is low.” This study is designed to see if the data support such mean-reversion activity.

If I were better versed in AmiBroker Formula Language (AFL) then I could code a simple trading system and study the performance metrics. I could look at profit factor, Sharpe ratio, % winners, MDD/CAR, etc.

Unfortunately, I remain weak in that area so I turned to the old standby: MS Excel. My plan is to use inferential statistics rather than a trading system development approach.

The study methodology is as follows:

1. Start by downloading historical price information from Yahoo!

2. Create a 23-day price oscillator. The formula for this is: Osc = 100 * (C – MIN ) / (MAX – MIN)

     C = current day’s closing price
     MIN = lowest closing price of last 23 trading days (including C)
     MAX = highest closing price of last 23 trading days (including C)

3. Create “MFE [maximum favorable excursion] next 23 trading days” with this formula: MFE = 100 * (MAX – C) / C

     MAX = highest closing price of next 23 trading days (not including C)

4. Create “MAE [maximum adverse excursion] next 23 trading days” with this formula: MAE = 100 * (MIN – C) / C

     MIN = lowest closing price of next 23 trading days (not including C)

5. Divide the data by Osc score into 20 groups: Osc < 5, 5 < Osc < 10, 10 < Osc < 15… 90 < Osc < 95, Osc < 100.

6. Run a single factor ANOVA to see if MFE values varied across the 20 groups.

7. Repeat for MAE values.

Will MFE and MAE differ with respect to Osc? Mean reversion would suggest that when Osc is more overbought with values toward 100, MFE and MAE values should be lower. In the other direction, mean reversion would suggest that when Osc is more oversold with values toward 0, MFE and MAE values should be higher.

I will discuss the results next time.

Option Trading Meetup (Part 3)

As I was writing the last post I got the sense I was being too hard on this group. Today I will reality check myself.

I criticized DY for claiming to have been trading for 30 years and over seven figures per week. This is not verifiable and therefore not something I believe should be brought into the discussion. All it can do is serve as a faulty basis for trust. For this reason, I don’t share such information with others and this is probably why the organizer treated me as a newbie when answering my question.

But experience is often stated in other fields. Pharmacists will say they’ve been practicing for X number of years. Surgeons will say they have done Y number of surgeries. Lawyers will say they have litigated Z related cases [and won, which is also not verifiable]. As a society we accept these claims. Why should one not accept a similar claim from a trader?

I feel like fraud and deceit are more prevalent in Finance because it is all about the money. Pharmacy, medicine, and law may indirectly come down to money but there can also be other things involved (e.g. medical treatment, legal rights, and wanting to help others). Finance is the direct conduit to money and is therefore at risk for stronger exposure to greed: one of the seven deadly sins. While this sounds good, I have no data to support it. I should therefore recognize it as a personal bias but not act on it.

I sometimes disagree with other traders because I focus on data science while they employ “conventional wisdom.” I can continue to follow the data. If disagreement leads someone to say “I have been trading for 30 years and I trade seven figures per week” then I can respond “I have extensive live trading experience too” and move on. I don’t need to disqualify them just because they stated unverifiable experience. I also don’t need to accuse them of fraud.

Hopefully my second visit to this Meetup will be more fulfilling.

Option Trading Meetup (Part 2)

I left the Meetup fuming and doubtful about my prospects of returning in January. I texted the following to a friend:

      > I always find know-it-all type people at these
      > Meetups who are totally full of themselves.

      > Maybe I should look in the mirror and ask
      > whether I am one of these too.

      > I am somewhat dogmatic in my belief that so
      > much of this stuff cannot be known for sure.
      > Much certainty I often see displayed is
      > totally unfounded.

      > Perhaps that means I often butt heads with
      > supposed “experts” only to raise some of the
      > thought-provoking issues I believe we should
      > all explore in an effort to understand this
      > complicated stuff. There are many key
      > concepts I still struggle with after years
      > of work.

      > I guess I get irritated at seeing them make
      > definitive claims about things that I do not
      > see as definitive. Nobody else in the group
      > is going to challenge that because they are
      > beginners.

DY claimed to have been trading for 30 years and over seven figures per week. I don’t care how long someone says they have been trading options or how much they claim to have made or trade because none of this is verifiable. The world of Finance strikes me as screwy because those lauded as de facto experts are usually people with significant conflicts of interest. Given the all the financial fraud perpetrated to date, I would have great difficulty trying to argue that “financial professionals” actually care more about my performance than they do getting my business, bolstering the total AUM, and making more money for themselves.

I did not enter the room with hopes of being respected as the trading expert. I hardly think of myself that way. I did not talk about my experience or about my profits (or losses). I did find it amusing/insulting that when I posed a couple discussion questions about the first instructional video we watched, the organizer herself answered with simple, incomplete answers almost as if to placate me.

Seriously?

I’ll break this down further next time.

Get a Hold of Me

I don’t often hear from readers out there especially because I do not promote this blog. However, I am interested in finding a research partner. If anyone out there has a good understanding of trading system development and/or coding then please e-mail me: mark at optionfanatic.com. I’d love to hear from you!

Option Trading Meetup (Part 1)

I wanted to report on a new option trading Meetup I attended in December.

I was excited to finally attend a Meetup dedicated to option trading not sponsored by any financial company. I have attended Meetups sponsored by a trading newsletter, a trader education company, and a financial planner in the past and every time I have encountered a potential/likely conflict of interest. While I got little/nothing out of those Meetups, the organizer always found some potential customers. That did not seem to be an issue here although reading that their November presenter was CFA at a “wealth management” firm did arouse suspicion.

With the CFA not present in December, I thought I might have a good opportunity to network with “like-minded” individuals.

This was clearly a beginner’s Meetup with the intent to teach people how to trade options. The organizer herself and husband both said they were just learning. While I don’t feel this is necessarily a problem, who was going to teach on this night?

The one like-minded individual for me to meet was a guy [I’ll call him DY] who had supposedly traded options for 30 years. He also said he trades options amounting to seven figures per week.

DY was a “know-it-all” (sound familiar?) who stepped into the expert role almost without being asked. I say almost because the organizer did seem to defer to DY for answers a few times and I surmise that was based on how things went at the first meeting in November. Outside three instructional videos shown by the organizer, a few questions were asked and some discussion was had. Involved with every exchange was DY who at times seemed to stumble over his own feet rushing in so fast to provide what he believed to be the correct answer.

I’ll continue next time.

Risky Proposition (Part 2)

I believe we should always be thinking about the likelihood of history to repeat before concluding too much from historical backtesting. Usually, the answer is “unlikely to repeat” and Monte Carlo simulation to randomize trade sequence seems like a logical solution. Studying only one historical equity curve introduces selection bias to the system development process.

Lines 4-6 in the last post suggested dividing initial equity by the maximum drawdown (DD) to best understand trading system risk. This prevents someone from inflating potential returns by advantageously changing the backtesting start date. Certainly when developing my own system I also want to avoid underestimating risk. In live trading if I lose much more than expected then the result could be catastrophic.

Lines 1-3 address accurate assessment of DD risk. I love to see an equity curve grow exponentially but the way to do that is by increasing position size along the way. DDs occurring later in the trade sequence will be proportional to position size and this can distort our understanding of risk. For example, which year has the worst DD for each system shown below?

DD Analysis (1) (1-27-16)

Clearly the 2010 DD is twice that of 2008 for each system. Does the additional information shown below change your perception?

DD Analysis (1-27-16)

The 2010 DD is worse for system 1, the 2008 DD is worse for system 3, and the DDs are equivalent for system 2. I now can better understand how DD should be understood in terms of position size.

Using a constant position size during development of a trading system helps remove the bias produced by order-dependent testing results. We may already have a selection bias introduced by choosing an equity curve that is better than the mean. Do not compound that by adding artificial equity growth due to trade sequences not likely to be repeated.

Put in simpler terms, when analyzing DDs I need to keep position size constant to ensure apples-to-apples comparison.

A Brief Glimpse into Theoretical Physics

Last time I mentioned a concept arguably more suitable for a theoretical physics blog than a blog on option trading:

     > To say “calculate [drawdown] as if it happened on Day 1” is to
     > say any ordering of events is equally likely. A 2011-type
     > correction could have just as well happened in 2002 and a 9/11
     > could have just as well happened in 2008, etc.

Understanding our current reality as a cumulative result of historical events/decisions is a controversial interpretation amounting to fate and destiny. While many people do understand the world in these causal terms, cognitive psychology suggests the human brain works unconsciously to identify causation even where none actually exists. This is adaptive: living in a logical world is certainly less stressful than living in a world where utter chaos lurks around every corner.

How robust is our current reality? Is it like a sequence of dominoes where toppling of just one can affect everything that comes after? Is it more like Jenga where many previous decisions may be altered before the present is affected?

Trekkies will always remember the words of Jean-Luc Picard in “Yesterday’s Enterprise:” “Who is to say that this history is any less proper than the other?”

Another good description of the infinite realities concept is shown here from time index 07:00 to 09:45.

For all these reasons, I mentioned “overstated conclusion” in the final paragraph. I do not want to make the mistake of basing trading decisions on the shape of a backtested equity curve. People commonly ask to see these historical equity curves without realizing that these are just one possible path a trading system may follow through time. A slight alteration in the trade sequence may result in worse drawdowns, losing periods instead of profitable ones, etc.

Gaining that “broader perspective” by numerous Monte Carlo simulation runs can decrease the chance of falling prey to this sort of curve-fitting.

Risky Proposition (Part 1)

Continuing on with a previous discussion about normalizing risk:

     > Position sizing should be held constant throughout the   [1]
     > [duration of in-sample backtesting]… This allows for
     > an apples-to-apples comparison of PnL changes             [3]
     > throughout… A drawdown (DD) at any point should be
     > evaluated as if it occurred from Day 1; this is one          [5]
     > way of interpreting maximum risk.

I will start by describing the concept in lines 4-6 and then cover lines 1-3.

Risk tolerance may be used to determine position size. Suppose the max DD I can psychologically withstand is 10%. Based on the oft-quoted trading adage “the worst DD is always ahead of you,” I should select a smaller position size such as one corresponding to a max DD of 5%. If I now encounter something 2x worse in live trading, my psychology can [hopefully] tolerate it thereby avoiding the potentially catastrophic result of abandoning ship at the darkest moment.

Sticking with the conservative theme, I should also calculate DD as a percentage of initial equity because this will give a larger DD value and a smaller position size. For a backtest from 2001-2015, 2008 was horrific but as a percentage of total equity it might not look so bad if the system had doubled initial equity up to that point.

To say “calculate DD as if it happened on Day 1” is to say any ordering of events is equally likely. A 2011-type correction could have just as well happened in 2002 and a 9/11 could have just as well happened in 2008, etc. In case this is true, I prefer not to trade real money based on the overstated conclusion that a DD occurring later was destined to occur later. Monte Carlo simulation can randomize the trades to generate a large number of potential trade sequences for a trading system. I can then look at averages and standard deviations for things like net income and max DD to get a broader perspective of what to expect in live trading.

Sleep Easy Stocks (Part 2)

I intended this to be a quick hitter but in writing the last entry I discovered the fabled “sleep easy portfolio” has two separate characteristics: not being perpetually stressed over potential losses and bragging about winners.

People love to brag about winners. If bragging were ever to be justified then I believe one who works hard at something has more right to do so than one who had it easy and did not put forth any effort at all [I still think bragging should be avoided because it amounts to hubris and as the old adage states, “karma’s a *itch“].

Another cliché is “no risk no reward.” If I truly have no risk then I may sleep easy but I will not make any money.

What I don’t see happening is having my cake and eating it too: no stress and the ability to brag about windfall profits. If I make good money and it seems easy then I should avoid bragging because luck might have played a part and it’s probably just a matter of time before Mr. Market evens the score (and then some). Not everyone can make good money because not everyone works hard, which is one reason a hard work ethic is highly valued in this society.

The “sleep easy portfolio” is therefore nothing more than a myth.

I used to know somebody who would say “I don’t need to work as hard as you because I ‘get’ things faster.” She later went to alcohol rehab and things did not fare well for her. My guess is that until [if] she changes that belief about hard work, she will always be in denial and will continue to have great difficulty finding success in her life.

Sleep Easy Stocks (Part 1)

In May of last year, I saw a comment on a trading forum that truly resonated with me:

     > If a successful hedge fund manager is anxious about
     > the market, perhaps he should just take some valium.
     > Any investor in something as unpredictable as the
     > stock market who isn’t anxious–all the time–is not
     > in touch with reality. Whether the market is up,
     > down, or sideways, anxiety should be the baseline
     > emotion. Anyone who thinks he has a “sleep well at
     > night portfolio” is an idiot in denial.

In my opinion, plenty of reasons may be had to be bullish or bearish at any moment on the right edge of a chart. Optimists and pessimists always exist in the marketplace and the financial media’s whole business is to come up with both sets of arguments in order to capture as large an audience as possible.

In retrospect, it’s easy to look at a chart and say “it was easy to trade back here as the market was trending smoothly.” Investors and traders seem to do this all the time.

Now into my ninth year of full-time trading, I have not found these stories about easy money and stress-free trading to be reality. Rather, I consider it the stink of marketing and advertising. I’m not on edge during the days and experiencing cold sweats at nights but you also will not hear me bragging about profits. No matter what I’ve made in the past, I can easily lose everything when I encounter the next vicious market environment. This is reason enough to always keep one’s head on a swivel and to never think a portfolio without risk is a reasonable expectation.

If you disagree with the latter point then please consult Ronda Rousey. I would be very interested to hear what she thinks.