What are the best scripts to detect periods of consolidation?

john3

Active member
2019 Donor
I'm looking for something that can detect consolidation so I can stick to trading trends.

Consolidation where? Top of a given range, middle, etc? It makes a big difference. And what is a trend? There is always a trend, it all depends on how you define it.
 

dougn

Member
2019 Donor
Here is scanning script for base formation with a breakout. Though the source of this is unknown I have used it for quite a long time and find it very helpful.
Code:
input spanOfBase = 8;
input maxPrctCorrection = 10;
input spanOfBreakoutHigh = 42;
def flatBaseHigh = highest(high[1], spanOfBase);
def flatBaseLow = lowest(low[1], spanOfBase);
def percentMaxCorrection = AbsValue(100 * (flatBaseLow / flatBaseHigh - 1));
def withinPrctCorrectionLimits = percentMaxCorrection <= maxPrctCorrection; def highShade = if withinPrctCorrectionLimits then flatBaseHigh else flatBaseLow; def lowShade = if withinPrctCorrectionLimits then flatBaseLow else flatBaseHigh; def flatBase = highShade > lowShade;
def highestHighForBreakout = highest(high[1], spanOfBreakoutHigh);
def currentBreakoutHigh = high > highestHighForBreakout;
# only one of these can be scanned for at one time. Use "#" comment marks to turn off
# the one you don't need
#plot flatBaseFormation = flatBase and currentBreakOutHigh == 0;
plot breakOutSignal = currentBreakOutHigh and currentBreakOutHigh[1] == 0 and flatBase;
 

YungTraderFromMontana

Well-known member
To use the heiken mtf strategy to the best of its ability it needs a pairing with a study pf sorts. Anyone who has a favorite trend/chop/consolidation study please post it here so we can find the best pairing. I may end up asking @diazlaz to make a combo trend/chop/consolidation paintbar script with many of these indicators if they have promise put together.

So far stoplight v2 seems to be the best pairing.
 

Nick

Active member
2019 Donor
VIP
@tomsk Hi, when we are selecting the plot, is there a way to have the flat base formation or the breakout signal plotted on the price chart?

Unable to attach the pic link

320k3WX.jpg


Thanks
 

schaves14

New member
I am looking for a scanner that identifies stocks that are currently in consolidation and moving sideways. Ideally, this would identify stocks that have hit their support line twice.

Does anyone have anything similar? Thank you!
 

ddtav478

New member
Does anyone know of a script or how to make a script to scan stocks in consolidation patters? I tried thinkorswim's pattern search option and it isn't that great. The things I've noticed about consolidation patterns is that it follows after an impulsive move up. I guess the correct search parameters would be to scan for a stock that has high volume with large price movement in the last 10-25 days followed by a decrease in volume. I wanted to add that I tried using the thinkorswim quick script wizard and I did more harm than good. lol. Can anyone offer any insight or point me to the right location? Thank you all.
 

germanburrito

Active member
Does anyone know of a script or how to make a script to scan stocks in consolidation patters? I tried thinkorswim's pattern search option and it isn't that great. The things I've noticed about consolidation patterns is that it follows after an impulsive move up. I guess the correct search parameters would be to scan for a stock that has high volume with large price movement in the last 10-25 days followed by a decrease in volume. I wanted to add that I tried using the thinkorswim quick script wizard and I did more harm than good. lol. Can anyone offer any insight or point me to the right location? Thank you all.
heres an idea. Its not what you are refering to, but why dont you try to look for stocks where the daily rsi is between 60 and 40. because usually when rsi is above 70 or below 30 is trending. or reversing back to the mean, but it is moving, consolidation is difficult to gauge in my opion, just like trend is difficult, because things are consolidating or trending until they are not. you could also look for wedge patterns. technically thats a geometrical consolidation.
 

ddtav478

New member
heres an idea. Its not what you are refering to, but why dont you try to look for stocks where the daily rsi is between 60 and 40. because usually when rsi is above 70 or below 30 is trending. or reversing back to the mean, but it is moving, consolidation is difficult to gauge in my opion, just like trend is difficult, because things are consolidating or trending until they are not. you could also look for wedge patterns. technically thats a geometrical consolidation.
That's some good advice. I had no luck with the RSI in the past but I think I have to learn to stick with one method and use it for while before I determine if the method is right for me. The wedge pattern is also good thinking. I'm gonna give those a try as well.
 

germanburrito

Active member
That's some good advice. I had no luck with the RSI in the past but I think I have to learn to stick with one method and use it for while before I determine if the method is right for me. The wedge pattern is also good thinking. I'm gonna give those a try as well.
i mean the rsi on a daily chart, each candle as a day. but honestly when people say follow "trend" its bullshit because something thats trending on a 5 minute chart might not be on a 4 hour chart. thats why is good to look at different time frames. and in my opinion thats why consolidation happens, price gets caught up between two time frames. so one time frame want to go up and then the other down. usually the higher time frame wins(usually i think). hopefully thats not confusing.
 

Christopher84

Active member
VIP
Does anyone know of a script or how to make a script to scan stocks in consolidation patters? I tried thinkorswim's pattern search option and it isn't that great. The things I've noticed about consolidation patterns is that it follows after an impulsive move up. I guess the correct search parameters would be to scan for a stock that has high volume with large price movement in the last 10-25 days followed by a decrease in volume. I wanted to add that I tried using the thinkorswim quick script wizard and I did more harm than good. lol. Can anyone offer any insight or point me to the right location? Thank you all.
Just a few observations I had when thinking about your question. Consolidation will often times occur after large spikes in volatility (which can be measured with Bollinger Bandwidth or Keltner Bandwidth). After a spike, you can look for Balance of Volume to fade along with a fade in volatility and a narrowing price range (typically leading to a squeeze before the next big move). Just some thoughts. You can see some of what I am referring to in the image below. I would scan for bandwidth pulling off the 75 period length bulge and BoV pulling away from its 40 period length bulge. Again, I haven't tried this out yet, its just a thought. I hope it helps!
ORf4LJL.png
 

Similar threads

Top