System Trading
Now Reading
Systematic Trading Continued. Unwrapping the onion
75

Systematic Trading Continued. Unwrapping the onion

by ScottMarch 15, 2017

One continual theme in my own trading is that every time I think I have it figured out – I get punched in the face with a unexpected problem. The tendency is to go more complicated, but often the solution is a degree of acceptance around the nature of the game. Sometimes my edges work, sometimes they don’t. Sometimes they stop working for long periods, 6 months or more. That’s actually ok for me, but it’s not ok for other people. The ultimate systems you choose have to suit your personality. If you cannot handle extended periods of working hard without making money (I can) then you have to retool your systems to avoid this.

My opinion is that the best edges are robust. Robust edges tend not to disappear, but not post objectively high results either (in SQN, Sharpe or expectancy). I’m an investor in a fund with the following returns (after fees) off a very simple and standard approach to trend following, no different to a number of other firms doing very similar things. You can see this is clearly an amazing investment, but it is lumpy, producing 108% in 2008 but a few negative years. Sharpe ratio is only .7 or so, not institutional grade for most people. But the edge is robust, demonstrably provable and the system is simple and I understand it. It is almost inconceivable that in 20 years (the timeframe I intend to keep this investment) I will be looking at an empty account saying “I wonder why trend following stopped working”. Almost certainly, if the bear dreams come true, the odds are strong that this will post a triple digit year. This, for me, is the gold standard of a robust edge.

mulvaney

My opinion is that simplicity is sophistication, and complexity is laziness.

The first thing you need to figure out, before you go any further is:

Is it an edge? – Use a scatter plot to figure that out. If you don’t want to do that then pick the classic edges which other professionals use and you won’t go too far wrong.

This is actually a special day for me on Evilspeculator. For years when I was a regular here I was telling people to get off their asses and do the damn work of finding some edges and exploiting them. Mostly my advice went unheeded but every now and again someone gives me hope, just like Bobby did when he went all out on system creation. User Francis (Mulv) has gone out of his way to provide some excellent statistics on the fakeout setup which Ivan provided us with.

What he discovered is a classic property of mean reversion systems, which segues into a classic mistake we often make in backtesting. That problem would be selection bias, where if we select any random entry and test it on a market we know has gone up, then it will probably show an edge. We can subvert this tendency to bullshit ourselves by testing random markets (and keeping the results from ourselves so we can’t trick ourselves). Professionals call this “out of sample data”. Another method is to sequester part of your available data and keep it aside, then test your data against it, to see if your hypothesis matches clean data. One thing for sure we know

Mean reversion works DRAMATICALLY BETTER in the direction of the higher timeframe trend. So if this works as a short setup, as a long setup it should be better (or something is very wrong)

Let’s dive deep and take a look at the bounty he has provided. I haven’t had the time to personally verify these statistics, but at a glance they look right. Take it for what it is, an interesting learning exercise you can apply to your own potential setups, rather than an authoritative data set. Also, there is a significant chance I’ve misinterpreted the data, since it’s not my spreadsheet I’m working with. If so, mea culpa, but the learning exercise remains.

If you want detailed instructions on how to do this click here (and read the bit about adding the regression lines). I’ll break down the results for you. Firstly Francis has tested with and without the condition of the “break of the low of the setup bar”, so we can dive deep and see how much, if at all, it changes things.

The reason we want to test firstly without the break of the low/high and then with is that so we can test everything one at a time. Maybe if the setup works with the break of the low the effect is only due to the break. That is the kind of thing we want to know.

 

fo

At this stage I’ll look at just the long setups. As expected the short side in a bull market is categorically not an edge (in fact not surprisingly shorting the emini has been a good way to get your face ripped off the last 7 years). So bottom line, we have to take all these results with a grain of salt since it is a strong market.

Firstly lets look at what the market does on the day after making a double bottom (without breaking the high). You can see this is a decent positive correlation, the points are reasonably clustered (ok R squared value). This tells us what we would probably expect, that the market is trying to go up making a double bottom. One thing that would be worth testing is buying the close and selling the following close. Or alternatively buying the old spike low on a limit and selling the following close.

foday1

Day 2, however, is showing that the first day was just a blip. Market is now negatively correlated. Not what we would want to see, but perhaps the low is being retested (that’s drawing a very long bow)

foday2

On Day 3 we have a weak positive correlation, so the market is trying to rise.

foday3

So what do we have here? We have a market with very weak tendency to rise on day 0 and day 3 after making a double bottom. This is not at all what we would expect from a strong edge, aside from day zero it’s not an edge at all.

When we move on we will consider, firstly how it behaves with the break of the lows/highs as part of the condition. Then we will consider it as a component of mean reversion, at bollingers/keltners/50 bar highs/lows. The logic for this is sensible, perhaps a reversal setup is better at an extreme.

For now we have to conclude that there is nothing inherently bullish about a double bottom in ES beyond an intraday bounce. That’s great to know, and tomorrow we will continue.

My apologies for this being slower going than I thought, and apologies for rambling a little today. I’ll pick it up again tomorrow :-)


About The Author
Scott
  • http://evilspeculator.com Sir Mole III

    Thanks for the post Scott – you’re on a roll!

  • Tomcat

    Scott, where in Australia did you go? I love Sydney.

  • http://batman-news.com RacerXX

    Thanks for the posts Scott.

    You’re gonna need a bigger gun.

  • ridingwaves

    Great stuff…candles are much more fun than charting…

  • http://www.captainboom.com/ captainboom

    rw, did you see my post re: OSIR yesterday? Got delisted from NASDAQ.

  • ridingwaves

    sorry, didn’t see it, work has been nuts..
    I did see that they were delisted, I was out at 5.50 a couple weeks ago…

    I’m looking to buy in, something very weird going on with that symbol, still owned by 90 institutions. 45 million in cash, hiring like crazy. VA and medicare contracts, 2 billion dollar sales partner companies…It reeks in hostile takeover or buyout. Looks like the accounting investigation by SEC probably not being settled led to financials not making deadline….

    the caveat for my buy in is they did release prelim statement 4 months ago, they are now liable for saying they doubled revenue to 100 million in a year in that statement, so if they release after SEC investigation is completed and it’s not 100 million, lawyers will have a field day…

  • Tomcat
  • http://www.captainboom.com/ captainboom

    I can see this is one where your knowledge of the space is useful. Hot potato for anyone else. Thanks.

  • StockTalker

    Closed the gap

  • ridingwaves

    my knowledge means little in that sector and it’s always what you don’t see that bites you…at 100 million the pps would be $12.00, low float with over half of shares owned by insiders..

  • ridingwaves

    take a look at CPRX today….it could keep running with shorts ratio at 7 days to cover.. it might not get pullback at all…

  • BobbyLow

    “. . .That problem would be selection bias, where if we select any random entry and test it on a market we know has gone up, then it will probably show an edge . . .”

    I’m a strong believer in back testing regardless of the type of systems being developed. However, what has happened to me in the past is forgetting or downplaying certain parts of my back tests that demonstrated there could be 4 or 5 losses in a row. So once my real money trading began, I used to look for positive results right out of the gate which has rarely happened. So now I have a copy of my back test results lying right beside my monitor with the possibilties and probabilities of bad shit happening highlighted. This helps me have the patience to allow my plan to do its thing.

    “The ultimate systems you choose have to suit your personality.” = ABSOLUTE TRUTH

  • http://greenlander1.blogspot.com/ Greenlander

    Thanks Scott. Love the clarity of the posts.

  • http://greenlander1.blogspot.com/ Greenlander

    Man look at everything go, gold even

  • BobbyLow

    Let me guess. Fed held pat? No raise?

  • Tomcat

    .25% as expected
    two more hikes this year

  • Darkthirty
  • Mark Shinnick

    Exited miners, near term objective met.

  • BobbyLow

    Interesting surprised that the market is taking it so well because a 1% Fed Rate is a lot o bear. :)

  • BobbyLow

    I probably going to get some NUGT and USLV in the next few minutes.

  • BobbyLow

    One of the best movies ever!

  • Mark Shinnick

    Yeah, could be a flag there so might work out.

  • Darkthirty

    You’re a funny guy

  • http://greenlander1.blogspot.com/ Greenlander

    Yeh I think they let this one out of the bag v early and ppl realize the last 2 hikes didn’t torpedo the economy. Read an interesting article on how the hikes might stoke inflation not diminish it (which was the prevailing theory prior)

  • http://greenlander1.blogspot.com/ Greenlander

    Bond up too. Interesting

  • http://gerb-reloaded.blogspot.com/ Gold_Gerb

    bonds and metals. Safety sector IMHO.

  • Tomcat

    “The FOMC hiked as expected, but the updated economic projections might be read as dovish – i.e. there was no material increase in inflation or growth expectations, and the “dots” are saying just two more rate hikes this year.”

  • http://greenlander1.blogspot.com/ Greenlander

    Looks like I missed the GLD setup I was looking for. Happy with how oil/ energy is working out though

  • Ronebadger
  • BobbyLow

    FBOW, just got filled on both and I’m soooooo glad I closed my Silver Short DSLV yesterday.

  • Mark Shinnick

    Me Too, but was heavy short this morning, worked out nice, then flipped. I’m in 1 minute modes with miners today.

  • Mark Shinnick

    Impressive 26% gains in jnug so far today. Just broke out of local ranges.

  • BobbyLow

    Good for you!

    I’m using hourly charts so my moves are a lot slower. I don’t have the stomach for real fast charts anymore. :)

  • http://gerb-reloaded.blogspot.com/ Gold_Gerb
  • http://gerb-reloaded.blogspot.com/ Gold_Gerb

    RIP in Skynard.
    😉

  • Mark Shinnick

    Its only applicable at certain times but becomes indispensable for this sort of reversal type trading.

  • Mark Shinnick

    Presently around 33% on the day with potential objective much more on the day, but statistically unlikely. Flag objective reached near the high so far.

  • BobbyLow

    LOL

  • Mark Shinnick

    Yes, today achieved a lot of gap fill.

  • Mark Shinnick

    Yes, very important print there.

  • http://gerb-reloaded.blogspot.com/ Gold_Gerb
  • Yoda

    $ is f’d

  • http://gerb-reloaded.blogspot.com/ Gold_Gerb

    a strong kickoff on the hourly!

  • http://evilspeculator.com Sir Mole III
  • http://evilspeculator.com Sir Mole III

    He lives in Brisbane.

  • http://evilspeculator.com Sir Mole III

    How’s my crew? Miss me yet? 😉

  • randomuser6789

    Sure we miss you, but it is great to hear from Scott.
    Don’t worry, he kicks our butts too.

  • Mark Shinnick

    Hope you’re getting some good R&R.

  • http://evilspeculator.com Sir Mole III

    Went on another hike today inside a volcanic crater. The air up there was the purest I’ve breathed in a year or so.

  • http://evilspeculator.com Sir Mole III

    Well, you deserve it! :-)

  • ridingwaves

    weekly CL, looks like 8-16 move below 50sma and bam…
    https://s1.postimg.org/yd3xknskv/wtic_weekly_50_love.png

  • Yoda

    Doing great thank you.

  • BobbyLow

    Very good mate.

    Sounds like you’re having a good time and still can’t wait to get back to work. That’s pretty cool actually. :)

  • ridingwaves

    love me some hiking…..spring here in california will be epic wildflower season after all this rain…will post pics…

  • Yoda

    Anybody buying the tape’s breakout? or fading it?

  • http://gerb-reloaded.blogspot.com/ Gold_Gerb
  • Scott Phillips

    My favourite thing to wake up to, a dumptruck full of correlated winners.

    Smells like a strong kickoff in Gold, odds favour this being a new attempted leg up

  • Yoda

    Yes, it was a strong take off after FOMC but the close kinda sucks with a shooting star on the 60 min. Not sure what to make of it. Let’s see what tomorrow brings about.

  • BobbyLow

    Grabbed some Silver and Miners today while still short Nat Gas. I’m allergic to Equities so I’ll leave trading them to those who can. :)

  • Scott Phillips

    We went sideways for 12 weeks. After one of the most epic battles between bulls and bears in tape history the bears win.

    You REALLY think the bulls are going to recover enough to make another play in 2 weeks?

    You really think the bears are going to take their feet of the necks of the bulls here? What does the evidence say? We are starting to rally a little, but until proven otherwise you would have to assume any rally is a counter trend bounce and therefore a shorting op.

    If those shorting ops start failing, then yes definitely go long, but right now, drawing a line on a chart and calling it support doesn’t make sense :-)

  • Yoda

    I am starting to see you point re. equities
    😉

  • Darkthirty

    C of 4 target 2345

  • ridingwaves

    as you mention often, whom knows what the bulls and bears are going to do, price is only thing that matters. my observation is the 50 weekly seems to be a catching place for the down moves…nothing more…since yesterday it has proven it’s point…

  • Yoda
  • http://greenlander1.blogspot.com/ Greenlander

    was crazy long before today and only sold a tiny bit today

  • sutluc

    A follow up to my previous comment on closing my oil short:
    If I had let my system do it’s business without me meddling it would have closed the position on open today, for a further 7% gain beyond what I made with my discretionary exit.
    Noted in my journal.

  • ZigZag

    Hey Scott,

    Love the posts especially with Mulv’s work, but I learn best by doing, so I’m playing along at home. I posted my scatter chart in the “end of the trend” post a couple of days ago but I don’t think you saw it so I’m reposting:

    Here is my scatter chart from the /TF exercise below. I went through my 2016 charts and pulled out all the examples which met my specific target of a virtual exact double bottom (within 5 or so ticks on /tf), at support, less than 60 minutes apart, and with a tick divergence from specific points. That really limited the samples as there are obviously tons of double bottom setups of slightly higher/lower prices and longer time periods. I was hoping to limit my selective bias in not “seeing” failed setups this way.

    Since the price was virtually the same (because of the double bottom) I instead used the change in the price after my tick signal bar (after it’s clear the price is going back up), compared with the change 15 minutes later (I also have 30 min, 60 min, 120 minutes, and closing price data).

    https://uploads.disquscdn.com/images/75177f6f484ef5dee5d1c02121cc96a31fd3382770e35e7c36f9979aa41b4079.png

    The idea was first to see the 15 minute correlation first, and then run the others. Since it’s a short term scalp, the idea of the 15 minutes is to have time to get an initial part of the position off at a small bounce to create a low risk trade. My numbers are based on visual exam of my daily screenshot charts, so you can see how the results are bunched around round numbers. Since I limited the double bottoms to be very close in price and time, it creates a limited number of events – these are the ones eligible for 2016.

    Is it correct that the question I’m looking to answer in this exercise is – Does the setup have a positive outcome over the signal bar?

  • Scott Phillips

    New Post!

  • Scott Phillips

    This is an edge.

    This is the very MODEL of the sort of edges we expect to see in a highly liquid financial market.

    It is a weak positive correlation, a definite edge but falling short of a “I know the future” – in other words like almost every tradeable edge.

    Because the markets have so many smart guys trading them, expect edges to be small and exploiting them to be about being nimble.

  • Scott Phillips

    I do a monthly review of discretion and work out is it a total positive or negative at the end of the month.

    For me I’m not allowed to use discretion next month if this month it didn’t add to P&L

    This is a good check on ourselves bending the rules

  • Scott Phillips

    I caution everyone in the strongest possible terms about thinking that moves stop at XYZ EMA.

    That is an illusion, we put a particular moving average on our charts and before too long we start to ascribe it mystical powers.

    We have a strong desire to find meaning in things we don’t fully understand.

    No different to the first civilisations who ascribed mystical powers to the Sun and the Moon. But today we know why and how the moon and sun move as they do. We also know why and how markets move the way they do.

    Break it down logically. Mole uses a 100 SMA and a 25 SMA. I use a 8 and 21 EMA. Al Brooks uses a 20 EMA. Linda Raschke uses a 13 EMA. Larry Connors uses a 200 SMA, so does Nick Radge. Seykota uses an 80 and 140 EMA.

    We can’t all be right, can we?

  • http://www.captainboom.com/ captainboom

    To confirm that I understand your chart, this is essentially a Price vs Price scatter plot, yes? Y axis = Price after time increment, and X axis = change in price after signal bar.

  • ZigZag

    Yes it is

  • ZigZag

    Thanks

  • sutluc

    That sounds like a good way of managing it.
    I normally do not do anything discretionary, I’m not smart enough for that.
    This was one of those fortunately rare cases where I just couldn’t resist meddling.