Identifying Ranging Markets

Discussion in 'Technical Analysis' started by Corey, Jun 24, 2008.

  1. Corey

    Corey

    Does anybody have a good, quantitative (!!) method for identifying ranging markets?

    My best bet here was to derive a 'price-efficiency' metric, where I measure price change over N days relative to the ATR over those N days. It is pretty self-explanatory how this would work.

    Another basic concept I had was to use multiple period EMAs and using the maximum distance between any two EMAs as the measurement. A small, shrinking (or stagnant) distance indicates ranging while a large, growing distance indicates a trend.

    Unfortunately, both of these metrics are prone to chop and their classification ability is heavily reliant on the time period you choose. Since I am using a computer to identify these patterns (and not the human eye), even the slightest bump or wiggle may be an inaccurate signal, where for the human eye, it could be seen as the bump it is ... perhaps I should make my crayon a bit duller, right? :D

    Ultimately, I am probably going to need some sort of adaptive measure ...

    Any thoughts?

    Much appreciated,
    Corey
     
  2. Price action and volume will do the job for you:D
     
  3. ATLien

    ATLien

    In some of my models I've used linear regression analysis to measure "trendiness".

    So for example, if you want to measure the trendiness of a day, you could calculate a linear regression for all closing prices of 5 minute bars of a day. According to the slope and error, you could then make up your mind as to whether it was a trending day or not.

    There is an obvious problem with this technique, what if the day consisted of two opposing trends, a down-trend, and an up-trend. The day should be defined as trendy, but simple linear regression analysis wont pick this up.

    What I've done to solve this problem is divide daily data into segments, calculate the linear regression on each segment, and then merge segments with low error to represent a trend.

    For example, if you have K bars for a day, divide this sequence into k/2 segments. Each segment will have 2 bars in it. Next calculate the linear regression on each segment. Calculate a composite error for the entire data sequence made up of these segments. Then go through an iterative process merging segments to create the lowest composite error for the sequence. This should leave with you a set of "trend" lines resembling the price action history pretty well. I've found it fairly easy to then work with this data to properly classify trading days.

    I hope this made some sense.
     
  4. Corey

    Corey

    Wow! Thank you for sharing such an intriguing strategy ... definitely a very unique concept and I can see how it can be very effective! I will give it a go!
     
  5. Agree with Mr Black, but have a couple of comments.

    Market can be
    1. Trending HH, HL etc
    2. Ranging or
    3. Congested HH, LL etc

    As we can "easily" identify 1 and 3 any market that does not meet the criteria will be ranging.

    I find it useful to look at the momentum of the up and down moves to determine whether to trade the range or the breakout.

    Have tried to quantify but too hard for me.

    Cheers
     
  6. I just use the ADX/Directional Movement Index.
    If ADX is above 30, the market is trending strongly.
    If it's below 20, it's trendless and between 21-29, it's trending, but weak.
     
  7. =======================
    a]It makes sense;
    50 dma is good trend measure & monthly charts =big help

    b]An obvious solution to obvious problem ;
    intraday '' oposing trends'',is use daily closing price;
    works well.

    c]''+'' shaped candle [open price same or near to close price];
    1 year chart helps.
     
  8. adx is good but too late and slow.
     
  9. ATLien's regression post made me think of something I have seen used in other applications that might help. There is a technique called an unbiasedness regression that is used in price discovery analysis. There are probably different versions of it, but the main idea is you regress a return from a longer period (maybe a day) on the return from a shorter period (say open until 10:30) over a large sample of days. The coefficient is 1.0 for unbiasedness, meaning the return on the later part of the day is unrelated to the earlier part of the day. Significantly less than 1.0 and you tend to get continuation or a trend, higher than 1.0 you tend to get reversal. Which I guess still does not tell you if the later return is choppy, but you could play with the time frames some to get at this information.

    But this is probably worthless for most markets without conditioning information, and it doesn't differentiate between different types of days. So what you could do is figure out what data you have at 10:30 that should be related to whether it will be a trending day or not. Say you observe the return is 75 bps and volume is 10% greater than normal, yesterday was a down day, there was no major data release, whatever you think is important. You run the unbiasedness regression on a large sample of similar days in the recent past and see what it predicts. Try different criteria and different meaurement times and see if you can get any to work in out of sample backtests for whatever you are trading. You could also use price changes instead of returns.
     
  10. dima777

    dima777

    here is the method that i came up with recently to distinguish choppy markets from trending:

    calculate the total number of times the price crosses a simple moving average for the last 20 days

    hope it helps
     
    #10     Jul 23, 2008