Sideways Indicator for ThinkorSwim - Avoid Trading in Choppy Markets

A

Alex

Member
VIP
I am looking for the best indicator to avoid getting chopped in a trade. Any suggestions are much appreciated!
 
S

soary

Member
@mc01439 None of them come up on TOS it has error message saying ref appears to be broken.
 
D

dannoh99

New member
VIP
Can anyone help me find a way to turn this indicator to a scan?
 
BenTen

BenTen

Administrative
Staff
VIP
@dannoh99 Here you go:

 
BenTen

BenTen

Administrative
Staff
VIP
@Greenbacks Yes, the good thing is that it should work without any additional modification. Just make sure to set the correct timeframe you want to use for the watchlist column.
 
S

satyarishi

New member
VIP
How to filter stocks that don't have any activity recently, in other words, stocks that has choppy buy/sell on any day.
 
T

thealphabreed

Member
Thanks man. Can you edit the code so that I dont see the lower study, but only a text such as "Market Sideways " or "Market Choppy" displays on the top left of the chart, and the candle color changes as you have already done?
 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
@thealphabreed Here is the modified code, removed the lower study and only highlight choppy candles on your chart:

Code:
# Sideways Indicator
# Original Code developed by WalkingBallista
# Concept and Idea by BenTen at useThinkScript.com
# Identify choppy market. Can also be used to find consolidation/breakout patterns.
# Version 1.0 (read changelog in the forum)

input length = 14;
input averageType = AverageType.WILDERS;
input price = close;

def hiDiff = high - high[1];
def loDiff = low[1] - low;

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, close, low), length);
def "DI+" = 100 * MovingAverage(averageType, plusDM, length) / ATR;
def "DI-" = 100 * MovingAverage(averageType, minusDM, length) / ATR;

def range = AbsValue(AbsValue("DI+")-AbsValue("DI-"));

# Define Consolidation Range
# Change the number 5 to 10 if you want more sideways filter
AssignPriceColor(if range < 5 then Color.Yellow else Color.Current);
 
T

thealphabreed

Member
Thanks @BenTen You rock!
On a sidenote, which timeframe, in your experience, is best for trading (daytrading).
I have been struggling to choose between 1 min and 5min
1min gives so many false moves
and with 5min, the price breaks out, but then reverses 10-20c (sometimes) before making a move up again.
Any suggestions/advise would help!
 
BenTen

BenTen

Administrative
Staff
VIP
@thealphabreed This indicator will only help you identify period of choppiness, it does not predict the direction.
 
T

thealphabreed

Member
@thealphabreed This indicator will only help you identify period of choppiness, it does not predict the direction.
I am aware of that. But my timeframe question wasn't about this indicator.
 
BenTen

BenTen

Administrative
Staff
VIP
@thealphabreed You should be looking at multiple timeframes, especially the higher timeframe. The 5min is the smallest timeframe I would go to.
 
T

thealphabreed

Member
@thealphabreed You should be looking at multiple timeframes, especially the higher timeframe. The 5min is the smallest timeframe I would go to.
I kind of agree with the 5min. Then why do the so-called popular trades focus so much on 1min scalping?
 
F

freedom Traders

New member
VIP
Is there anyway to use this without the bottom oscillator...
 
Thread starter Similar threads Forum Replies Date
N Finding stocks on sideways trend Questions 11
V Sideways Price Action Questions 0
W Pre-market scanner for stocks moving sideways? Questions 2
G True Center Band Indicator for ThinkorSwim Indicators 0
M Pivot Points Label Indicator Questions 1

Similar threads

Top