YungTraderFromMontana
Well-known member
I'm looking for something that can detect consolidation so I can stick to trading trends.
Thanks.
Thanks.
Nah, I get it. Good insight as well. Gonna take a look at some charts with your suggestions.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.
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Yoooo. Good observation. I was kinda thinking of something similar. Bollinger Bands open up when the price is volatile, so naturally when price and volume starts to settle, the band will start to shrink. Good thinking too. I will take a look at both of your suggestions.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!
Also, what are these indicators and where can I get them?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!
I had one more slightly more simplistic way of scanning for consolidation zones. You can scan for price trading below the 10 period ema on the day chart, but above its 10 period ema on the week chart. It definitely provides and interesting signal for consolidation.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.
I can't remember where the BoV original came from (possibly @Ben10) but I am really unsure. I modified it from its original version. Provides some interesting insight for sure.Also, what are these indicators and where can I get them?
#Balance of Volume
#Modified by Christopher84 04/27/2021
declare lower;
input length = 20;
input maxVolumeCutOff = 2.5;
input BulgeLength = 75;
input SqueezeLength = 75;
input BulgeLength2 = 20;
input SqueezeLength2 = 20;
assert(maxVolumeCutOff > 0, "'max volume cut off' must be positive: " + maxVolumeCutOff);
def cutOff = 0.2 * stdev(log(hlc3) - log(hlc3[1]), 30) * close;
def hlcChange = hlc3 - hlc3[1];
def avgVolume = Average(volume, 50)[1];
def minVolume = Min(volume, avgVolume * maxVolumeCutOff);
def dirVolume = if hlcChange > cutOff
then minVolume
else if hlcChange < -cutOff
then -minVolume
else 0;
plot VFI = ExpAverage(sum(dirVolume, length) / avgVolume, 3);
def VFI_UP = VFI [1] <= VFI;
def VFI_DOWN = VFI [1] > VFI;
VFI.AssignValueColor(if VFI_DOWN then color.RED else if VFI_UP then color.LIGHT_GREEN else color.GRAY);
def ZeroLine = 0;
#ZeroLine.SetDefaultColor(color.GRAY);
#ZeroLine.setStyle(Curve.SHORT_DASH);
plot Bulge = Highest(VFI, BulgeLength);
Bulge.SetPaintingStrategy(PaintingStrategy.Line);
Bulge.SetDefaultColor(color.RED);
plot Squeeze = Lowest(VFI, SqueezeLength);
Bulge.SetPaintingStrategy(PaintingStrategy.Line);
Squeeze.SetDefaultColor(color.LIGHT_GREEN);
plot Bulge2 = Highest(VFI, BulgeLength2);
Bulge2.SetDefaultColor(color.GRAY);
Bulge2.setStyle(Curve.SHORT_DASH);
plot Squeeze2 = Lowest(VFI, SqueezeLength2);
Squeeze2.SetDefaultColor(color.GRAY);
Squeeze2.setStyle(Curve.SHORT_DASH);
AddCloud(VFI, ZeroLine, Color.LIGHT_GREEN, Color.LIGHT_RED);
#Keltner_Bandwidth
#Created by Christopher84 04/28/2021
declare lower;
#STARC_Bands
input price = close;
input ATR_length = 18;
input SMA_length = 6;
input displace = 0;
input multiplier_factor = 1.15;
def val = Average(price, sma_length);
def average_true_range = Average(TrueRange(high, close, low), length = atr_length);
def Upper_Band = val[-displace] + multiplier_factor * average_true_range[-displace];
def Middle_Band = val[-displace];
def Lower_Band = val[-displace] - multiplier_factor * average_true_range[-displace];
#Keltner_Channel
input factor = 2.0;
input lengthK = 20;
input averageTypeK = AverageType.SIMPLE;
input trueRangeAverageType = AverageType.SIMPLE;
input BulgeLengthK = 150;
input SqueezeLengthK = 150;
input BulgeLengthK2 = 40;
input SqueezeLengthK2 = 40;
def shift = factor * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), lengthK);
def average = MovingAverage(averageTypeK, price, lengthK);
def Avg = average[-displace];
def Upper_BandK = average[-displace] + shift[-displace];
def Lower_BandK = average[-displace] - shift[-displace];
plot BandwidthK = (Upper_BandK - Lower_BandK) / Avg * 100;
plot BulgeK = Highest(BandwidthK, BulgeLengthK);
BulgeK.SetPaintingStrategy(PaintingStrategy.Line);
BulgeK.SetLineWeight(1);
BulgeK.SetDefaultColor(Color.RED);
plot SqueezeK = Lowest(BandwidthK, SqueezeLengthK);
SqueezeK.SetPaintingStrategy(PaintingStrategy.Line);
SqueezeK.SetLineWeight(1);
SqueezeK.SetDefaultColor(Color.GREEN);
plot BulgeK2 = Highest(BandwidthK, BulgeLengthK2);
BulgeK2.SetPaintingStrategy(PaintingStrategy.Line);
BulgeK2.SetStyle(Curve.SHORT_DASH);
BulgeK2.SetLineWeight(1);
BulgeK2.SetDefaultColor(Color.RED);
plot SqueezeK2 = Lowest(BandwidthK, SqueezeLengthK2);
SqueezeK2.SetPaintingStrategy(PaintingStrategy.LINE);
SqueezeK2.SetStyle(Curve.SHORT_DASH);
SqueezeK2.SetLineWeight(1);
SqueezeK2.SetDefaultColor(Color.LIGHT_GREEN);
def STARC_UP = (Upper_BandK[1] < Upper_BandK) and (Lower_BandK[1] < Lower_BandK);
def STARC_DOWN = (Upper_BandK[1] > Upper_BandK) and (Lower_BandK[1] > Lower_BandK);
BandwidthK.AssignValueColor(if ((BandwidthK > BandwidthK[1]) and STARC_UP) then Color.GREEN else if ((BandwidthK < BandwidthK[1]) and STARC_UP) then Color.GREEN else if ((BandwidthK > BandwidthK[1]) and STARC_DOWN) then Color.RED else if ((BandwidthK < BandwidthK[1]) and STARC_DOWN) then Color.RED else Color.GRAY);
Good works. Are the main and lower 2 studies available on our web sites?!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!
Thank you! Yes the code for Balance of Volume and Keltner Bandwidth are directly above your post. The CC Candles are available here https://usethinkscript.com/threads/confirmation-candles-indicator-for-thinkorswim.6316/Good works. Are the main and lower 2 studies available on our web sites?!
@Christopher84 Hi, may i know where can I find the script for the lower indicator that plots the consolidation zone or squeeze? Can this be configured as a scan? Thank uI had one more slightly more simplistic way of scanning for consolidation zones. You can scan for price trading below the 10 period ema on the day chart, but above its 10 period ema on the week chart. It definitely provides and interesting signal for consolidation.
Hi Nick!@Christopher84 Hi, may i know where can I find the script for the lower indicator that plots the consolidation zone or squeeze? Can this be configured as a scan? Thank u
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
M | Best Daytrading Strategies For SPY | Questions | 6 | |
S | What is the best way to identify the choppy price action? | Questions | 1 | |
Best editing tool in ThinkOrSwim | Questions | 1 | ||
F | Best Support/Resistance Indicator for ThinkOrSwim | Questions | 1 | |
Curious | Best BACKTESTED Results You Have Achieved | Questions | 2 |
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.