Need good ideas on how to programatically identify past consolidations

 

What are some of the good ideas any of you have that would allow for the identification of past consolidations?

I'm not talking about assigning current (right edge) bars, as oftentimes you don't know in the present... but

I'm talking about a method and strategy that would classify or group the bars that are far enough in the past that we all know they were part of a consolidation (meaning, not part of a directional up or down move) on the chart time frame that is being viewed.

Does anyone know someone who has worked on such a thing in the past and might have such a tool/indicator?

I'm interested to find who has a solution idea to this that seems robust and then inquire if they have the time/interest to code it if I put the request out on the Freelance market.

Thanks to any of you willing to contribute your expertise to my query.

 

I think, it is possible. You just need to invest some time to get the success you want.

I always look for the out of ordinary ideas as they could reveal some of the secrets.

If we go back to the consolidation definition, it is about fluctuating the price in between two horizontal ranges for some period of time after a noticeable trend in the past then at the end of that period the price will break one of those two levels to either continue the previous trend direction or making a trend reversal.

So, in my idea, you  need to have a dynamic algorithm works as  2 dimensional window ( Height = Price range, Width = No. of bars ), Let your code to scan bars from right to left using 2 nested loops to record different samples of number of bars (bigger number of bars for lower time frames)  and price range in pips, then compare the results with either predefined ranges of bars and price range or make the whole algorithm decide what is the best match by giving more weight to price range or number of bars to give the final decision.

Not sure if I succeeded to describe what is going in my mine. This is really reminded me the past years when I wrote my thesis :(