Repaints Smooth-Sailing vs Jitter-Zone Indicator for Scalping For ThinkOrSwim

Repaints
Thanks. I'm still an amateur in thinkscript so I just removed what I thought was safe to remove. It's working so far.

May next goal/ request perhaps is specific scan of transition from bullish to JZ and vice versa. What's currently scanning is a bit non-specific (JZ is true regardless if it's from the bullish or bearish). Current status is good enough but it could always be better.

Thanks again.
I appreciate that you did not hesitate to take a jab at it. The original indicator code is performing acceptably - in general, but sure has a lot of room for improvements. If this is achieved, the scanner code will also get a better foundation. I hope I get a chance to look into this soon.
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Is there any way to create a scan for just one time frame like the 15-minute timeframe(buy signal is true) and then candidates found on this scan this scan could be checked for concurrence with the higher timeframe manually?
 
So I love Smooth Sailing, I've been pairing it with some other indicators and really hitting some good scalps with it. On TOS Mobile I have to disable MTF for it to show up, which is fine, but none of the buy/sell/short labels or pivot arrows show up in it. I can understand the labels might be a bit beyond the capabilities of TOS Mobile, but I wonder if the labels can be replaced with colored arrows for TOS Mobile? Or are arrows only possible for upper studies on Mobile instead of lower? I only ask because there are times where I have to step out for work while still milking a longer trend and would like to monitor it on the road. Either way, I really look forward to your future updates on this indicator, @TraderZen. Thank you again for your hard work!
 
@TraderZen This looks awesome! For some reason when I copy and paste it into TOS on a 1 min chart i just get a blank lower. Any idea for a fix on that?

Having Problems? Does the MTF indicator appear to be not working or partially working when you load the study onto your chart?
A common error when using MTF indicators is your chart is a lower timeframe than the aggregation referenced in the script.

In this case, the script defaults to:
Input UseMTF = {"No", Default "Yes"};
Input MTF = AggregationPeriod.FIFTEEN_MIN;
This means it cannot be used on chart less than 15min.

The fix is to change the aggregation to:
AggregationPeriod.MIN

On the TOS platform, you can display data from a higher timeframe onto a lower timeframe but not the other way around.
https://tlc.thinkorswim.com/center/...hapter-11---Referencing-Secondary-Aggregation
 
#------------------------------------------------------------------------------------------------------- # Smooth_Sailing vs Jitter_Zone Indicator # V 8.0 # Last update 09/02/2022 - Traderzen #------------------------------------------------------------------------------------------------------ declare lower; Input UseMTF = {"No", Default "Yes"}; Input MTF = AggregationPeriod.FIFTEEN_MIN; Input VolumeSmoothing = { Default "Yes", "No"}; Input Slope = {Default "Incremental" , "Aggregate"}; Input Bar_Segment = { Default "HL", "OC" }; Input fast = 2; #Average Slope. Input SuperSlow = 2; #Projection Curve Setting - Used for the divergence sensitivity. Input ShowJitterZone = { Default "Yes", "No"}; Input ShowLabel = { default "Yes", "No"}; Input ShowVerticalLine = {Default "yes", "No"}; Input ShowPPS = { Default "Yes", "No"}; Input Min_Theta_for_Mfactor = 25; # Buy/Short signal min avg angle. Input CommonRate = .97125; #Sensitivity for geometric progression def p_selected = if UseMTF == UseMTF."Yes" then MTF else getAggregationPeriod() ; def p = if Slope == Slope."Incremental" then GetAggregationPeriod() else if p_selected < getAggregationPeriod() then getAggregationPeriod() else p_selected; def mFactor = if UseMTF == UseMTF."Yes" and Slope == Slope."Incremental" then p_selected / getAggregationPeriod() else 1; def SlopeF = if UseMTF == UseMTF."Yes" and Slope == Slope."Incremental" then (mFactor+fast) else 1; def SlopeS = if UseMTF == UseMTF."Yes" and Slope == Slope."Incremental" then (mFactor+SuperSlow) else 1 ; Def averageType = AverageType.wilders; Def averageType2 = AverageType.Hull; def hiDiff = IF Bar_Segment == Bar_segment."HL" then high(period=p) - high(period=p)[1] else close(period=p) - close(period=p)[1]; def loDiff = If Bar_Segment == Bar_segment."HL" then low(period=p)[1] - low(period=p) else open(period=p)[1] - open(period=p); def plusDM = if hiDiff > loDiff and hiDiff > 0 then hiDiff else 0; def minusDM = if loDiff > hiDiff and loDiff > 0 then loDiff else 0; def ATR = MovingAverage(AverageType, TrueRange(high(period=p), close(period=p), low(period=p)), SlopeF); Plot DIplus = 100 * MovingAverage(averageType, plusDM, SlopeF) / if bar_segment == bar_segment."HL" then ATR else ATR*.5; Plot DIminus = 100 * MovingAverage(averageType, minusDM, SlopeF) / if bar_segment == bar_segment."HL" then ATR else ATR*.5; plot DX = DIplus - DIminus; Plot hz=0; #-- Real deal Buy signal angle calculation for MTF using geomatric progression. #-- For example: Do not trigger buy signal if then slope is less than 75 degrees for 1 min chart and 30 degrees for 30 min chart. def Theta = MIn_Theta_for_Mfactor*power(commonRate,Mfactor-1); ##-- Real deal scientific slope calculation using ArcTan formula. def ATanP = (ATan(DX/SlopeF) * (180 / Double.Pi)); # MTF support def v_1 = volume(period=p); def v_2 = volume; def w_1 = if ATanp > 0 and !(ATanP[1]> 0)then v_1 else if ATanP < 0 and !(Atanp[1] < 0 ) then v_1 else w_1[1] + v_1; def w_2 = if ATanp > 0 and !(ATanP[1]> 0) then v_2 else if ATanP < 0 and !(Atanp[1] < 0 ) then v_2 else w_2[1] + v_2; plot TDX; Switch (VolumeSmoothing){ Case "No" : TDX = w_1 * if atanp>0 then 1 else -1; Case "Yes" : TDX = w_2 * if atanp>0 then 1 else -1; } TDX.AssignValueColor( if ATanP >= ATanP[1] && ATanP > 0 and TDX >= TDX[1] then color.cyan else if ATanP <= ATanP[1]&& ATanP > 0 and TDX >= TDX[1] then color.light_green else if ATanP <= ATanP[1]&& ATanP < 0 and TDX <= TDX[1] then color.magenta else if ATanP >= ATanP[1]&& ATanP < 0 and TDX <= TDX[1] then color.Pink else Color.yellow ); TDX.setLineWeight(1); TDX.SetPaintingStrategy(PaintingStrategy.histogram); def ATANPMA = MovingAverage(averageType2, ATanP,mFactor); plot ATDX; Switch (VolumeSmoothing){ Case "No" : ATDX = w_1 * if atanpma>0 then 1 else -1; Case "Yes" : ATDX = w_2 * if atanpma>0 then 1 else -1; } Def JitterZone = if (ATanP>0 and ATanp[1]<0) or (ATanp<0 and ATanp[1]>0) then 1 else if (ATanPMA>0 and ATanpMA[1]<0) or (ATanpMA<0 and ATanpMA[1]>0) then 1 else 0; ATDX.AssignValueColor( if JitterZone then color.yellow else if (tdx==atdx and tdX > 0) then color.uptick else if (tdx==atdx and tdx<0) then color.downtick else color.yellow ); ATdx.setLineWeight(1); ATdx.SetPaintingStrategy(PaintingStrategy.LiNE); plot jz = if Jitterzone or (tdx!=atdx) then atdx else double.nan; jz.setpaintingstrategy(paintingStrategy.LINE_VS_Triangles); jz.setlineweight(3); jz.assignValueColor(color.yellow); atdx.setHiding(ShowJitterZone); jz.setHiding(ShowJitterZone); addlabel(if showLabel == ShowLabel."yes" then yes else no, if JitterZone then "Jitter Zone" else "Smooth Sail", if JitterZone then color.yellow else if tdx==atdx and tdx>0 then color.uptick else if tdx == atdx and tdx<0 then color.downtick else color.White ); def zone = if (tdx==atdx and tdX > 0) then -5 else if (tdx==atdx and tdx < 0) then 5 else if (TDX != atdx) then 0 else double.nan; plot ZoneLine = zone; Zoneline.assignValuecolor(if JitterZone then Color.Yellow else if zoneline == -5 then color.uptick else if zoneline == 5 then color.downTICK else color.White); zoneline.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES); HZ.AssignValueColor(color.gray); def up = if (ShowPPS == ShowPPS."Yes") then PPS().BuySignal else double.nan; def down = if (ShowPPS == ShowPPS."Yes") then PPS().SellSignal else double.nan; def upArrow = if up then 0 else double.NaN; def dnArrow = if down then 0 else double.NaN; plot PPSup = upArrow; Plot PPSdown = dnArrow; PPSup.SetPaintingStrategy(PaintingStrategy.ARROW_UP); PPSdown.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN); PPSup.SetLineWeight(3); PPSDown.SetLineWeight(3); PPSUp.AssignValueColor(Color.UpTick); PPSDown.AssignValueColor(Color.DownTick); DIminus.hide(); DIplus.hide(); DX.hide(); # -- Buy / Sell Indicator -- # def ATanP2 = (ATan(DX/Fast) * 180 / Double.Pi); def ATANPMA_JZ = MovingAverage(averageType2, ATanP2,SuperSlow); Def decision = if JitterZone == 0 and ATANP > 0 and ATANP[1] > 0 and ATANP > ATANP[1] and !(ATanp <= Theta and atanp >= -Theta) then 1 #BUY else if JitterZone == 0 and ATANPMA > 0 and ATANPMA[1] > 0 and ATANPMA > ATANPMA[1] and !(ATanp <= Theta and atanp >= -Theta) then 1 #BUY else if decision[1] == 1 and ATANP > ATANP[1] and !(ATanp <= Theta and atanp >= -Theta) then 5 #Buy More else if decision[1] == 1 and ATANPmA > ATANPMA[1] and !(ATanp <= Theta and atanp >= -Theta) then 5 #Buy More else if ATANP < 0 and ATANP[1] >= 0 and (decision[1] == 1 or decision[1] == 5) then 2 #Sell else if ATANPMA < 0 and ATANPMA[1] >= 0 and (decision[1] == 1 or decision[1] == 5) then 2 #Sell else if JitterZone == 0 and ATANP <= 0 and ATANP[1] < 0 and ATANP < ATANP[1] and !(ATanp <= Theta and atanp >= -Theta) then 3 #Short else if JitterZone == 0 and ATANPMA <= 0 and ATANPMA[1] < 0 and ATANPMA < ATANPMA[1] and !(ATanp <= Theta and atanp >= -Theta) then 3 #Short else if decision[1] == 3 and ATANP < ATANP[1] and !(ATanp <= Theta and atanp >= -Theta) then 6 #Short More else if decision[1] == 3 and ATANPMA < ATANPMA[1] and !(ATanp <= Theta and atanp >= -Theta) then 6 #Short More else if ATANP > 0 and ATANP[1] < 0 and (decision[1] == 3 or decision[1] == 6) then 4 #Cover else if ATANPMA > 0 and ATANPMA[1] < 0 and (decision[1] == 3 or decision[1] == 6) then 4 #Cover else decision[1] ; Def entry = if (!isNan(Decision) && (Decision != Decision[1])) && (Decision == 1 or Decision == 3) then close else entry[1]; def exit = if Decision != Decision[1] && (Decision == 2 or Decision == 4) then close else exit[1]; def result = if Decision != Decision[1] && (decision == 2 or decision ==4) then if decision == 2 then exit - entry else entry - exit else result[1]; AddVerticalLine(ShowVerticalLine == ShowVerticalLine."Yes" and Decision == 1 and Decision != Decision[1], "Buy:" + AsDollars(close), Color.Green, Curve.SHORT_DASH); AddVerticalLine(ShowVerticalLine == ShowVerticalLine."Yes" and Decision == 3 and Decision != Decision[1], "Short:"+AsDollars(close), Color.Light_ORANGE, Curve.SHORT_DASH); AddVerticalLine(ShowVerticalLine == ShowVerticalLine."Yes" and Decision == 2 and Decision != Decision[1], "Sell:"+ AsDollars(close), Color.Red, Curve.Short_Dash); AddVerticalLIne(ShowVerticalLine == ShowVerticalLine."Yes" and Decision == 4 and Decision !=Decision[1], "Cover:"+AsDollars(Close),Color.Light_green,Curve.Short_dash); AddLabel( if ShowLabel == ShowLabel."Yes" and (ATanpma <= 10 and atanpma >= -10) && !Jitterzone then yes else no , "Caution: Near JitterZone!", Color.yellow ); AddLabel( if ShowLabel == ShowLabel."Yes" and JitterZone then yes else no , "Caution: Divergence!", Color.yellow ); AddLabel( if ShowLabel == ShowLabel."Yes" and Decision != Decision[1] then yes else no, if decision == 1 or decision == 5 then "buy" else if decision == 2 then "sell ( " + result + " )" else if decision == 3 or decision == 6 then "short" else if decision == 4 then "Cover ( " + result + " )" else "*", if decision == 1 or decision == 5 then color.uptick else if decision == 2 then color.downtick else if decision == 3 or decision == 6 then color.light_orange else if decision == 4 then color.light_green else color.white); #Volume_Cloud input showVolband = no; input Daily_MovingAvgPeriod = 9; input Band_Percent_of_DMA_P_Vol = 5; def RefVol = If ShowVolBand then MovingAverage (3, Volume(period = AggregationPeriod.DAY) * (Band_percent_of_DMA_P_Vol/100), Daily_MovingAvgPeriod) else double.NaN; AddCloud (refVol,-1*refvol, color.light_gray,color.dark_gray, yes); # -- Happy Trading 9/2/2022 - Traderzen
@TraderZen @MerryDay Is there anyway to remove the Jitter zone from this indicator? I have been testing this indicator for some time and love everything about it other than the JZ. I was watching ES live and the JZ appears to repaint candles that fall within a certain range once the JZ criteria is triggered. This makes backtesting my strategy accurately impossible. Is there anyway to surgically remove just the Jitter zone and keep in tack the remaining indicator functions? I have tried myself with no success.
 
@TraderZen @MerryDay Is there anyway to remove the Jitter zone from this indicator? I have been testing this indicator for some time and love everything about it other than the JZ. I was watching ES live and the JZ appears to repaint candles that fall within a certain range once the JZ criteria is triggered. This makes backtesting my strategy accurately impossible. Is there anyway to surgically remove just the Jitter zone and keep in tack the remaining indicator functions? I have tried myself with no success.

If using this indicator with the MTF mode, there will be repainting until the upper timeframe candle finally closes.
To eliminate repainting, set UseMTF in the chart settings to "NO".
To not show the Jitter zone, set ShowJitterZone to "NO"
 

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
382 Online
Create Post

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

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.

How do I get started?

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.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top