Where μ is the mean of 14-period price changes and σ is the standard deviation. The output is then clamped to a range of -3 to +3 and converted to a percentage:
//@version=6 indicator("Xhmaster Formula Indicator", overlay=true) // Parameters length = input.int(22, "ATR Length") multiplier_base = input.float(1.5, "Base Multiplier") Xhmaster Formula Indicator
// Normalized Momentum Oscillator (NMO) period_mom = 14 price_change = close - close[period_mom] mean_change = ta.sma(price_change, period_mom) std_change = ta.stdev(price_change, period_mom) nmo_raw = (price_change - mean_change) / std_change nmo = (nmo_raw + 3) / 6 * 100 Where μ is the mean of 14-period price
A signal is considered "valid" only if price closes outside the envelope for two consecutive bars. This eliminates the majority of whipsaws. The Xhmaster outputs three states: The Xhmaster outputs three states: The "Formula" aspect
The "Formula" aspect comes from the weighted scoring: each layer contributes a specific point value (Trend = 40 points, Momentum = 35 points, Volatility = 25 points). A score above 85 triggers the . Implementation (Pine Script v5 Example) Here is a working implementation of the core Xhmaster logic for TradingView:
// Plotting plotshape(strong_buy, title="Strong Buy", location=location.belowbar, style=shape.triangleup, size=size.small, color=color.new(color.green, 0)) plotshape(strong_sell, title="Strong Sell", location=location.abovebar, style=shape.triangledown, size=size.small, color=color.new(color.red, 0))
Disclaimer: Past performance does not guarantee future results. Always backtest any indicator on historical data before live deployment.