IBD “Distribution Days” backtesting

So I have been going to the Investor Business Daily meetup in OKC. for the last few months. We usually have about 5 people in attendance and we talk stocks for a couple hours. The host, Raylon Rogers, reads a chapter from an IBD book and then we look at the charts to get our investment ideas.  This last week he talked about “Redemption Days”.  This is an IBD term to look for selling with volume.  IBD is pretty much all a technical analysis method (I perfer fundamentals).  If at the end of one trading day the price action was a lower close and the volume rose from yesterday than this is a distribution day.  Their sell signal is 5 distribution days out of the last 15 trading days.

How often should a redemption day occur?  If it is all truly random, you would expect 3.75 distribution days over any rolling 15 day period (volume can either go up or down, price can either go up or down — therefore a .25 probability that both price moves down and volume moves up on any given day).


So I decided to backtest.  I wrote a script in PERL and am hosting it on github if you would like to download and try yourself. It uses data from alphavantage.co API to get daily stock data.

What I follow, and what we talked about in class was the NASDAQ index.  Using the tool there have been a total of 4,484 trading days since Jan 1, 2000  (where the alphavantage data stops– I would really like to test this for 1997-1999, since I think that will be the best model for how this particular bull market ends).    Of those 4,484 days I can use 4,408 of them for backtesting — I can’t use Jan 1-15, 2000 (since I can’t compute the redemption days between Dec 15-31, 1999), and I can’t use anything after July 26th, 2017 (as I can’t compute the 90 day return after that date (yet)). I use 90 days because that gets a single earning release cycle and I think that is a good number to judge — oh yeah, the market tanked, and you can tell over the last 90 days.

So we are analyzing about ~4,400 days.  In that period for the NASDAQ there were 932 times we had 5 or more redemption days out of the last 15 trading days.   Of those 932 times, 90 days later the index was down 355 times (38%).

OK, seems decent. If I have a formula to keep me protected 38% of the time that might be worth something.  Is it? Let’s see the number of days out of those 4,400 when the return was negative 90 days out:  we get 1,609  (36%).  So in that light 38% is not statistically significant. I can simply use a rule that says always stay out of the market and I will avoid having negative 90 days returns 36% of the time.  Seems about as good as saying stay out when you have 5 redemption days over the last 15 and you will avoid negative returns 38% of the time.

OK, what about total return if you follow redemption day theory? Average return 90 days out from our 932 days of 5/15 redemption days is 1.89%.   This compares to an average return 90 days out from all 4,404 analyzed days of 1.25%    So what this is saying is you are worse than the market (note both returns are positive).  You would be better off buying on 5/15 redemption days.


So how about trying 6 or more redemption days out of 15 instead of just 5/15:

times with 6+ redemption days = 320 
times with 7+ redemption days = 106
times with 8+ redemption days = 14

8 is the most, no time since 2000 has there been 9 or more redemption days out of 15 in the IXIC (Nasdaq).  So analyze those 14 times with 8/15 redemption days. Average 90 day return is highly positive +7.17%: Here are the 14 times it happened and the 90 day forward return:

2000-04-18 = 7.9%
2001-09-24 = 30.8%
2001-09-25 = 31.6%
2004-03-15  = 2.3%
2009-11-06  = 3.1%
2010-06-03  = -3.0%
2010-06-04 = -0.5%
2012-04-18 = -3.5%
2012-04-23 = -3.9%
2012-07-27  = 0.6%
2016-01-22 = 6.5%
2016-01-25 = 7.6%
2016-05-05  = 10.5%
2016-05-06  = 10.3%

Of interest, not only is the 90 day return super positive, you are only saved from -3% moves down three times, and two times you miss 90 day moves of 30%. I definitely want the other side of this trade.  Also, following this theory you are not protected against the 2008 financial crisis or the 2000 dot com bubble.

So, safe to say this theory is totally busted as it relates to the NASDAQ index. How about individual stocks?  Let’s try a few:

distribution days = 960 days (21%)
  average 90 day return = +1.72% 
total days = totals 4,408 days
  average 90 day return = +1.02%
distribution days = 849 days (19%)
  average 90 day return = +1.56% 
total days = totals 4,408 days
  average 90 day return = -0.12%
distribution days = 766 days (17%)
  average 90 day return = +6.7% 
total days = totals 4,408 days
  average 90 day return = +7.08%

note – dividends are considered here for TGT and CSCO, we are using alphavantage.co TIME_SERIES_DAILY_ADJUSTED, not TIME_SERIES_DAILY.

Again, this distribution day theory is busted.  In fact, you want the other side of this trade, if anything (buy after a series of distribution days, don’t sell).


Want me to try it for your stock?  Let me know what symbol in the comments and I’ll post the results here.




College Football thoughts on the eve of the 1st rankings

playoffpredictor.com has as the computer top 4:

Screen Shot 2017-10-29 at 8.29.41 AM

Which really makes sense, if you think about it.  Georgia has a super-quality win over ND. Bama’s best win is over #38 Texas A&M.   Wisconsin looks solid and Penn State’s one loss (1 point on the road) is a much better loss than tOSUs (15 points at home) or OUs (7 points at home).

I am expecting the committee to come out with:

  • Bama #1
  • Georgia #2
  • Wisconsin #3
  • Ohio State or ND  #4

Right now there are 2 other unbeatens – UCF and Miami.   Miami and Notre Dame play each other on Nov 11.  What I am really interested to see is how the committee treats UCF.  My computer has them at #5 – they have some very good wins — in fact, their best win is much better than Bama or Wisconsin’s best win.   However, I suspect the committee will put them at about #20 in the initial poll. The way this season is shaking out UCF could be the only unbeaten in college football.  I will really like to see if a rematch with Memphis and them winning the AAC would be enough to get a mid-major in.





Cisco Live! 2017 Las Vegas

I am fortunate enough this year to get a ticket out to Cisco Live (thanks James and David)! Here are my summary impressions of day 1 of the event

The new leaders of American Tech

Opening Keynote — Chuck took the stage and had 2 guest speakers: Tim Cook of Apple and the CEO of UnitedHealth. Chuck used the word “security” much more than I have heard at keynotes in the past.  You can totally get his head is that IoT will add ~10-20 billion new network connections in the next few years, and without security it will not happen.  So a lot of the keynote was around IoT and security.

I like the Cisco messaging and the thought process is solid. However, it is different watching Chuck vs John Chambers — John had an energy to work the crowd and walk through the crowd with piercing eye contact that just draws you in.  It will take some getting used to to understand American Tech 2.0 is Tim Cook and Chuck Robbins, not Steve Jobs and John Chambers.

New Catalyst 9400 -> the next gen Catalyst 4500

At the world of solutions I gravitated to the new Catalyst 9300 and Catalyst 9400 switching line, as that is what I am going to be presenting to my clients in the next few weeks.   From a hardware point of view, the sexiest, coolest thing was the removable fan tray in the new Cat 9400.  Designed by the people that design Ferraris, the tray goes all the way from the front of the chassis to the back, so you can remove it from either side.  I realize how lame that sounds, and it is. But the reality is that is as sexy and new in hardware thinking goes. Such is the life of hardware (and you suddenly understand why Cisco is going so hard to a software company).

how actually Cisco is identifying malware in encrypted traffic without decryption

The new part of the cat 9300 / 9400 is DNA Center, a plug in into APIC-EM.  One of the highlights is finding malware threats in encrypted traffic. How is that done?  Well, DNA Center requires ISE and Lancope Stealthwatch.  The cat 9300/9400 sends netflow to stealthwatch and it specifically looks for the metadata of the Initial Data Packet (IDP) and Sequence of Packet Lengths and Arrival Times (SPLT).  The guys in the booth tell me that’s all you need to understand if the traffic is malware.  They tell me they have this down to something like 99.95% accuracy. Uh-huh. We’ll see how this plays out.


Security Vendors

Think we have enough products?  Check out how many security vendors exist in the marketplace today.


My Shake Shack dinner

I got my Shake Shack dinner!  I was looking forward to this all week. Good, but $18 bucks for a burger, fries and a shake! Wow!   I have no idea how the federal reserve measures inflation, but I can tell you they are quite wrong.


I saw one really good vendor at the World of Solutions — Kentik.  This is something one of my customers use.  It processes netflow data.  What I love is the visitations. I’m doing a 30 day trial.  I totally see my customers sending netflow to Kentik and Lancope.



Summer 2017 movie predictions

Rules: winner is determined by correctness of their list against boxofficemojo.com

Season is summer 2017 (memorial day to Labor Day) – winner to be announced on Labor Day

10 points for getting a movie in the correct slot. 9 points for being 1 off, etc. max possible points = 10×10= 100

Austin’s Prediction

1. Despicable Me 3

2. Cars 3

3. Guardians of the Galaxy Vol. 2

4. Baywatch

5. Spider-Man Homecoming

6. Pirates of the Caribbean

7. Wonder Woman

8. The Dark Tower

9. War for the Planet of the Apes

10. Transformers: The Last Knight

Matthew’s Prediction

1. Despicable Me 3

2. Guardians of the galaxy vol 2

3. Cars 3 

4. Spider-Man Homecoming 

5. Transformers: The Last Knight

6. Wonder Woman 

7. Pirates of the Caribbean 

8. War for the Planet of the Apes

9. Baywatch 

10. Dunkirk

Neville’s Prediction

1. Guardians of the Galaxy 2

2. Pirates of the Caribbean 

3. Cars 3

4. Transformers: The Last Knight

5. Spider-Man Homecoming

6. Captain Underpants

7. Diary of a Wimpy Kid

8. All Eyes on Me

9. Alien: Covenant

10. Wonder Woman 

Calculate implied move in a stock from earnings based on options prices

Have you ever listened to CNBC on a marquee company earnings day and heard something along the lines of “options are pricing in a 4% move in this stock post-earning, either up or down”  and wondered how that was calculated?  Here is how I do it:

Yesterday (5-2-2017) Apple (AAPL) reported Q1 earnings of $2.10 per share.  It was one of those scenarios where earnings beat expectation, but guidance was weak, so the stock opened the next day down 1.49%.  How close did that 1.49% on Wednesday match what the options market told you on Tuesday?

First, start with the shortest term option available.  Options always expire on a Friday, so for AAPL you need to look at the options that expire on 5-5-2017. Prior to close on Tuesday AAPL was trading at $147.63 per share.  Look at at-the-money calls and puts – so look at the $148 call. That option was trading on 5-2 at $2.41

Screen Shot 2017-05-02 at 2.29.25 PM


So that means a bullish speculator (3 day options is definitely speculation, not investing!) believes AAPL will get to at least $150.41 by Friday.  There are only two things at play between Tuesday and Friday — 1 is the earnings call (obviously) and 2 is the overall market volatility on Wednesday through Friday.  So a speculator believes those 2 forces will equal a total move of 1.88% (the difference between 150.41 and 147.63).

Now look at the way the options were trading on Wednesday morning.  With the stock now at $145.31 a call for $146 on Friday expiration was trading at $0.80.  Again this implies a break even price of $146.80, or a 1.02% move.  The only thing from Wednesday to Friday is normal overall market volatility, so this tells you that Wed-Fri market vol accounts for 1.02%.

Doing the math on the only other force at play (earning announcement) means that the earnings announcement was 1.88% – 1.02% = 0.86%


Let’s do it now for the downside using at-the-money puts.  The Tuesday $147 put cost $2.27 implying a break even price of $144.73 or a move down of 1.96%.

On Wednesday the $145 put cost $1.34 implying break even at $143.66 or a move down of 0.92% between Wednesday and Friday.

Screen Shot 2017-05-03 at 8.30.50 AM

Doing the math, 1.96%-0.92% = 1.04%

So the options told you to expect a 0.86% move up or a 1.04% move down in AAPL post-earnings.


So really the options did an okay job of predicting the move.  The predicted downside move was 1.04% and the actual was 1.49%.  Kinda close, but not spot on.









Solved! iRedMail sending mail from an iPhone client

I have run my own mail server out of my attic for the last 10 years.  I guess it’s just what you do when your a techie in my career field.   So last year I decided to make the switch from exchange 2003 (yikes!) to iRedMail.  Most of it was going fine for a long time, but there was always this peskiness with my iphone client not sending mail correctly. I had to go to the web portal (roundcube) to send.  Well, today I decided I really wanted to figure out why I could never send mail from my iPhone client.  I was sending on tcp 587 – no luck – kept getting a generic error message, something like “mail could not be delivered at this time, try again”

So I decided to get serious. I did packet captures from my wireless LAN controller and noticed that every packet my client sent was met by an ICMP port unreachable from the mail server.  So I checked iptables — at first I thought iptables was clear:

ACCEPT   tcp  – –   anywhere  tcp dpt:submission

but then I noticed further down in the chain fail2ban-default:

BLOCK <my iPhone IP>

Somehow the login process results in too many failures (even with the right password).   Whitelisted my home address block in /etc/fail2ban/jail.conf

ignoreip – <added my ip block here /16  (yes I have a big home network ;)>

And voila – mail is now sending from my iphone.


Hey — if you take the time to read this I’ll set you up with a free mailbox for liking the link! Send me a note @CiscoNeville


Neville’s vote, 2016

I have made up my mind who I am supporting this year for President.  I put my thoughts in this blog post form for my son Austin, who will be 18 this November and cast his first ever vote.  I think he should know who his dad is supporting, and more importantly why I am supporting my candidate. I think it is important for me to demonstrate that I have values, articulate what those values are, and then give a chance for those values to be passed on to the next generation.


Do you know the guy in the middle?

First off Austin, please remember to register to vote. Don’t wind up like Ivanka Trump. She gave a great speech last night, but she failed to register to vote in the New York republican primaries, and therefore never cast a ballot for her own dad. Remember son, actions speak louder than words. Here is a link to the Cleveland county voter registration website,  you have to mail this off mid-September. Details in the link.

I am a fiscal conservative and a social moderate-to-conservative. I believe less government is good government.  I believe less is better when it comes to taxes – not just federal, but state and local as well. Heck, if I could have my way I’d repeal the 16th amendment to the US Constitution.  Government should simply provide a fair playing field for businesses and then get out of the way. Let business owners and individuals take risks in a free-market capitalism society. The notion of government picking winners and losers in life makes me sick.  Individuals who take risks and find success should be richly rewarded. Individuals who take risks and fail should not be made whole via the taxpayer.  Yes, some basic safety nets should exist, but let’s not try and legislate everyone into wealth without working for or earning that wealth in any way.

Like Donald Trump impressed on his kids, I like to think big. The above paragraph should give you insight into what’s important for me this election cycle. Starting at the top we need to have a vision for what this country should be like long term (at least a generation out).



So when you think in a strategic manner, what should be the top issues we should be discussing this political season?

One strategic issue that immediately comes to mind is our national debt and the long-term soundness of our economy and US dollar. Right now we have a federal debt that is in excess of 100% of GDP. I realize most people reading this are not policy wonks, so that statement is hard to relate to. Let me offer a layman’s translation – that’s bad. We are deep in debt – $19.3T based on usdebtclock.org. The real problem is not what we have spent in the past, but what we will spend over the next 30 years. Social Security, Medicare and our defense outlays are structurally unsound and need to be reformed. Let me take you to the part of Donald Trump’s RNC speech last night where he talked about entitlement reform and balanced budgets.

Oh wait, Trump never mentioned the subject. Not once.

In general I have a problem with Trump’s positions. He is protectionist, not a free trader. He wants to repeal NAFTA. I do believe free trade is good for all economies involved. Protectionist people typically find themselves destroying the market they claim to protect, and find there are no sellers at any price when they do their damage. Let’s take an Oreo example. Last year Nabisco stopped making Oreos in Chicago and moved production to Mexico. Donald Trump has been railing against that move and tell Chris Christie not to eat any more Oreos. Is Nabisco moving production to Mexico a problem? If you owned Nabisco and you could get better a better product at a better price you too would move to Mexico. It’s just good sense. As a consumer if you don’t like it then don’t buy Oreos. However, government stepping in and vowing to get back at Nabisco is exactly what I’m talking about when I say Government is now (but should not be) picking winners and losers. Government is just too powerful these days. They can sue you, lock you up, impose taxes on you and generally harass you. I can’t stand for that.

Same goes for tax inversions with multinational drug companies. If an American business can get a competitive advantage by incorporating in Ireland — let them! The alternative is that the American companies go to extinction because they get outsold by a better foreign competitor.

Trump disagrees with me on those points. He believes American companies have some patriotic duty to use American workers and pay American taxes. Hogwash. Capitalism is intended to be self serving. The beauty of capitalism is that in serving your own financial interest, you add value in the marketplace and enhance the interests of greater society. Last I checked this was still a capitalist country (Socialist Bernie didn’t win, did he?).

If you don’t believe me then immediately start doing all your shopping at made-in-america-mart. You know, that large Wal-mart looking place where every product is manufactured in the US. Obviously such a place does not exist. Capitalism dictates that it does not exist. As consumers we want the best products at the best prices and if you stroll the aisles of Wal-Mart those products come from all over — plastic and electronics from China, clothing from Bangladesh and Vietnam.

We all can chant USA-USA, but look at our actions. We simply demand the best. We don’t shop at made-in-america-mart. If we did we would pay $200 for a plastic chair instead of $20. If this was a nationalist, socialist society we may one day be forced to do that, and our standard of living will go down significantly. But that day is not here yet and we don’t have to be told where to shop. Own a foreign made car? Well, you must be un-American. I don’t subscribe to that line of thinking.

One quick way to spur this economy is a tax holiday for the repatriation of corporate foreign cash held overseas. Look at my employer, Cisco Systems. We have $50B sitting in cash, overseas. If our management would like to use this and build a factory in the US, or hire some program manager jobs to roll out a new technology for the Internet of Things — whoops — Uncle Sam will take $25B of that $50B. If you were the Cisco CEO you would not pay that extortion fee, instead you’d also open up that new plant in Mexico or China. Sad but true. How about a one-time tax holiday and bring that cash back home? Totally political, totally doable.

And how many times did Trump mention cash repatriation last night? You guessed it, zero.

To Trump’s credit his website does say he is for a tax holiday for repatriation, but I need to hear it from him directly.

How is Hillary on these economic issues? Worse. She is not for any kind of reduction of taxes on foreign earned cash. I have not seen her talk about entitlement reform. She is also of the mindset, just like Donald, that government is the solution to our problems. Coal? Ban it. Heck, I would not be surprised if she banned fracking – it’s not a big deal, just American energy independence. I am no coal or fracking fan but again she demonstrates someone who wants to pick the winners and losers for us. I don’t trust her.

There is a 3rd choice this year. It is the libertarian party with a former governors of New Mexico and Massachusetts. The libertarians line up with my thinking. They may be a little more socially moderate than I am ok with, but that’s ok.

I really think if most Americans will stop and think for themselves, they will realize they have more in common with Libertarians than they do with Republicans or Democrats. What is a Libertarian? Look to Wikipedia: Libertarianism (Latin: liber, “free”) is a political philosophy that upholds liberty as its principal objective. Libertarians seek to maximize autonomy and freedom of choice, emphasizing political freedom, voluntary association, and the primacy of individual judgment.

On all the issues I am much closer to Johnson/Weld than either of the other 2 tickets. He is for term limits. For a massive overhaul of the tax code, for cutting defense and entitlements to what we can pay for. This snapshot gives a good view. By in large I agree with all the sentiments outlined below



Many in the Republican party will tell you that we are locked into this two party system and a vote for Johnson is a vote for Clinton. Hogwash. I am not moved by your fear. A vote for Johnson is a vote for Johnson. A vote for Clinton is a vote for Clinton. Don’t let anyone tell you different. Nowhere in the constitution does it say the word “Republican” or “Democrat”. And it’s time to take our country back from that corrupt, rigged 2 party system full of blood sucking insects.

Notice I did this whole post on issues, not personalities. There is so much concentration and emotion around the personalities of Trump and Clinton that there is no mention of the issues. While personalities are important, I like to think I am giving my vote to the person that best represents my issues, regardless of race or gender.

I’m voting for Gary Johnson.