Which Oscillators For Which Market Conditions?

PKPet

Member
VIP
There are many different oscillators available each to be used under different market conditions. The 2 major market conditions are ranging and trending. Different time frames, support and resistance have been advocated to determine the difference. What is the most accurate method of determining the type of market that exists to determine the oscillators to use. An example-SPY has trended all year. A simple above the midline of CCI 20 created a return of 12.72% versus a buy and return of 14.11% (long only). 2022 because of its volatility and failure to trend (long) until 11/1/2022 it was difficult to make money.
In summary, what/how to determine the type of market and based on that determination, what oscillators to use. Thanks
 
Last edited:
Solution
I am VIP. Looking to refine my approach. Since 3/9/2009, the market bottom, it has been easier to make money- your money has doubled every 5 years. With valuations, round trip accounting, opacity in funding the market expansion, etc. the market is going to be more challenging. So the next step for me is to create charts the allow me to follow the market type that you have outlined. I use BTD, AMM, SMI Ironrod, CCI 13, CCI 20,DMX, Heiken Ashi, your GHL Supertrend. I am interested in creating a chart to fit the market conditions using the myriad of studies that have been created here at USETOS. I am a Boglehead by design but the history of the market past (SPY declined 42% between 1/1/200 and 12/30/2002) is in my mind a real...
There are many different oscillators available each to be used under different market conditions. The 2 major market conditions are ranging and trending. Different time frames, support and resistance have been advocated to determine the difference. What is the most accurate method of determining the type of market that exists to determine the oscillators to use. An example-SPY has trended all year. A simple above the midline of CCI 20 created a return of 12.72% versus a buy and return of 14.11% (long only). 2022 because of its volatility and failure to trend (long) until 11/1/2022 it was difficult to make money.
In summary, what/how to determine the type of market and based on that determination, what oscillators to use. Thanks
Just my 2 Cents. (@merryDay and @useThinkScript are the gurus here - they will have better answers)
Stop guessing. Put the 200 EMA + ADX(14) on every chart. When ADX > 23 then trend-follow (MACD, CCI, RSI(14)). When ADX < 20 then mean-revert (RSI(2), CCI extremes, %B).
That’s how the big money actually does it. Everything else is noise. Here is a description on use and a script that you can use:
  • When the label says RANGING/CHOP and ADX < 20 turn off all trend-following systems and switch to:
    • RSI(2)
    • CCI(20) ←200 / →+200
    • Bollinger %B crosses
    • Fat Tony Composite extremes
  • When the label flips to STRONG UPTREND and ADX > 23 flip the switch back to MACD, CCI > 0, etc.
Code:
# MARKET REGIME DETECTOR + OSCILLATOR SWITCHER
declare lower;

def ema200 = ExpAverage(close, 200);
def adx14  = DMI(14).ADX;

def strongUp   = close > ema200 and adx14 > 23;
def strongDown = close < ema200 and adx14 > 23;
def ranging    = adx14 < 20;

# === AUTO-SELECTED OSCILLATOR ===
plot Signal =
     if strongUp or strongDown then MACD().Diff                    # trend = MACD hist
     else if ranging then RSI(length=2) - 50                        # chop = RSI(2)
     else Double.NaN;

Signal.AssignValueColor(
     if strongUp   then Color.GREEN
     else if strongDown then Color.RED
     else Color.YELLOW);

# LABELS – tells you exactly what regime you’re in
AddLabel(yes,
    if strongUp then "STRONG UPTREND → Use MACD/CCI/RSI(14)"
    else if strongDown then "STRONG DOWNTREND → Short momentum"
    else if ranging then "RANGING/CHOP → Use RSI(2)/CCI extremes/%B"
    else "Weak trend → Stand aside",
    if strongUp then Color.DARK_GREEN
    else if strongDown then Color.DARK_RED
    else if ranging then Color.ORANGE
    else Color.GRAY);

AddLabel(yes, "ADX(14): " + Round(adx14,1), Color.WHITE);
 
Here is Fat Tony's composite if you don't have it.... for those not VIP I would suggest joining the VIP there are other indicators there and some more coaching that will pull all of this together.
Code:
# ===============================================================
# Fat Tony's Composite Momentum Histogram – ULTIMATE TOS VERSION
# Now with predictive status + direction labels
# ===============================================================

declare lower;

# === INPUTS (same as before) ===
input length         = 14;
input fastLen        = 12;
input slowLen        = 26;
input sigLen         = 9;
input rocLen         = 10;
input stdevLen       = 200;

input obLevel        = 100;
input osLevel        = -100;

input useVolume      = yes;
input volSensitivity = 1.5;
input minVolume      = 50000;

input useROC         = yes;
input useTrendFilter = no;
input showDebug      = no;

# === CORE CALCULATIONS (unchanged – 100% working) ===
def ema200   = ExpAverage(close, 200);
def trendUp   = close > ema200;
def trendDown = close < ema200;

script tanh {
    input x = 0;
    def e2x = Exp(2 * x);
    plot result = (e2x - 1) / (e2x + 1);
}

def  hh = Highest(high, length);
def  ll = Lowest(low, length);
def wpr_raw = if (hh - ll) != 0 then (hh - close) / (hh - ll) * -100 else -50;
def  wr_c = wpr_raw + 50;

def k_raw = if (hh - ll) != 0 then (close - ll) / (hh - ll) * 100 else 50;
def k_c = k_raw - 50;

def macdValue = MACD(fastLength = fastLen, slowLength = slowLen, MACDLength = sigLen).Value;
def macdAvg   = MACD(fastLength = fastLen, slowLength = slowLen, MACDLength = sigLen).Avg;
def hist = macdValue - macdAvg;
def stdevHist = StDev(hist, stdevLen);
def macd_c = if stdevHist != 0 then tanh(hist / (2.0 * stdevHist)) * 50 else 0;

def atr14 = Average(TrueRange(high, close, low), 14);
def roc_raw = if close[rocLen] != 0 then (close - close[rocLen]) / close[rocLen] * 100 else 0;
def roc_norm = roc_raw / (atr14 / close);
def roc_c = Max(-50, Min(50, roc_norm));

def combo_raw = if useROC then (wr_c + k_c + macd_c + roc_c) / 4.0 else (wr_c + k_c + macd_c) / 3.0;

def volSMA20 = Average(volume, 20);
def volRatio_raw = if useVolume and volSMA20 > 0 then Min(Log(1 + volume / volSMA20) * volSensitivity, 2.0) else 1.0;
def volRatio = Average(volRatio_raw, 3);
def combo = combo_raw * volRatio;

def volAvg5 = Average(volume, 5);
def volumeOK = !useVolume or volAvg5 >= minVolume;

def longSignal  = volumeOK and Crosses(combo, osLevel, CrossingDirection.ABOVE)  and (!useTrendFilter or trendUp);
def shortSignal = volumeOK and Crosses(combo, obLevel, CrossingDirection.BELOW) and (!useTrendFilter or trendDown);

# === MAIN PLOT (unchanged) ===
plot Composite = combo;
Composite.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Composite.SetLineWeight(3);
Composite.AssignValueColor(
    if combo > obLevel then Color.RED
    else if combo < osLevel then Color.GREEN
    else if combo > 0 then Color.BLUE
    else Color.ORANGE
);

plot OB = obLevel;  OB.SetDefaultColor(Color.RED);    OB.SetStyle(Curve.SHORT_DASH);
plot Zero = 0;      Zero.SetDefaultColor(Color.GRAY);
plot OS = osLevel;  OS.SetDefaultColor(Color.GREEN);  OS.SetStyle(Curve.SHORT_DASH);

AddCloud(obLevel, Composite, Color.RED, Color.RED);
AddCloud(Composite, osLevel, Color.GREEN, Color.GREEN);

plot LongArrow  = if longSignal  then osLevel - 20 else Double.NaN;
plot ShortArrow = if shortSignal then obLevel + 20 else Double.NaN;
LongArrow.SetPaintingStrategy(PaintingStrategy.ARROW_UP);   LongArrow.SetDefaultColor(Color.GREEN); LongArrow.SetLineWeight(4);
ShortArrow.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN); ShortArrow.SetDefaultColor(Color.RED); ShortArrow.SetLineWeight(4);

# ===============================================================
# PREDICTIVE STATUS LABELS – This is the magic you asked for
# ===============================================================

def rising   = combo > combo[1];
def falling  = combo < combo[1];
def extreme  = AbsValue(combo) > 80;

AddLabel(yes,
    if longSignal then "LONG SIGNAL – ENTERING BULL MODE"
    else if shortSignal then "SHORT SIGNAL – ENTERING BEAR MODE"
    else if combo > obLevel and falling then "DANGEROUSLY OVERBOUGHT – Reversal Likely"
    else if combo > obLevel then "STRONG BULLISH – But Watch for Pullback"
    else if combo < osLevel and rising then "DANGEROUSLY OVERSOLD – Reversal Likely"
    else if combo < osLevel then "STRONG BEARISH – But Watch for Bounce"
    else if combo > 50 and rising then "ACCELERATING BULLISH"
    else if combo > 0 and rising then "BULLISH MOMENTUM BUILDING"
    else if combo < -50 and falling then "ACCELERATING BEARISH"
    else if combo < 0 and falling then "BEARISH MOMENTUM BUILDING"
    else if extreme then "EXTREME MOMENTUM – Possible Exhaustion"
    else "NEUTRAL / CHOP",
   
    if longSignal then Color.DARK_GREEN
    else if shortSignal then Color.DARK_RED
    else if combo > obLevel then Color.RED
    else if combo < osLevel then Color.GREEN
    else if rising then Color.CYAN
    else if falling then Color.MAGENTA
    else Color.GRAY
);

# Secondary label: Trend + Volume context
AddLabel(yes,
    (if trendUp then "Above EMA200 ↑" else "Below EMA200 ↓") + " | " +
    (if volumeOK then "Volume CONFIRMED" else "Low Volume"),
    if trendUp then Color.CYAN else Color.MAGENTA
);

# Tiny value label
AddLabel(yes, "Fat Tony: " + Round(combo, 1),
    if combo > obLevel then Color.RED
    else if combo < osLevel then Color.GREEN
    else if combo > 0 then Color.BLUE
    else Color.ORANGE
);

# === SCANNER PLOTS ===
plot scanLong  = longSignal;
plot scanShort = shortSignal;
scanLong.Hide(); scanShort.Hide();
 
I am VIP. Looking to refine my approach. Since 3/9/2009, the market bottom, it has been easier to make money- your money has doubled every 5 years. With valuations, round trip accounting, opacity in funding the market expansion, etc. the market is going to be more challenging. So the next step for me is to create charts the allow me to follow the market type that you have outlined. I use BTD, AMM, SMI Ironrod, CCI 13, CCI 20,DMX, Heiken Ashi, your GHL Supertrend. I am interested in creating a chart to fit the market conditions using the myriad of studies that have been created here at USETOS. I am a Boglehead by design but the history of the market past (SPY declined 42% between 1/1/200 and 12/30/2002) is in my mind a real possibility. Charts and account management hopefully reduce losses and inspire profit. Knowing when to Hold'em and when to fold'em is key.
In summary I want to build a chart with studies that allow me to trade a trending market and one that is ranging/chop. Thanks
 
I am VIP. Looking to refine my approach. Since 3/9/2009, the market bottom, it has been easier to make money- your money has doubled every 5 years. With valuations, round trip accounting, opacity in funding the market expansion, etc. the market is going to be more challenging. So the next step for me is to create charts the allow me to follow the market type that you have outlined. I use BTD, AMM, SMI Ironrod, CCI 13, CCI 20,DMX, Heiken Ashi, your GHL Supertrend. I am interested in creating a chart to fit the market conditions using the myriad of studies that have been created here at USETOS. I am a Boglehead by design but the history of the market past (SPY declined 42% between 1/1/200 and 12/30/2002) is in my mind a real possibility. Charts and account management hopefully reduce losses and inspire profit. Knowing when to Hold'em and when to fold'em is key.
In summary I want to build a chart with studies that allow me to trade a trending market and one that is ranging/chop. Thanks
Well like mention above the “charts” are never stagnant and the reason there are a varied number of indicators (really 4 or 5 families of same indicators) is that the market is ever changing, fluid and sometimes quite surprising. No one set of indicators will work all the time. I think the best advice I ever got was to “play the CHART in front of you”… meaning you cannot beat knowing and understanding how to read price action and it correlation with volume. Yes, the trend is your friend but in terms of entries and exits and future planning I think I would focus on picking 2-4 of my favorite stocks, learn their idiosyncrasies and patterns and trade them all the time. Of course strong high volume high liquidity option playing money making stocks are preferred. And I like dividend paying just in case I have to hold one of them. Somewhere in the VIP one of the gurus wrote up a nice answer to your question, maybe one of them will respond with its location. And just to say - you can’t beat the returns on playing a good game of futures like /ES or /MES or even some of the commodities.
 
Solution

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
1524 Online
Create Post

Similar threads

Similar threads

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