All indicators

Apirine Stochastic MACD w/ MA Selection

Nov 14, 2019

Static chart image
SignalsOscillatorsMoving Averages

The Apirine Stochastic MACD w/ MA Selection indicator combines the principles of the Stochastic Oscillator and the Moving Average Convergence Divergence (MACD) to create a momentum oscillator that defines overbought and oversold levels based on price momentum relative to a specific range.

Usage

The tool can be used to identify trend reversals and momentum shifts by observing the interactions between the Stochastic MACD (STMACD) line and its signal line.

  • Crossovers: A bullish signal is generated when the STMACD line crosses above the signal line, while a bearish signal occurs when it crosses below.
  • Overbought/Oversold: Users can define specific thresholds (defaulting to +10 and -10) to identify when the MACD-based momentum has reached extreme levels relative to the lookback period.
  • Visual Aids: The indicator supports bar coloring based on the current trade state (long vs. short bias) and includes a divergence display (histogram or columns) to visualize the distance between the STMACD and its average.

Details

This indicator is a port of Vitali Apirine's work featured in the November 2019 issue of Technical Analysis of Commodities (TASC), titled "The Stochastic MACD Oscillator."

Unlike the traditional Stochastic Oscillator which uses raw price, the STMACD calculates the stochastic position of two moving averages (fast and slow) relative to the high/low range of the lookback period. This approach normalizes MACD values, allowing traders to apply fixed overbought and oversold levels to a convergence/divergence calculation that is usually unbounded.

Settings

  • STMACD MA Type: Selects the moving average type used for the internal calculations (EMA, SMA, VWMA, or WMA).
  • Lookback Length: Sets the period used to determine the highest high and lowest low for the stochastic normalization.
  • Fast MA Length: The period for the fast moving average component.
  • Slow MA Length: The period for the slow moving average component.
  • STMACD Length: The period for the signal line (smoothing of the STMACD).
  • Enable Overbought / Oversold Zones?: Toggles the visibility of the extreme threshold bands and background fills.
  • Overbought Threshold: The upper level used to identify potentially overextended bullish momentum.
  • Oversold Threshold: The lower level used to identify potentially overextended bearish momentum.
  • Enable Bar Color by Trade?: When enabled, colors the price bars based on the most recent crossover signal.
  • Enable Divergence Display?: Toggles the visibility of the histogram/column component.
  • Divergence Display Style: Switches the visual representation of the histogram between Histogram or Columns.

FAQ

How do I access the Apirine Stochastic MACD w/ MA Selection?

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

What is the advantage of using a Stochastic MACD over a regular MACD?

The Stochastic MACD normalizes the MACD values into a fixed range, making it easier to identify overbought and oversold conditions which are not easily defined on a standard MACD.

Can I change the moving average type?

Yes, the indicator allows you to choose between EMA, SMA, VWMA, and WMA to better suit different market conditions or personal trading preferences.

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.