Education
Now Reading
Statistics Galore
63

Statistics Galore

by The MoleAugust 24, 2017

I didn’t know Jason Statham was into statistics but when I told him about my newest project he was more than willing to model for today’s featured image. After which he punched out the camera man, stole my wallet, and ran off with the make up girl. My kind of guy! Alright, obviously we’re all bored to tears here, watching markets pump sideways as investors are waiting for news to emerge out of the annual Jackson Hole symposium tomorrow. So I thought I’d spruce things up a bit by leaking a few goodies:

If you recall, the project I was referring to is related to replicating many of the quant charts that Volar used to post here back in the days (i.e. until 2012). However while he was using Excel to manually slice and dice the numbers I’m actually implementing it all in python code, and the long term goal is to be able to produce a laundry list of statistical analysis for any symbol I damn well please. For now let’s focus only on the S&P 500 which is what I’m using during implementation.

SPX.XOannual_cumulative_stats

Let’s start out with the easy stuff. Here’s the S&P500 on a percentage basis and averaged over the past 60 years (the SPX as we know it was launched on March 4th 1957). As you can see there’s a reason for the old expression ‘go away in May’ as the price action, for equity investors at least, becomes a lot more volatile after May all the way until mid October. Note how I am highlighting the current month, which of course is done automatically.

SPX.XO_monthly_change_stats

Now let’s drill a bit deeper. Here’s the SPX again averaged out on a monthly basis as a bar chart. I’ve plotted the mean % change values on top and below the bars for your convenience. As you can see, as an investor August is a good month to simply head to the beach and until you know how to short sell don’t come back until October. For the bears amongst you however September is your big month of the year, right after June?? Yes, June is actually the second most crappiest month on average. Interesting!

SPX.XO_weekly_change_stats

Here we are doing the very same thing but on a weekly basis, which I personally find most compelling as my trading horizon is usually a lot shorter. Highlighting the current week comes really handy here as I personally never know which exact week we are in. Yes, some years actually have 53 weeks, I actually didn’t know that before. Apparently next week is going to be the most bearish week of the year, so if you happen to be a bear or simply like to wear furry hats then you better show up for work!

SPX.XO_monthly_quantile_stats

As always I kept the best for last. This one took me quite a while to figure out as I had to extract each month into separate buckets and then properly plot them. Great exercise for learning python’s plot functions in more detail and it’s been great fun. What you’re looking at obviously is each month of the calendar year averaged and plotted separately. The fat dotted one in blue is of course the current month of September, which to no surprise runs sideways with a little hump during the crazy eighties. So apparently not only the music was better back in those days 😉

The current chart I’m working on takes the above monthly buckets and sorts them by four quantiles, i.e. quartiles. I’m still working on that but in case you’re curious here are the stats:

Quantile 1 (Bad):
September: -11.3
June: -2.8
February: -0.2

Quantile 2 (Moderate):
May: 0.4
August: 4.0
July: 9.0

Quantile 3 (Better):
October: 11.3
March: 13.4
January: 18.2

Quantile 4 (Best):
April: 18.9
December: 19.5
November: 19.8

So apparently June and February are second and third worst months, followed by May, August, and July which are sideways to positive. The better months are October, March, and January, no surprise there. And of course the best months are April, December, and finally November?? Yes, November actually beat the Santa Rally on average, who would have thunk?


About The Author
The Mole
Mole created Evil Speculator amidst the chaos of the financial crisis in early August of 2008. His vision for Evil Speculator is a refuge of reason, hands-on trading knowledge, and inspiration for traders of all ages and stripes. You can follow him and his nefarious schemes at various social media waterholes below.
  • Ronebadger

    “Yes, some weeks actually have 53 weeks, I actually didn’t know that before.”

    Thanks Mole, I did not know that either….

  • Mary

    So does this info produce an edge if a trader were to only trade bullish strategies from october through april and only bearish strategies from may through september? Just trying to keep it simple to avoid a lot of switching throughout the year.

  • StockTalker

    Stepped back in a bit early but on coarse. Took profit on /NQ @5824, re-shorted @ 5840. Sell order on /CL @ 48.00.

  • Mark Shinnick

    Will the majority of the market’s money and confidence be so guided? In some way it will, but it all may perversely reverse if the secular character of the stock market over the last several generations undergoes a fundamental change. We are already witness to never-before market phenomena so are placed on notice.

  • OJuice

    Jason Statham the statistician. Classic.

  • StockTalker

    Cover 5800

  • HD

    Dude you are quickly becoming one of my favorite market technicians. I’m no historian and think each bull wave has some unique characteristics so I took a quick glance at our current bull over the last 8 years August/Sept has been a short term top 7/8 times. Sorry no 2 tailed anovas or standard deviations. Just axioms of probability.

  • HD

    $SPX wave wanky. Nice clean ABC with symmetry today!

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

    This Market is full of QE hot air.
    let’s deflate this baby and get on with it.

    https://martialartsactionmovies.com/wp-content/uploads/2012/07/the-expendables-basketball-clip-30-7-10-kc.jpg

  • Mark Shinnick

    You know what I think…about waking one day to find…. It would be amazing to me that we actually get an intraday opportunity to see it begin.

  • StockTalker

    Yes, volatility

  • http://evilspeculator.com Sir Mole III

    LMAO – that’s hilarious :-)

  • http://evilspeculator.com Sir Mole III

    SNORT – sorry about that, I was rushing to get the post out.

  • http://evilspeculator.com Sir Mole III

    I’ll follow up with more stats including skew and standard deviations. Slowly getting the hang of this python charting stuff :-)

    And thanks for the compliment, I am glad you find value in my humble contributions.

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

    I actually ran into Jason a few times at my gym back on Sunset in Hollywood. Kept a pretty low profile, seems like a cool guy in real life.

  • Brishort

    Mole excellent post. Always a classic and one of the most useful recall of these stats. Thanks

  • OzarkHillBilly

    Picked up a small short position on that last little spike up. Not counting on a lot here, however.

  • Mark Shinnick

    Glad to see your watching today. If this is all for real, do you figure we should be seeing some wild throw-off-the bus type movements?

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

    ..every time you say Python…I cringe.

    Must be the rodent in me. {shudder}
    http://meredith.images.worldnow.com/images/13492222_G.jpg

  • http://evilspeculator.com Sir Mole III

    Thanks Brishort – always happy to please.

  • StockTalker

    Yes

  • StockTalker

    My favorite type of market

  • OzarkHillBilly

    Short answer: Yes.

    I was previously thinking that I would do nothing today and maybe not for awhile, but I simply saw a decent entry (through my lens) which is likely to be quickly proven wrong or right. If wrong, I’ll likely know it soon and I can bail out and probably take a shot at going long. If I’m right, it should also develop shortly and give me a chance at a quick gain, or maybe develop some breathing room to ride as a lotto ticket.

    I still tend to think that the tree will be shaken for a few days or weeks before we see a real trend. Of course that opinion could change in the blink of an eye. But I’m just trying to trade according to what I see available, and not get attached to any story I’m telling myself.

  • Darkthirty

    turd of turd or c of C

  • StockTalker

    Up to those bulls to hold the line, see if it peters.

  • Mark Shinnick

    Important spot also suggested by drv, where 11.09 is an important inflection.

  • Ronebadger

    I KNEW what you meant…but it was funny the way you wrote it 😉

  • Øyvind Nyhammer

    My guess is that over the weekend we get some bladibla about …. no inflation … no need to increase interest rates … no need to sell the junk we have in inventory …
    I have bought 2.200 TQQQ and hope to not look at them again before February.
    And yes, I can stomach the volatility.

  • Ronebadger

    that’s SOME bet!

  • Mark Shinnick

    Do you have some form of stop ?

  • Øyvind Nyhammer

    No

  • HD

    nope, just a clean ABC with symmetry :-) I leave the “counts” to the gurus.

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

    Q: leveraged ETF’s out to Feb? Isn’t that defeating the purpose?
    I was under the impression leveraged should be short term (say sub month)?

  • Mark Shinnick

    Øyvind, I bot Trump to win at 10 cents. The Trump rally has already happened….and you are betting on its continuation. I personally believe its very plausible but could never bring myself to make your kind of trade.

  • Øyvind Nyhammer

    The leakage in TQQQ has been very low, Check its history, actually in steadily upward moving markets the leakage have been “positive”.

  • Øyvind Nyhammer

    In February I will either have F’ed up, or something else, or something in between …

  • StockTalker

    Will be watching after hour play today. Stops are in

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

    …evidently, whew!

  • Mary

    Looking at Mole’s 2nd graph above, I think I’d wait until early October …. just sayin’ …

  • Darkthirty

    Looks like push-ups since the open

  • BobbyLow

    Kind of reminds me of the guy that was here for awhile and influenced by the movie ‘The Big Short”. He went all in early last year shorting the NAZ via QID. I think he said that he was also going to mortgage some real estate in order to make it a really big trade. He was convinced that the market was going to blow up. The last price that I remember him talking about was QID at $32 per share.

    A lot of us here tried to talk him out of doing this and he eventually got pissed off and left ES. Perhaps he might eventually hit paydirt but as of today, QID closed at $16.23. . .

  • Øyvind Nyhammer

    Except that i do not short, ever. Cash is my short.
    Stock markets natural trajectory is upwards.
    You short an index over time and you will always loose.

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

    Look at today’s stats – pretty much shows you where/when the money is.

  • http://evilspeculator.com Sir Mole III

    Worse yet I was at the gym and couldn’t fix it!

  • Mark Shinnick

    Yes, the stock market is a sales machine; buyers must be incentivised with appreciation to participate. Periodically, stocks go “on sale”….and sometimes for extended periods, and sometimes very sharply, usually due to prior over-extensions of appreciation. Nobody here cares to see others utterly defenceless to such a condition preventable with simple, “slow” tools.

  • Mark Shinnick

    You just nailed one big element of this risk ; the assumption that the leakage will not be dramatically affected because volatility will continue to trend downwards. So, in addition to normal underlying downside price risk you are taking on leakage risk with increasing volatility. Øyvind, there might be a simple and slow way to protect you on this one because the risk/reward is so iffy.

  • https://scottphillipstrading.com/trade-setup Scott Phillips

    Hey guys, I’m feeling much better, the big ass hole in my neck is healing nicely, and I’m gonna hit the gym lightly today. I booked a trip home to Australia in a week, I’m gonna sit my ass on the beach and relax for a bit in the nicest weather of the year (tshirt weather without being too hot).

    I had kind of an epiphany while I was in hospital. I was really sick, like literally within hours of dying, and I still managed to do my rollovers and trade my systems without making mistakes.

    But that shouldn’t be possible, according to most of the trading gurus. I’m supposed to be in this zen like state with perfect psychology, not swollen up like a balloon with my internal organs being squashed against unflushed kidney toxins, vomiting and dry reaching every few minutes.

    What I realised is that most of the trading psychology problems I have are really just trading problems. What I mean is that my mistake rate a few years ago was way higher than my mistake rate is now. What changed? It wasn’t me that’s for sure, I’m just doing the same thing, but with more streamlined procedures.

    I put a lot of effort into automating as much of the process as I could in google docs spreadsheets, and getting a comfortable routine, that I can do with my eyes closed.

    My current routine is this: I wake up 20 mins before the futures market opens (5:40 ET) and check equity for the day, and log it.

    I check the setups and orders I had active yesterday to see what filled. I add those fills to my spreadsheet before I go any further. If a trade is open I colour it yellow on my spreadsheet, if it never got a fill it becomes green. If it’s a system I’m not trading or which has switched itself off it colours purple.

    I check the markets in the following order
    – Index futures, crude and NG
    – Bond futures
    – Beans and grains
    – Metals (GC SI PL PA HG)
    – Currency majors (I do them last because they are the most complicated)

    Every time I find a setup I enter the high and low of the bar in my sheet, and the sheet spits out the order to place. When I have been through all the markets I go to a new workspace and place my new orders.

    Once that is done I go through my open positions one at a time to make sure stops and targets are correct.

    Then I stop. I switch the market data off. It doesn’t help to watch it, the stock doesn’t know I own it.

    The takeaway. Good trading is BORING. Just do your thing, wake up and do it again tomorrow :-)

  • https://scottphillipstrading.com/trade-setup Scott Phillips

    Yes ^^^

  • Brishort

    Love it! Printing it for my ES wall of Fame!!

  • Mark Shinnick

    The “perfect psychology” sounds like this no-confusion organization.

  • Blind_Squirrel

    Absolutely Fantastic Thread Mole!!!!!!
    Chock full of Great Stuff!!!!
    Some Rammstein Moskau Gazzelles 4 Ya……Bunga Bunga

  • http://evilspeculator.com Sir Mole III

    It’s about time those mofos come out with a new album.

  • http://evilspeculator.com Sir Mole III

    Interview – talks about the new album they are working on:

    https://www.youtube.com/watch?v=rxe_ae6-N4U

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

    Cool :-)

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

    Looks interesting. I’d have to dust off some old textbooks:

    Prerequisites

    College-level calculus (single-variable & multivariable). Comfort with mathematical reasoning, familiarity with sequences, limits, infinite series, the chain rule, and ordinary or multiple integrals.

  • Mary

    several Python courses listed under computer science … the site is a gold mine along with khanacademy.org …

  • OzarkHillBilly

    I’m glad you’re feeling better! We’ve all been trying to send good vibes your way. Thanks for the insight. Many years I ago I also had to spend a few weeks in a hospital, and if nothing else, it gave me time to do lots of thinking.

  • StockTalker

    Whipsaw alley