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

2020 Career Counseling Update (Part 1)

I have experienced increased frustration lately finding others with whom to collaborate on trading-related projects. The time is ripe to update my career path.

I’m about one year into my algorithmic trading journey, which includes months taken in 2019 to begin learning three different programming languages (Python, VBA, and TradeStation EasyLanguage). The road has not been smooth. I have been through two different software platforms. I have paid a pretty penny for education. I have undertaken a handful of statistical studies that leave me with questions about what part of the financial roulette wheel I am likely to land by becoming an algo trader: red or black, anyone?

I have more research questions to pursue, but it gets somewhat stale not having others with whom to collaborate or to critique. I would ideally like to work with a group like this. Reasons for a team approach are discussed in the sixth paragraph here as well as here.

I find negative results to be eye-opening and insightful due to the sheer volume of promising blog posts, articles, and products available purporting to teach profitable trading/investment techniques and approaches (e.g. this post, second paragraph here, and here). The positive claims and compelling marketing contradict the harsh reality of negative findings.

Given the recent political climate, a brainwashing hypothesis may appeal to some.

I do not subscribe to conspiracy theories, however (see second paragraph here). I also do not find the negative approach (e.g. avoid X and Y strategies because they won’t work and can lead to loss) to be marketable when diving deep into the details. I discussed this in the third- and fourth-to-last paragraphs here and in terms of the “worst sales pitch ever” (see two of three final paragraphs here).

My outlook on the asset management industry has been dynamic over the years. I had a negative outlook when I began trading full-time for a living in 2008. In the last few years, my outlook has turned positive. Some of my thoughts on this topic can be found here and in paragraphs 2-3 here.

After 12 years, I view the asset management industry with respect and humility. The investment landscape can be very rough.

I remain largely alone, on an island, managing assets for myself.

Ever heard the saying “if you can’t beat ’em, join ’em?”

I will continue next time.

Crude Oil Strategy Mining Study (Part 4)

Last time, I presented results for the first factor: R(ules). Today I continue presenting results from my latest strategy mining study on crude oil.

The second factor, Q(uality), has a significant main effect on performance (see hypothesis[2]). Not only are best strategies an improvement over worst, the best strategies are [marginally] profitable. Top strategies (n = 816) average PNL +$87, PNLDD 0.34, Avg Trade $1.38, and PF 1.05. As mentioned in the third-to-last paragraph here, none of these numbers approach what might be regarded as viable for any OOS results. They sure would be damning if they landed on the side of loss, though.

D(irection), the third factor, has a significant effect on performance: Avg Trade -$17 (-$57) and PF 1.01 (0.94) for short (long) trades. This should not be surprising since CL fell from $84.60 to $54.89 during the incubation period creating a downside bias (hypothesis[3]). What should be surprising is that as with PNLDD and Avg Trade in Part 3 (second table), Avg Trade is negative for both long and short trades while PF < 1 only for the latter.

A glance at the variable distributions helps me to better understand this apparent sign inconsistency. Avg Trade has an approximately Normal distribution with sub-breakeven (negative) mean. PF has a skewed distribution with a right tail out to 2.37 and left tail down to 0.22. In other words, the right tail goes 1.37 units above breakeven (1.0) while the left tail only goes 0.78 units below breakeven (1.0). This should produce some upward pressure on average PF to exceed 1.0.

The fourth factor, P(eriod), does not have a significant effect on performance. I find it peculiar that the 2007-2011 training period generates significantly more trades than 2011-2015, but I’m not sure why and I don’t think it really matters.

A significant 2-way interaction effect is seen between R and Q. Performance improves slightly in looking from two to four rules across the worst strategies whereas performance declines much more when comparing two to four rules across the best strategies. This interaction is the first graph shown here.

A significant 2-way interaction effect is seen between Q and D. Performance improvement is much greater for top vs. bottom strategies on the long side whereas performance improvement is marginal for top vs. bottom strategies on the short side (like the second graph in the link provided just above).

A 3-way interaction effect is seen between R, Q, and D. This is significant for Net PNL, PNLDD, and Avg Trade and marginally significant (p = 0.057) for PF. I’m not going to try and explain this interaction nor am I going to undertake a 4-way ANOVA by hand to screen for a 4-way interaction that I probably wouldn’t understand either.

I will continue the discussion next time.

Crude Oil Strategy Mining Study (Part 3)

Today I will start to analyze results of my latest study on crude oil.

I ended up running four 3-way ANOVA tests. Recall the factors I am testing:

I am running these analyses on five dependent variables:

The first four are performance-related while the last is for curiosity.

Along the lines of “conventional wisdom,” here are some hypotheses:

  1. Four-rule strategies should outperform two.
  2. Best strategies should outperform worst.
  3. Long (short) strategies should outperform if the market climbs (falls) during the incubation period.
  4. Order of IS and OOS periods should not make a difference since strategies are selected on performance over both.
  5. Number of trades should be fewer for 4-rule than for 2-rule strategies (fifth-to-last paragraph here).
  6. The software is capable of building profitable strategies.

Here are the results:

ANOVA significance summary (7-14-20)

Let’s begin with somewhat of an eye-opener: 2-rule strategies averaged PNLDD 0.15 and PF 0.99 vs. 4-rule strategies with PNLDD 0.02 and PF 0.95. I think this is surprising for two reasons. First, the simpler strategies did better (see hypothesis [1]). Second, the signs are misaligned for the 2-rule group. I checked for sign agreement on every strategy; how can overall PNLDD reflect profit when overall PF reflects loss? The answer is because strategy drawdowns along with the relative magnitude of gains/losses all differ. When averaged together, sign agreement may no longer follow.

Consider this example of two strategies with two trades each:

Apparent PNLDD and Avg Trade contradiction (7-15-20)

Signs align between PNLDD and Avg Trade for each strategy, but when averaged together the signs do not align. PNLDD may be a decent measure of risk-adjusted return, but it cannot be studied alone: sign must be compared with Avg Trade (or PNL). Forgetting this is like adding numerators of fractions with unequal denominators (i.e. wrong).

If I do nothing else today, then this discovery alone makes it an insightful one.

Getting back to the first factor, R does not significantly affect PNL or Avg Trade. PNL is almost identical over 816 strategies (-$4,014 vs. -$4,015). This is a good argument for risk-adjusted return (like PNLDD) as a more useful metric than straight PNL even given constant contracts (one, in this study). With regard to Avg Trade, 2-rule strategies outperform $33 vs. -$41. This difference is not significant.

Here’s something else to monitor: all results so far are negative (see hypothesis [6]).

I will continue next time.

Main Effects vs. Interaction Effects in Statistics

I am almost ready to analyze the effects of different independent variables on strategy performance. Before I proceed, I think main versus interaction effects are important enough to illustrate.

One example is shown below:

Interaction but no main effect table (7-13-20)

Drug treatment appears to have no main effect on pain relief score. If I graph the data showing both genders, though:

Interaction but no main effect graphed (7-13-20)

I now clearly see the effect of drug on pain relief depends on gender. This is a significant interaction despite no main effect.

Consider this example:

Interaction and main effect table (7-13-20)

The drug appears to have a main effect because 50mg results in more pain relief than placebo. To simply collapse the data across gender and claim a main effect, though, shows only part of the story:

Interaction and main effect graphed (7-13-20)

The effect of drug on pain relief clearly depends on gender. For men or women, the drug has no effect or helps, respectively.

While these are 2-way interaction effects, higher-order interaction effects can occur between three or four variables. A 3-way interaction is a 2-way interaction that varies across levels of a third variable. A 4-way interaction is a 3-way interaction that varies across levels of a fourth variable. These get harder to conceptualize as the number of factors increases.

Interaction effects limit generalizability of main effects. I can easily comprehend “A causes B.” An interaction effect means I must qualify: “A causes B, but only when C is… [high or low].”

From a statistical standpoint, my crude oil study does not make for an easy analysis. I am interested in the four factors of strategy quality (best vs. worst), number of rules (two vs four), training period (OOS beginning vs end), and trade direction (long vs. short). With regard to interaction effects, I have seen written in multiple places that 4-way and even higher-order interactions are very difficult to interpret and are rarely meaningful.

Rather than attempting a 4-way analysis of variance (ANOVA: a statistical test), I could run four 3-way ANOVAs or six 2-way ANOVAs. This would simplify interpretation of interaction effects. What doesn’t change, however, is the fact that I am still looking at the effects of four different factors. A 3-way or 4-way interaction is still possible regardless of whether my statistical test has the capability of measuring it. I wonder if I am just blocking out part of my visual field in order to better understand what I do see, which may not be the most legitimate course of action.

I will continue next time.

Why is Curve Fitting Such a Bad Word?

I have been trying to get more organized this year by converting incomplete drafts into finished blog posts. Some of these are from out in left field, but I am publishing them anyway on the off chance someone might be able to benefit.

In the second paragraph here, I said “optimization” is sometimes a bad word. It is specifically a bad word when used to mean curve fitting, which relates back to this draft I wrote in July 2019.

—————————

Is it curve-fitting or curve fitting? Whatever it is, it’s a bad word when used in these parts.

The process of curve fitting, though, is not a bad process but rather a branch of mathematics.

Wikipedia gives us:

     > Curve fitting[1][2] is the process of constructing a curve, or
     > mathematical function, that has the best fit to a series of data
     > points,[3] possibly subject to constraints.[4][5] Curve fitting
     > can involve either interpolation,[6][7] where an exact fit to
     > the data is required, or smoothing,[8][9] in which a “smooth”
     > function is constructed that approximately fits the data. A
     > related topic is regression analysis,[10][11] which focuses
     > more on questions of statistical inference such as how much
     > uncertainty is present in a curve that is fit to data observed
     > with random errors. Fitted curves can be used as an aid for
     > data visualization,[12][13] to infer values of a function where
     > no data are available,[14] and to summarize the relationships
     > among two or more variables.[15] Extrapolation refers to the
     > use of a fitted curve beyond the range of the observed data,
     > [16] and is subject to a degree of uncertainty[17] since it
     > may reflect the method used to construct the curve as much
     > as it reflects the observed data.

When used without validity, curve fitting turns bad. Looking to the past for viable strategies with the hope of applying them in the future makes sense. However, the past is unlikely to match the future and I have no idea of knowing how similar the two may be. The more I try to curve fit a strategy to the past, the less likely it is to work in the future.

The true goal of trading system development is to provide enough confidence to stick with a strategy through times of drawdown in order to realize future profit (see end of third paragraph here). However, if the strategy is poorly suited for the future because it is curve fit to the past then I will definitely lose money trading it. Curve fitting is a bad word in this respect.

Crude Oil Strategy Mining Study (Part 2)

Last time, I detailed specific actions taken with the software. Today I will start with some software suggestions before continuing to discuss my latest study on crude oil.

This backtesting took over 30 hours. For studies like this, implementing some of the following might be huge time savers:

My general approach to this study is very similar to that described in Part 6:

In total, I recorded incubation data for 2 * 34 * 2 * 3 * 2 * 2 = 1,632 strategies in this study: 816 each were long/short, 2-rule/4-rule, best/worst strategies, and OOS beginning/end (each category is itself mutually exclusive, but categories are not mutually exclusive of each other). I enter data with relative speed and accuracy, but mistakes can definitely be made. As another study improvement over the last, I therefore ran some quality control checks:


I will continue next time.

* — This may be difficult because I want only the re-run Results windows—not the
       whole simulation Results window closed. Perhaps this could be offered in Settings.
       I have written elsewhere (paragraphs 4-5 here) about the potential utility of
       retesting strategies on separate time intervals; this might be a widely appreciated
       feature by algo traders.

Crude Oil Strategy Mining Study (Part 1)

Today I continue a blog mini-series focused on putting context around trading system development. I am trying to better understand what can be expected from strategies that look good in the developmental phases.

With each subsequent study, I am discovering nuances and better learning the software. My previous study is described here. In the current study, I have attempted to compile pieces from previous studies and avoid earlier mistakes.

As I learn, the exact methodology varies from study to study. I previously studied equities while I now move forward with crude oil. The following study is my first to include a dedicated stop-loss. What follows is also my first study featuring a highest high (lowest low) stop for long (short) trades. Subsequent studies may not include these. Regardless of the differences, my ultimate goal is to walk away with some big-picture conclusions based on recurring themes found inside the numbers.

Full details on the following study is included in Mining 8, but I will go into extensive detail here.

My process with the software was very repetitive:

I will continue next time.

* — Many of these steps are reflective of my particular screen size, resolution, etc.

What Percentage of New Traders Fail? (Part 6)

Today I conclude with excerpts from a 2013 Forex website forum discussion. The initial post, which tries to rebuke traditional wisdom, is Post #1 here. Forum content is unscientific and open to scrutiny. Do your own due diligence and buyer beware.

—————————

• Post #54, Set:

     > Trading is just like learning any other skill. The catch
     > is that people often learn trading with minimal supervision
     > and guidance. This is what discourages most people.
     >
     > But we can change this around. As trader gets more involved
     > and contribute to a community, he will have more
     > encouragement to work through the learning curve. Recently,
     > I have decided to contribute daily to this forum and I have
     > noticed a significant change in my attitude towards trading.
     >
     > Trading is a business and Henry Ford once said, “a business
     > that makes nothing but money is a poor business.”
     >
     > I really like this forum because of all the great mentors
     > available here and I aim to become one myself.

I like the positivity here as opposed to the oft-seen flaming, ego, and negativity I see in trading-related forums. I definitely think we must be selective in what we accept, but I think a general belief that people are good can help the foundation.

• Post #56, Big

     > Yes, it is skewed and does not relate to the statement
     > that 99%, 95% or [insert here any anecdotal % that you
     > extract from your nether orifice here, because no one
     > that makes the statement has the figures anyway]…
     >
     > Let’s assume that we start from day 1 and we’ll use
     > 95% because, well, why not!
     >
     > Year 1: 95% newbies fail 5% succeed
     > Year 2: 95% fail 5% succeed, + the 5% that succeeded
     > last year are still hanging around because they wouldn’t
     > quit when they are profitable.
     > Year 3: 95% of newbies fail and the successful 5% of
     > newbies join the profitable dudes from year 1 and 2.
     >
     > Get it? Many of the unsuccessful traders will quit, but
     > the successful traders will stay on so the percentage of
     > profitable traders grows each year… it is cumulative!
     >
     > The “profitable” percentage in the brokers’ reports show
     > the experienced traders that have been here for years, in
     > addition to the small percentage of newbies that have been
     > profitable. It will always grow because you don’t quit if
     > you are profitable.
     >
     > Most unprofitable traders, if they do not become
     > profitable, will eventually quit so that number is more
     > likely to level out.
     >
     > I’d like to see the yearly figures of newbies after one
     > year, two years, three years, etc… because it may take
     > several years to become successful. That, and only that,
     > would test the validity of the anecdote that 95 – 99% fail.

This is a really good example of how such broker numbers can be skewed to the upside. I also remember back to Post #33 where successful traders having multiple accounts was discussed.

• Post #62, Unk

     > The percentage of traders that fail are much higher than
     > the statistics show. Of all the traders that show a positive
     > equity curve most still fail as the few pennies they
     > make won’t even beat a McD wage. If you make some rules
     > on what is actually “profitable” e.g. making a living
     > off it / competitive salary (with benefits, etc.) than the
     > field of successful traders gets much slimmer…

The Brazilian day-trading study agrees with this.

• Post #64, Pip

     > The percentages are so high because it’s calculated per
     > quarter. It’s not because “winning traders” stack up each
     > year: some winning traders quit and many losing traders
     > don’t. The chance for having a significant amount of
     > winners in a quarter is very large. The fact that these
     > numbers are so skewed toward losing is proof that of few
     > profitable traders. There’s a very big chance for any loser
     > to be profitable over one month or year. So Guy 1 loses
     > $2K in three months and Guy 2 wins $1K. Next quarter
     > Guy 1 wins $1K in three months and Guy 2 loses $2K.
     > Both are losers, yet the statistics say there’s one loser
     > and one winner in each quarter.

This seems like another interesting example to illustrate how success statistics may be biased to the upside. Losing traders will have to quit, though, if they lose too much or go bust altogether.

Brokerages certainly have an underlying motive to portray success. If the general public believes many retail traders succeed, then newbies will be more likely to try themselves. The more people trade, the more money brokerages make.

This thread has provided us with lots of good fodder for critical thinking and evaluation.

The Mixed-Up Files of SEMI Collective (Part 3)

I’ve been going through my “drafts” folder this year trying to finish partially-written blog posts and get more organized. This is another series of unfinished posts.

From October 2016, I have a post about the SEMI group concept. I also had four other incomplete drafts. I have cursorily looked over these drafts along with the actual post. The content is different.

I resurrected Part 2 here. In the longshot case that someone out there could possibly benefit from any of this, here is what I believe to be Part 3.

———————————-

Debunking common myths or evaluating supporting data involves application of critical analysis to financial claims. I have found many claims in the financial space to lack supporting evidence. Laypeople seem to think claims are justified when presented by “financial professionals.” I strongly disagree. Claims without supporting evidence may sell mutual funds and financial advisers but they will not help me trade. Failure to properly identify and avoid baseless claims will likely leave me chasing losing endeavors that will drain my capital and my spirit. We will strive to always be aware of this common pitfall.

I hope you will not misinterpret my willingness to share as a hypocritical large ego of my own. I ultimately want to hear other group members doing much/most of the talking but I am willing to do a lot of talking to get us started. I have a great deal to say from full-time trading experience. I can share my mistakes and many of the things I have investigated. I can talk about others’ ideas and teach basic fundamentals of trade vehicles and strategies. I am passionate about the importance of understanding what we don’t know and at times I tend to get loud in debunking hollow or inconsistent claims of others. I certainly may be wrong about anything at any time, and I will remind you of that. We should all feel free to confront when we perceive data (or lack thereof) to be inconsistent with the conclusions.

Think carefully about whether this group is for you because it does warrant a minimal level of commitment. Scrolling through Meetups, I see various excuses from people about why they cannot attend (e.g. something came up, work got busy, nice weather, etc.). I understand that trading is a part-time hobby for most. Life gets busy and trading sometimes falls to the back burner. As someone who worked 60+ weeks for three years to learn the craft, though, I also believe intermittent attention is no better a way to learn trading than jogging a couple miles here or there is an effective way to train for the Boston Marathon. To get good mileage out of this group, you should make it a priority.

With regard to most trading groups that collect [inactive] members, I don’t doubt these people liked the idea of learning to trade. People are drawn by the allure of generating trading profits, the allure of building a retirement nest egg, and perhaps even the allure of quitting their full-time job and being able to be their own boss. The industry paints a wonderful picture of all these things and suggests easy and straightforward ways of accomplishing these goals. I think the reality is different. You can learn to trade and you can take control of your own finances but it will require work and it will require commitment. Down the road, I believe a strong sense of achievement awaits for those who stick with it.