Skip to content

A “Simple” Tactical Asset Allocation Portfolio with Percentile Channels (for Dummies)

February 8, 2015

For Dummies

I actually received a large volume of what could best be chararcterized as “hate mail” for one of the previous posts on percentile channels. In reading these comments I was reminded of Jimmy Kimmel’s funny segments where celebrities read mean tweets about themselves. While I did not publish these comments (I do not wish to alienate or prohibit those people who are kind enough to comment on the blog), needless to say most of them implied that I had presented a fraudulent strategy that badly misrepresented true performance. Since exact details were not provided on the strategy this is a difficult claim to justify. As a mountain of such comments piled in, I decided that it would be useful at this time to clarify how the allocations were calculated. The initial strategy was developed using a pre-built testing platform in VBA, so presenting the details for how the strategy calculates positions is easier than taking the time to build it in a spreadsheet.

It is rare that I present a formal strategy on this blog for several good reasons: 1) this is a blog for new ideas to inspire new strategies not for sharing code or spoon-feeding people with recipes 2) people actually pay money for strategies in the quantitative investment business, and giving one away for free seems like a pretty good deal. Who ever complains about free food? Hint: No one. 3) whenever I post strategies or indicators I get flooded with demands for spreadsheets and code. The tone of such emails is often terse or even desperate and implies that I have some sort of obligation to assist readers with replication or implementation on their end. Since the blog is free and competes for my often limited time while engaging in unrelated but paid business activities, meeting such demands is difficult to justify. I would comment that even the authors of academic articles to reputable journals rarely provide either: a) easy instructions for replication–in fact it is notoriously difficult to replicate most studies since either the instructions are vague or details are missing or b) assistance/support— authors rarely if ever provide assistance with replication and rarely answer such requests, even when their articles are supposed to contribute to some body of research (unlike a blog). I would like to think that CSSA has been considerably more generous over the years.

As a former professor of mine used to say: “I think you are responsible for doing your own homework and using your own brain”– perhaps a novel concept to those who simply wish to coast of the hard work and individual thinking of others. So without turning this into a prolonged rant, here is a “simple” (I will refrain from using that word in the future after the latest experience) schematic of how allocations are calculated for the strategy:

A couple key details first- the strategy was rebalanced monthly (allocations calculated and held through the month) and not daily. Also, the strategy is LONG ONLY. This means that any negative positions are ignored. The channel score or signals in the initial calculation can be long or short ie 1 or -1. This is probably the key reason why readers were unable to replicate since they probably used 1 or 0.

tactical for dummies

Notice that negative positions are used to calculate allocations but are ignored in the final calculations. Furthermore, the cash position is allocated as an excess to the total of active allocations and not included in the risk parity position sizing (which would make SHY a huge position due to its low volatility). So I hope that this helps reader’s implement/duplicate the strategy. Keep in mind that prior to 2006, some of the ETFs used had to be extended with other data which reader’s may not have access to. However, using ETF data only yields a sharpe ratio of about 1.5. Beyond this- readers are on their own. Good Luck!

30 Comments leave one →
  1. February 8, 2015 10:54 pm


    I myself, in addition to a request from John, have received multiple requests to replicate this and will hop onto it when I finish my current blog post on changepoint detection, so thanks for that. However, when you write 1 and -1, I see three possible outcomes:

    1) Price > 75th percentile
    2) Price 25th percentile
    3) Price < 25th percentile

    Does the -1 in this instance only denote price < 25th percentile, or price < 75th percentile? AKA how would you denote #2? 0 or -1?

    That said…to all the readers who have the gall to say the results are "fraudulent":

    REPLICATION IS HARD. Even with the stuff that you may call "simple crap". EG, I cannot come close to the results presented in the Flexible Asset Allocation paper (even if the results I got as a result of my implementation are still very solid), and I had to go back and forth for days with Wouter Keller on his new Elastic Asset Allocation paper to match his results to the letter.

    In short, just because someone with a spreadsheet can't replicate the results at first sniff, that doesn't mean they're fraudulent–it means that some details are lost in communication–and god knows that all the authors of those math-heavy papers make it ridiculously easy for that to happen. Failure to replicate to the letter does NOT imply fraudulence from the author.

    • david varadi permalink*
      February 9, 2015 12:27 am

      hi Ilya, thank you. i agree replication is hard. however, my instructions were far from detailed to be fair. in terms of your question- a buy signal is initiated when the price exceeds the 75th percentile (1) and turns into a sell (-1) when the price falls below the 25th and vice versa. This is like most hysteresis strategies that buy above a band and hold through until below a lower band. The analogy from a channel standpoint would be to buy at new highs and reverse position to sell/short at new lows. If the price is at the 25th having been in a buy position, then nothing would happen to reverse that buy until it moved below the 25th percentile.


      • February 9, 2015 1:38 am

        Hm, I suppose my question is this: you have a position on a security, and at the next rebalancing period, you have two sell signals, and two “do nothing” signals–EG 180 and 252 say “hold” and 60 and 120 say “sell”. What should happen then?

  2. February 8, 2015 11:40 pm

    Thanks for the followup post.

    I think it is just inevitable that a blog like yours will generate questions, but I don’t think you should dwell on the “demands” too much.

    I implemented this based on your previous description, and while I got decent results, I completely misinterpreted when/how you went to cash now that I see you explicitly spell it out. I wanted something to try quantopian with, and this was an easy system to implement, but something that didn’t already have 50 implementations done, so I’d have to learn their setup a little.

    Thanks for sharing what you write, it’s great to hear ideas, and if we don’t then take that idea to the same place you did, that’s ok too IMHO.


    • david varadi permalink*
      February 12, 2015 12:19 am

      hi qanonq, thank you– i am not too worried about it, just thought i would express what many bloggers have experienced (and probably wanted to say but didn’t want to say it). Good luck with your implementation. Hopefully you take the ideas to an even better place.

  3. Mohamed permalink
    February 9, 2015 3:20 am

    I never left a comment in here but have to now. Throughout the years, I took valuable ideas from this blog and used them to make real money. Unfortunately never had the opportunity to acknowledge it through any kind of retribution (donation, pay for it, etc.), so if we liken the work presented here to fraud/misrepresentation then I love fraud.
    This blog has been quite generous with idea generation and it’s really a great forum to stimulate new ways of thinking about investing/trading.
    I just wonder why some people need to be mean..


    • david varadi permalink*
      February 12, 2015 12:21 am

      hi Mohamed, thank you much appreciated. Glad to hear that they have been of value. Lots of different types of people i suppose.

  4. February 9, 2015 3:02 pm

    Hello David,

    I regularly read your blog and enjoy your posts very much, although I must admit I don’t leave comments often enough.

    I was rather upset as I read your note regarding the not-so-kind people who complain about your excellent posts. This is very unfortunate. I hope such behavior from ungrateful individuals won’t affect your desire to keep blogging in the future. I can only hope there are just a few of them and hopefully they will grow up and learn to appreciate your excellent work in the future.

    More importantly however, allow me to congratulate you for doing an excellent blog full of thought provoking ideas. This is nothing short of inspiring from my perspective. I have and continue to learn much from your ideas, and I very much appreciate the opportunity to read about them.

    Thank you again, and please keep up the excellent blogging!



    • david varadi permalink*
      February 12, 2015 12:24 am

      Thanks Jean-Marc, please feel free to comment whenever you like- the last thing I wanted was to discourage comments (just the unnecessarily negative kind- I don’t mind being challenged). I don’t think that this will discourage blogging at all, but it may discourage me from sharing too many strategies. Glad to hear that you are inspired by the blog..that is what I hope for.

  5. Javier permalink
    February 10, 2015 5:47 am

    Hi David

    first of all, sorry for asking you to disclose your code. I recently discovered your blog and I thought it was related with “(R) code development” instead of “ideas/ATS development”……that’s why I asked you to share the snippet/code….my apologies.

    As a fair trade, because we forced you to disclose too many details of your strategy, I would be happy to share (privatly/public I don’t mind) my R implementation of your idea.


    • Adam permalink
      February 10, 2015 3:01 pm

      I would be interested in seeing your R implementation.
      Thanks for the blog and your ideas. Don’t mind the haters. There are negative people everywhere but it is more a reflection of their problems.


      • david varadi permalink*
        February 12, 2015 12:25 am

        Hi Adam, thank you- I couldn’t agree with your insight more.

    • February 10, 2015 8:48 pm

      Javier, where do you share your results normally? Do you have a blog somewhere? Feel free to post the code–I don’t want to tread in the same spot twice.

      • Javier permalink
        February 11, 2015 2:21 am


        here you are:

        I don’t have a blog……

        I didn’t get David’s results btw. I’m playing with his idea, and trying to optimize the strategy when there is a big pullback(turnaround): when all channel indicator are -1 (or +1), and then, the 60-channel signals a pullback/turnaround, the asset scores is (+1, -1, -1, -1)….should we wait until (+1, +1, +1, -1) in order to going long again?
        In my implementation, I go long (or I start closing positions) as soon as any n-channel signals it.

        This is fun!! 🙂


    • david varadi permalink*
      February 12, 2015 12:25 am

      Thanks Javier for sharing–that helps a lot. Much appreciated.

  6. Christian permalink
    February 12, 2015 2:45 am

    Hi David

    For me it is still really weird, that people react on free work and ideas as you described it. It seems to be part of our culture today. Although I understand that these reactions are a simple function of the crocodile brain, I am getting always very angry, if people are enormously discrediting other peoples free offered ideas and work. They could probably think a bit more about what they are offering to the rest of the world instead of what they are getting from guys like you!!!!!

    I never commented your very inspiring work before, but this time I felt, I have to.
    Very much hope, you ignore the “nonreflective monkey claimers” and just go on as you generously did in the past.

    Thanks a lot
    All the best

    • david varadi permalink*
      February 16, 2015 11:35 pm

      thanks Christian, I know that a lot of things are free today so perhaps you are right about a shift in cultural attitudes. I appreciate your kind words- i certainly plan to ignore the NFCs (nonreflective monkey claimers) , it is nice to have your support.

  7. Tonio permalink
    February 12, 2015 7:17 am

    Hi David, and congratulations for your inspiring blog. Always sad to see that people can be so stupid… Keep it up!

    I am at a loss when it comes to computing the percentile. Does your Excel formula happen to be like: Percentile = 1 – (High – Price) / (High – Low) ?


    • Adam permalink
      February 12, 2015 5:40 pm


      • Tonio permalink
        February 15, 2015 6:28 pm

        Thanks Adam. I did not know this Excel function existed.

    • david varadi permalink*
      February 16, 2015 11:36 pm

      thanks Tonio, i appreciate that. in retrospect the whole episode is kind of amusing. Thanks also to Adam for posting the formula.


  8. Hartmut Ott permalink
    February 27, 2015 9:06 am

    Thank you David for proposing this strategy and sharing with everybody. Great work !! I like also the R implementation that was posted and I tried to replicate the results in R-Studio. Got a couple of questions related to the strategy.

    It seems to me, that you are saying the strategy can provide somewhat higher returns while reducing the overall volatility (draw-down and std dev) dramatically. Have you tried this on different time periods other than 1995-2015 ? I realize that the data might not be available, but it would definitely be interesting to see. The major equity downturns from 2000-2003 and 2007-2009 did not happen suddenly and the proposed monthly re-balancing would always have had enough time to get out. This would NOT have been the case for the 1987 crash though. Also, have you considered transaction costs and taxes in the strategy? The transaction costs are probably negligible. However, taxes could be a very important factor. As you know, buy and hold over time benefits from tax-free compounding (while only being taxed at the exit). Furthermore, capital gain rates (buy and hold) are currently lower than income tax (re-balancing).

    It would be great, if the above mentioned factors could be built into the model.

    Thanks again for the thought-provoking article.

  9. Adnan Salih permalink
    March 31, 2015 10:55 am

    Hi David. Thank you for this truly inspirational blog. What happens when I buy shares at the beginning of the month and then at the middle of the month prices drop below 25 percentile. Also which 25 percentile (60-120-180-252) is used for sell/liquidate decision? Thanks a lot.

    • Kevin permalink
      April 29, 2015 7:13 pm

      Adnan, this is a monthly model, so what happens intramonth is irrelevant.

  10. Larry permalink
    May 5, 2017 9:03 am

    Can anyone explain how percentile channels differ from Williams %R or a “raw”(unsmoothed) stochastic? All of them seem to identify where the most recent close falls within a given range of closes. Or am I misunderstanding?


  1. The Whole Street’s Daily Wrap for 2/8/2015 | The Whole Street
  2. Percentile Channel Strategy Replication | CSSA
  3. An Attempt At Replicating David Varadi’s Percentile Channels Strategy | QuantStrat TradeR
  4. Conditional Percentile Channels | CSSA
  5. A Closer Update To David Varadi’s Percentile Channels Strategy | QuantStrat TradeR

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: