could you elaborate on it--ZScore, how to decide?!ZScore is a good supporting study for deciding which way sqz is going to fire https://tos.mx/4WjebUG
could you elaborate on it--ZScore, how to decide?!ZScore is a good supporting study for deciding which way sqz is going to fire https://tos.mx/4WjebUG
Check out our Buy the Dip indicator and see how it can help you find profitable swing trading ideas. Scanner, watchlist columns, and add-ons are included.
Has anyone been able to convert this to show the chart candles in the same colorsJohn Carter's Squeeze Pro Indicator for ThinkorSwim (FREE)
I derived John Carter's Pro Squeeze indicator. All it looks like he does is add in more conditional rules on whether BBs are inside a larger and smaller range. The code is actually pretty simple just added a few Keltner ranges and added in Mobius's derivation of the original TTM Squeeze's momentum function.
Dark_orange is the pre-squeeze, yellow signals the original, and red is one step above actual i.e., extreme compression.
View attachment 8145
Thanks,
TheBewb
Code:declare lower; ##Assembled by TheBewb using existing Mobius Squeeze Momentum coding and "squeeze" concept made popular by John Carter. input price = close; input length = 20; input Num_Dev_Dn = -2.0; input Num_Dev_up = 2.0; input averageType = AverageType.SIMPLE; input displace = 0; def sDev = StDev(data = price[-displace], length = length); def MidLineBB = MovingAverage(averageType, data = price[-displace], length = length); def LowerBandBB = MidLineBB + Num_Dev_Dn * sDev; def UpperBandBB = MidLineBB + Num_Dev_up * sDev; input factorhigh = 1.0; input factormid = 1.5; input factorlow = 2.0; input trueRangeAverageType = AverageType.SIMPLE; def shifthigh = factorhigh * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), length); def shiftMid = factormid * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), length); def shiftlow = factorlow * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), length); def average = MovingAverage(averageType, price, length); def Avg = average[-displace]; def UpperBandKCLow = average[-displace] + shiftlow[-displace]; def LowerBandKCLow = average[-displace] - shiftlow[-displace]; def UpperBandKCMid = average[-displace] + shiftMid[-displace]; def LowerBandKCMid = average[-displace] - shiftMid[-displace]; def UpperBandKCHigh = average[-displace] + shifthigh[-displace]; def LowerBandKCHigh = average[-displace] - shifthigh[-displace]; def K = (Highest(high, length) + Lowest(low, length)) / 2 + ExpAverage(close, length); def momo = Inertia(price - K / 2, length); def pos = momo>= 0; def neg = momo< 0; def up = momo >= momo[1]; def dn = momo < momo[1]; def presqueeze = LowerBandBB > LowerBandKCLow and UpperBandBB < UpperBandKCLow; def originalSqueeze = LowerBandBB > LowerBandKCMid and UpperBandBB < UpperBandKCMid; def ExtrSqueeze = LowerBandBB > LowerBandKCHigh and UpperBandBB < UpperBandKCHigh; def PosUp = pos and up; def PosDn = pos and dn; def NegDn = neg and dn; def NegUp = neg and up; plot squeezeline = 0; squeezeline.SetPaintingStrategy(PaintingStrategy.POINTS); squeezeline.AssignValueColor(if ExtrSqueeze then Color.RED else if originalSqueeze then Color.YELLOW else if presqueeze then Color.DARK_ORANGE else Color.GRAY); plot momentum = momo; momentum.SetPaintingStrategy(PaintingStrategy.HISTOGRAM); momentum.AssignValueColor( if PosUp then Color.green else if PosDn then Color.dark_green else if NegDn then Color.dark_orange else if NegUp then Color.yellow else Color.YELLOW);
Has anyone converted the lower squeeze pro oscillator to color the upper chart candles (four color) to match lower trend colors?
Has anyone been able to convert this to show the chart candles in the same colors
and stick it in an AssignPriceColor statement (which colors the candles)AssignValueColor( if PosUp then Color.green else if PosDn then Color.dark_green else if NegDn then Color.dark_orange else if NegUp then Color.yellow else Color.YELLOW);
and voilà, you have painted candles.AssignPriceColor( if PosUp then Color.green else if PosDn then Color.dark_green else if NegDn then Color.dark_orange else if NegUp then Color.yellow else Color.YELLOW);
# upper candle painting study only
##Assembled by TheBewb using existing Mobius Squeeze Momentum coding and "squeeze" concept made popular by John Carter.
input price = close;
input length = 20;
input Num_Dev_Dn = -2.0;
input Num_Dev_up = 2.0;
input averageType = AverageType.SIMPLE;
input displace = 0;
def sDev = StDev(data = price[-displace], length = length);
def MidLineBB = MovingAverage(averageType, data = price[-displace], length = length);
def LowerBandBB = MidLineBB + Num_Dev_Dn * sDev;
def UpperBandBB = MidLineBB + Num_Dev_up * sDev;
input factorhigh = 1.0;
input factormid = 1.5;
input factorlow = 2.0;
input trueRangeAverageType = AverageType.SIMPLE;
def shifthigh = factorhigh * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), length);
def shiftMid = factormid * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), length);
def shiftlow = factorlow * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), length);
def average = MovingAverage(averageType, price, length);
def Avg = average[-displace];
def UpperBandKCLow = average[-displace] + shiftlow[-displace];
def LowerBandKCLow = average[-displace] - shiftlow[-displace];
def UpperBandKCMid = average[-displace] + shiftMid[-displace];
def LowerBandKCMid = average[-displace] - shiftMid[-displace];
def UpperBandKCHigh = average[-displace] + shifthigh[-displace];
def LowerBandKCHigh = average[-displace] - shifthigh[-displace];
def K = (Highest(high, length) + Lowest(low, length)) /
2 + ExpAverage(close, length);
def momo = Inertia(price - K / 2, length);
def pos = momo>= 0;
def neg = momo< 0;
def up = momo >= momo[1];
def dn = momo < momo[1];
def presqueeze = LowerBandBB > LowerBandKCLow and UpperBandBB < UpperBandKCLow;
def originalSqueeze = LowerBandBB > LowerBandKCMid and UpperBandBB < UpperBandKCMid;
def ExtrSqueeze = LowerBandBB > LowerBandKCHigh and UpperBandBB < UpperBandKCHigh;
def PosUp = pos and up;
def PosDn = pos and dn;
def NegDn = neg and dn;
def NegUp = neg and up;
AssignPriceColor( if PosUp then Color.green else if PosDn then Color.dark_green else if NegDn then Color.dark_orange else if NegUp then Color.yellow else Color.YELLOW);
Basically, to paint candles,
you copy everything after the AssignValueColor statement in a script
and stick it in an AssignPriceColor statement
and voilà, you have painted candles.
Here is the completed candle painting script:
Ruby:# upper candle painting study only ##Assembled by TheBewb using existing Mobius Squeeze Momentum coding and "squeeze" concept made popular by John Carter. input price = close; input length = 20; input Num_Dev_Dn = -2.0; input Num_Dev_up = 2.0; input averageType = AverageType.SIMPLE; input displace = 0; def sDev = StDev(data = price[-displace], length = length); def MidLineBB = MovingAverage(averageType, data = price[-displace], length = length); def LowerBandBB = MidLineBB + Num_Dev_Dn * sDev; def UpperBandBB = MidLineBB + Num_Dev_up * sDev; input factorhigh = 1.0; input factormid = 1.5; input factorlow = 2.0; input trueRangeAverageType = AverageType.SIMPLE; def shifthigh = factorhigh * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), length); def shiftMid = factormid * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), length); def shiftlow = factorlow * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), length); def average = MovingAverage(averageType, price, length); def Avg = average[-displace]; def UpperBandKCLow = average[-displace] + shiftlow[-displace]; def LowerBandKCLow = average[-displace] - shiftlow[-displace]; def UpperBandKCMid = average[-displace] + shiftMid[-displace]; def LowerBandKCMid = average[-displace] - shiftMid[-displace]; def UpperBandKCHigh = average[-displace] + shifthigh[-displace]; def LowerBandKCHigh = average[-displace] - shifthigh[-displace]; def K = (Highest(high, length) + Lowest(low, length)) / 2 + ExpAverage(close, length); def momo = Inertia(price - K / 2, length); def pos = momo>= 0; def neg = momo< 0; def up = momo >= momo[1]; def dn = momo < momo[1]; def presqueeze = LowerBandBB > LowerBandKCLow and UpperBandBB < UpperBandKCLow; def originalSqueeze = LowerBandBB > LowerBandKCMid and UpperBandBB < UpperBandKCMid; def ExtrSqueeze = LowerBandBB > LowerBandKCHigh and UpperBandBB < UpperBandKCHigh; def PosUp = pos and up; def PosDn = pos and dn; def NegDn = neg and dn; def NegUp = neg and up; AssignPriceColor( if PosUp then Color.green else if PosDn then Color.dark_green else if NegDn then Color.dark_orange else if NegUp then Color.yellow else Color.YELLOW);
How do you use it to determine direction sqz will fire??ZScore is a good supporting study for deciding which way sqz is going to fire https://tos.mx/4WjebUG
could you elaborate on it--ZScore, how to decide?!
Z-score oscillatorHow do you use it to determine direction sqz will fire??
Here ya go:How do you use it to determine direction sqz will fire??
Here's one. If you peruse the threads MerryDay posted above in post #92, you may find more.looking for 30 minute, 1hr a watchlist code for this
hi there....i am testing this strategy but i cannot change the level from 25 to .382 but i think i have to edit the level in the code somehow....i am assuming this is for bullish setup? what would be the level for bearish? also what is the settings for STC indicator? thanks !While in squeeze, SchaffTrend break above .382 and Ichimoku Kumo Cloud and Kijun under price will make you bank and get you in early.
Hi All - this is great - but is there a way to make the dots bigger? They are tiny on the histogram - I've noticed that on other charts they are about 3x larger - very difficult to see on this. I checked the TOS painting strategy docs, but not seeing a solution there.
Has anyone ever coded this into a squeeze counter custom watchlist field similar to what Mobius did for the TTM_Squeeze? Thanks
Is anyone able to add Up and down arrows to this study when either PosUP or PosDN? Thanks in advance.Basically, to paint candles,
you copy everything after the AssignValueColor statement in a script (which colors the plot)
and stick it in an AssignPriceColor statement (which colors the candles)
and voilà, you have painted candles.
Here is the completed candle painting script:
Ruby:# upper candle painting study only ##Assembled by TheBewb using existing Mobius Squeeze Momentum coding and "squeeze" concept made popular by John Carter. input price = close; input length = 20; input Num_Dev_Dn = -2.0; input Num_Dev_up = 2.0; input averageType = AverageType.SIMPLE; input displace = 0; def sDev = StDev(data = price[-displace], length = length); def MidLineBB = MovingAverage(averageType, data = price[-displace], length = length); def LowerBandBB = MidLineBB + Num_Dev_Dn * sDev; def UpperBandBB = MidLineBB + Num_Dev_up * sDev; input factorhigh = 1.0; input factormid = 1.5; input factorlow = 2.0; input trueRangeAverageType = AverageType.SIMPLE; def shifthigh = factorhigh * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), length); def shiftMid = factormid * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), length); def shiftlow = factorlow * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), length); def average = MovingAverage(averageType, price, length); def Avg = average[-displace]; def UpperBandKCLow = average[-displace] + shiftlow[-displace]; def LowerBandKCLow = average[-displace] - shiftlow[-displace]; def UpperBandKCMid = average[-displace] + shiftMid[-displace]; def LowerBandKCMid = average[-displace] - shiftMid[-displace]; def UpperBandKCHigh = average[-displace] + shifthigh[-displace]; def LowerBandKCHigh = average[-displace] - shifthigh[-displace]; def K = (Highest(high, length) + Lowest(low, length)) / 2 + ExpAverage(close, length); def momo = Inertia(price - K / 2, length); def pos = momo>= 0; def neg = momo< 0; def up = momo >= momo[1]; def dn = momo < momo[1]; def presqueeze = LowerBandBB > LowerBandKCLow and UpperBandBB < UpperBandKCLow; def originalSqueeze = LowerBandBB > LowerBandKCMid and UpperBandBB < UpperBandKCMid; def ExtrSqueeze = LowerBandBB > LowerBandKCHigh and UpperBandBB < UpperBandKCHigh; def PosUp = pos and up; def PosDn = pos and dn; def NegDn = neg and dn; def NegUp = neg and up; AssignPriceColor( if PosUp then Color.green else if PosDn then Color.dark_green else if NegDn then Color.dark_orange else if NegUp then Color.yellow else Color.YELLOW);
Is anyone able to add Up and down arrows to this study when either PosUP or PosDN? Thanks in advance.
plot UpArrow= if PosUP and !PosUP[1] then 0 else Double.NaN;
UpArrow.SetPaintingStrategy(PaintingStrategy.ARROW_up);
UpArrow.SetDefaultColor(color.cyan) ;
UpArrow.SetLineWeight(4);
UpArrow.HideBubble() ; UpArrow.HideTitle() ;
plot DnArrow= if PosDN and !posDN[1] then momo else Double.NaN;
DnArrow.SetPaintingStrategy(PaintingStrategy.ARROW_down);
DnArrow.SetDefaultColor(color.red) ;
DnArrow.SetLineWeight(4);
DnArrow.HideBubble() ; DnArrow.HideTitle() ;
Thank you so much for the code. When applied to the end of the existing code, it does not show any arrows. Is there something I could do differently?Add this code snippet to the bottom of your study
Ruby:plot UpArrow= if PosUP and !PosUP[1] then momo else Double.NaN; UpArrow.SetPaintingStrategy(PaintingStrategy.ARROW_up); UpArrow.SetDefaultColor(color.cyan) ; UpArrow.SetLineWeight(2); UpArrow.HideBubble() ; UpArrow.HideTitle() ; plot DnArrow= if PosDN and !posDN[1] then momo else Double.NaN; DnArrow.SetPaintingStrategy(PaintingStrategy.ARROW_down); DnArrow.SetDefaultColor(color.red) ; DnArrow.SetLineWeight(2); DnArrow.HideBubble() ; DnArrow.HideTitle() ;
Thank you so much for the code. When applied to the end of the existing code, it does not show any arrows. Is there something I could do differently?
VTR is a momentum indicator that shows if a stock is overbought or oversold based on its Weekly and Monthly average volatility trading range.
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.