Skip to content

Runs Oscillator

July 26, 2010

Here is the “runs oscillator” mentioned in the adaptive time machine sequel. This is something we will be looking at towards creating an improved time machine algorithm. The “runs oscillator” is constructed by ranking a down run (if that is the current run) versus all down runs in the prior 252 days. The same is done for up runs. This leaves two oscillators ranging from 0 to 1 for both up and down runs. The runs oscillator is fused together by multiplying the down run oscillator by -100 and the up run oscillator by 100 and summing them together. The final oscillator ranges between -100 and 100, with 100 representing maximum overbought conditions, and -100 being maximum oversold conditions.  In the example below we use median overbought and oversold conditions for countertrend entries (long<-50 and short>50) with an exit on a cross of zero. Essentially we are waiting for a median down run for longs, and a median up run for shorts while looking to exit on an up day for longs and a down day for shorts. We compare this to reverse daily follow through (long 1 down day, short 1 up day). As you will notice, the runs oscillator is far more consistent across time and has higher risk-adjusted returns.

5 Comments leave one →
  1. Troy S. permalink
    July 27, 2010 2:48 am

    I’m a little confused: what do you mean by “ranking a run”? Ranked by run length?

  2. George permalink
    July 27, 2010 4:53 am

    For the Ferrari red Reverse Daily Follow Through grap: I don’t see the -43% max Drawdown. This is some kind of mistake, isnt’ it?

  3. July 27, 2010 10:25 am

    Excellent David

    Funny enough I was pondering something similar the other day. I thought follow through would lead to longer lasting rallies/ drops (runs), while MR would mean shorter consecutive rallies/ drops and more up one day/ down the next.

    Therefore by looking at runs, you might have another way to filter MR vs trending markets.

    I wonder how you define a run? I was going to define it as simply the number of consecutive days the market has closed in the same direction.

    My only stumbling block was that i couldn’t find a decent way to count runs in excel. Could you help here David?

  4. Joshua Chance permalink
    August 24, 2010 1:26 pm


    I’ve been playing around with the ideas in the DVI and runs oscillator.. think I need to start a blog vs. hanging out in others’ comment sections!

    One idea is to conditionally rank the price change of a run versus past runs of the same length. So if currently we have an up run of 4 days then we rank the 4 day price change versus all other 4 day price changes when consecutive up days equals 4, and vice versa for down days. If current run length is the highest then it would have a rank of 100. For the sake of clarity, I mean today’s close divided by the close X days ago, with X being the length of the current run. Seems like the percentrank often leads price action, as it captures the declining directional momentum before an actual change in direction. Can be a little unstable though and probably requires a longer lookback than 252 days.

    Another idea I’m playing around with is to count runs for how long the close is greater than a moving average or a bollinger band. For up runs it seems to provide a good crash warning.



  1. Basic Anchored Oscillators « CSS Analytics

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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: