Indicator help: Stochastic Momentum Index formula from Pro Real Time

Forums ProRealTime English forum ProBuilder support Indicator help: Stochastic Momentum Index formula from Pro Real Time

Viewing 3 posts - 1 through 3 (of 3 total)
  • #244394

    Hi Folks!

    I am trying to write up some coding for an automated bot, and would love some assistance!

    Its for the Stochastic Momentum Index, the default settings, from the chart, when I go add indicator > see all indicators > Stochastic Momentum Index.

    I looked at the indicator from the prorealcode site and it doesn’t give me much information. I looked around for it and was unable to find a definitive solution as to what formula/code the chart on the platform is using.

    I was thinking the closest I could get was with williamblaus stochastic, but wasn’t quite matching up.

    If anyone can help me with this would be greatly appreciated!!

    Thanks

    #244418

    Here are some definitions and formulas. See also the attached pics.

    Stochastic Momentum Index

    Investopedia:

    “The Stochastic Momentum Index (SMI) is a more refined version of the stochastic oscillator, employing a wider range of values and having a higher sensitivity to closing prices.

    The SMI is considered a refinement of the stochastic oscillator. It calculates the distance of the current closing price as it relates to the median of the high/low range of price. William Blau developed the SMI, which attempts to provide a more reliable indicator, less subject to false swings.

    The SMI has a normal range of values between +100 and -100. When the present closing price is higher than the median, or midpoint value of the high/low range, the resulting value is positive. When the current closing price is lower than that of the midpoint of the high/low range, the SMI has a negative value.

    Like the stochastic oscillator, the SMI is primarily used by traders or analysts to indicate overbought or oversold conditions in a market. It is used with volume indicators to show if the momentum carries significant selling or buying pressure.

    Traders also use the SMI as a general trend indicator, interpreting values above 40 as indicative of a bullish trend and negative values greater than -40 as showing a bearish trend.”

    TrendSpider:

    “The SMI is calculated similarly to the stochastic oscillator but uses a broader range of values and is more sensitive to closing prices. The SMI is calculated by taking the difference between the current closing price and the median high/low price range over a specified period. This difference is then divided by the absolute value of the high/low range and multiplied by 100.

    The SMI generates two lines: the SMI line and the signal line. The SMI line represents the momentum of the asset’s price, while the signal line is a moving average of the SMI line, typically calculated over three days.”

    Tradingview:

    “Calculation

    First, we calculate the highest and lowest values in the window (defined by the “%K Length” input in the indicator settings). We subtract their average from the current close to get the “relativeRange” of those values:

    highestLowestRange = highestHigh – lowestLow

    relativeRange = close – (highestHigh + lowestLow) / 2

    After that, we calculate the SMI value, which can be calculated with the following formula:

    smi = 200 * (emaEma(relativeRange, lengthD) / emaEma(highestLowestRange, lengthD))

    Where ‘lengthD’ is the value from the “%D Length” input in the indicator’s settings, and “emaEma” is an Exponential Moving Average of an Exponential Moving Average (both calculated with the same length):

    emaEma(source, length) => ta.ema(ta.ema(source, length), length)”

    1 user thanked author for this post.
    #244421

    This is my custom SMI:

     

    2 users thanked author for this post.
Viewing 3 posts - 1 through 3 (of 3 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login