All indicators

CM Stochastic Multi-TimeFrame

Oct 23, 2014

Static chart image
SignalsOscillatorsTime Based

The CM Stochastic Multi-TimeFrame indicator provides a versatile implementation of the Stochastic oscillator, allowing users to track momentum across multiple timeframes and apply strict or broad filtering for crossover signals. It serves as a comprehensive momentum tool designed to identify overbought or oversold conditions while offering visual cues for potential trend reversals.

Usage

The Usage section describes how the script can be used to identify trend exhaustion and momentum shifts. Users can utilize the primary Stochastic lines (K and D) to monitor price momentum relative to a specific range.

  • Multi-TimeFrame Analysis: By default, the script uses the current chart resolution, but users can lock the indicator to a higher timeframe (e.g., viewing 1-hour Stochastic values on a 5-minute chart) to ensure they are trading in the direction of the higher-order trend.
  • Signal Filtering: The indicator distinguishes between "Strict" and "Any" crosses. A strict cross occurs only when the Stochastic K and D lines intersect within the overbought or oversold zones (defined by the upper and lower lines). "Any" crosses trigger whenever K and D intersect, regardless of their position relative to the boundaries.
  • Visual Overlays: Background highlights and "B"/"S" labels can be enabled to quickly spot when the Stochastic enters extreme zones or when a valid crossover has occurred.
  • Secondary Plotting: Users can enable a second Stochastic overlay with different settings or timeframes to compare momentum speeds or look for confluence between two different Stochastic configurations.

Details

The script calculates the Stochastic Oscillator by determining where the current close falls within the high-low range of a specified period. The K line is the smoothed result of this calculation, and the D line is a moving average of K.

The implementation utilizes the request.security function to fetch data from different resolutions, ensuring the multi-timeframe functionality remains accurate. When strict criteria are enabled, the script checks if a crossover happens specifically while the K line is below the Lower Line (for buys) or above the Upper Line (for sells), helping to filter out noise in the middle of the range.

Settings

Main Stochastic Settings

  • Length for Main Stochastic: The period used to calculate the raw Stochastic value.
  • SmoothK for Main Stochastic: The smoothing factor applied to the raw Stochastic to create the K line.
  • SmoothD for Main Stochastic: The period for the moving average of K to create the D line.

Thresholds and Visuals

  • Upper Line Value: Defines the overbought boundary (typically 80).
  • Lower Line Value: Defines the oversold boundary (typically 20).
  • Show Mid Line: Toggles the visibility of the 50-level median line.
  • Show Background Highlights When Stoch is Above/Below High/Low Lines: Colors the background when the oscillator is in extreme zones.
  • Show Background Highlights/Letters (Strict): Enables visual signals for crossovers occurring only in extreme zones.
  • Show Background Highlights/Letters (Any Cross): Enables visual signals for every crossover regardless of zone.

Multi-Timeframe Settings

  • Use Current Chart Resolution: When checked, the indicator matches the chart's timeframe.
  • Use Different Timeframe: Allows the selection of a specific timeframe for the main calculation if the "Current Resolution" box is unchecked.

2nd Stochastic Settings

  • Show 2nd Stoch: Toggles the visibility of an additional Stochastic oscillator.
  • Use 2nd Stoch Plot On Same Timeframe: Determines if the second oscillator uses the current chart timeframe or a custom one.
  • 2nd Stoch Length/SmoothK/SmoothD: Independent settings for the secondary oscillator calculation.

FAQ

How do I interpret the 'B' and 'S' labels? The "B" (Buy) and "S" (Sell) letters indicate Stochastic crossovers. Depending on your settings, these will either show every time the K line crosses the D line or only when those crosses happen in the overbought/oversold regions.

Can I view daily Stochastic levels on a 15-minute chart? Yes. Uncheck "Use Current Chart Resolution" and set the "Use Different Timeframe" input to "D" or "1D".

How can I get access to this indicator? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.