What are the best scripts to detect periods of consolidation?

  • Thread starter YungTraderFromMontana
  • Start date
YungTraderFromMontana

YungTraderFromMontana

Well-known member
I'm looking for something that can detect consolidation so I can stick to trading trends.
Thanks.
 
J

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

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;
 
J

Johnny Cash

Member
@dougn Great script, is there a way to modify it so it can scan periods of consolidation on a weekly chart frame? Thanks for sharing.
 
T

tomsk

Well-known member
VIP
@Johnny Cash Absolutely no problem, Just load that code into the scanner and select Weekly aggregation. I just scanned this against the S&P 500 using a weekly aggregation and obtained 10 results.
 
J

Johnny Cash

Member
@Johnny Cash Absolutely no problem, Just load that code into the scanner and select Weekly aggregation. I just scanned this against the S&P 500 using a weekly aggregation and obtained 10 results.
Got it,
Thank you.
 
YungTraderFromMontana

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.
 
N

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



Thanks
 
S

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!
 
A

ajai

New member
VIP
I use MTF HA pair it with Hull turning and Fib support resistance levels .works really good in ES and ZB,which I trade.
 

Similar threads

Top