ML Momentum Oscillator (MLMO): kNN Momentum Guide

Machine Learning


short answer

Machine Learning Momentum Oscillator (MLMO) uses the k-nearest neighbor (kNN) algorithm to read momentum. will be drawn in the pane below the price green candle If the raw forecast exceeds the smoothed version (bullish), and red candle If below (bearish) within a dynamic range bounded by a large ceiling and a small trough. Rather than a single candlestick, we trade continuous candlesticks of the same color that push towards a larger (long) or smaller (short). Sahi is free and does not require a subscription.

overview

Machine learning momentum oscillator k-nearest neighbor (kNN) algorithm Read the momentum. We calculate two momentum signals on each bar (a faster “bearish” signal and a slower “bullish” signal) and find the most similar past N bars from the entire chart history. The directions of these neighbors are then voted together into a single predicted value. The result is an oscillator that adapts its shape to the observed data rather than using a fixed formula. That is, it smoothes out random noise while responding to actual momentum changes.

In a separate pane below the chart, the indicator draws a row of candlesticks created from the raw forecast and the smoothed version of that forecast. The background of the oscillator is a gradient that goes from red near the top of the historical range to blue near the bottom. When you turn on the optional prediction lines, two additional line and band overlays (orange and cyan) appear in the pane.

How to read the indicators

Oscillator candle (main visual)

indicator draws candle It will appear inside the oscillator pane instead of as a plain line. The open and high prices of each candlestick are the raw ML predicted values. Its close and low prices are a smoothed version of that forecast.

  • green candle Raw predictions are displayed when: On top of that It’s smooth. This means that the ML engine currently favors bullish momentum and is accelerating upward from a smoothed base.
  • red candle Raw predictions are displayed when: or less It’s smooth. The ML engine is favoring bearish momentum or slowing down.

Gradient strength tracks where the current forecast falls across the historical range. A lighter shade means the measurements are more extreme compared to what was previously seen on that chart.

Dynamic floor and ceiling (big lines/small lines)

Two faint white lines run across the pane. The line above shows the mark big (highest ever smoothed forecast on that chart) and lower ones marked small (lowest ever). These lines move outward over time as the chart history grows. Think of these as dynamic overbought and oversold lines. When the candlestick pushes up near BIG, the oscillator is at its historically extended bullish extremity. When they push down almost small, momentum reaches a historically extended bearish peak.

background gradient fill

The entire space between the large line and the small line is Gradient with red at the top and blue at the bottom. This background is purely visual context. You can see at a glance how high or low the current candlestick is within its historical range without having to read the numbers.

You should see a faint white buffer fill just above BIG and just below S. These indicate inflated zones above historical extremes and do not make trading sense.

Amber flatline fill (prediction = smooth marker)

There is instantaneous equilibrium when the raw prediction is exactly equal to its smoothed value. Amber/Golden Fill appears between the two. This is rare and short. Treat it as a “pause at decision point” signal rather than as a directional signal in itself.

Prediction line (optional, off by default)

when Show prediction line When turned on, two sets of line and band overlays appear within the oscillator pane.

  • Amber line + amber band (color #efb906): Bull period momentum signal (Prime1) with a channel that shows how far the price moves within the band derived from the ATR. If this line is rising and the band is wide, the bullish momentum entering kNN is strong.
  • Cyan line + teal band (Color #08d3ed): Bearish period momentum signal with its own channel (Prime2). When this line is descending and the band is widening, bearish inputs become dominant.

When Forecast Lines are turned on, the relative positions of the top and bottom of the orange line are the most interesting things to notice when the Forecast Lines are displayed. Orange above cyan is the same condition that produces green candlesticks.

Example scenario

Scenario 1 — Green candle coming towards BIG, buy CE (bullish)

Nifty is consolidating around 24,920 after falling in the morning. The MLMO pane shows: A series of three green candles It rose from midrange to a distance that touched a large ceiling. The close price (smoothed value) of each candlestick is higher than the close price of the previous bar, confirming that the ML vote is building bullish momentum and not just a one-bar spike.

  • what you do: purchase 1 lot of Wonderful year 25,000 AD At a premium of about ₹105.
  • Stop loss: If the next candlestick turns red and closes below the midpoint of the large and small, the bullish reading will reverse and end. Premium is approx. ₹68 There.
  • target: If the oscillator remains green, Nifty will move towards 25,080. CE Premium is approximately: ₹160.
  • Why it works: Three consecutive green candles near the top of the ML range means that the kNN engine has strong historical agreement that this momentum pattern is bullish and not just a 1-bar spike.

Scenario 2 — Red candle looming towards small size, buy PE (bearish)

Nifty is trading around 25,050, reversing from its morning high. The MLMO pane shows: Four red candles lined up It fell from above the midrange to near the small (floor) line. The candlestick is dark red (deep gradient), meaning that the forecast is close to the historical bearish extremes compared to all previous data on the chart.

  • what you do: purchase 1 lot of Nifty 25,000 PE At a premium of about ₹95.
  • Stop loss: If the candlestick turns green and closes above the midpoint of the range, the bearish vote will reverse and exit. Premium is approx. ₹60 There.
  • target: Nifty fell to 24,870. The PE premium is approximately: ₹150.
  • Why it works: The red candle looming near a historic bottom means kNN has found the most bearish momentum cluster we’ve seen on this chart, giving the move more statistical weight than a simple indicator crossover.

Scenario 3 — What to avoid

  • Do not act on a single red or green candle. One candle is one vote. The kNN signal is meaningful when it maintains direction, that is, two or more consecutive candles of the same color in the same zone. When a single candle changes color and then back again, it’s noise, not a signal.
  • Do not trade when the candlestick is floating in the middle of the range. If the prediction is between 40% and 60% of the small and large range (neither near the upper limit nor near the lower limit), the ML engine does not have a strong historical match in either direction. Wait until the candlestick convincingly heads towards BIG or SMO before committing.
  • Be careful immediately after opening the chart or changing the time frame. kNN requires a sufficient history of bars to construct a meaningful neighborhood pool. On a newly loaded chart, or a very high timeframe with few bars, the large and small lines will be close together and the slope will be compressed. Signals in this state may not be reliable until the history pool grows.
  • Don’t rely solely on the amber flatline fill. The golden equilibrium fill only shows 1-2 bars and does not indicate direction. You will notice that the engine is paused, not that the engine is moving in reverse.

Settings panel guide

ML core settings

  • Bear period: The length of the EMA used to calculate faster (short-term) momentum inputs. The default is 26. The higher the number, the slower and smoother this input will be. The lower the number, the higher the reactivity. For the Nifty intraday 5-minute chart, the default of 26 works well. Lowering it to 18-20 increases sensitivity, but can make the candle color inversion more noisy.
  • Bullish period: The length of the EMA used to calculate slow (long period) momentum input. The default is 14. Despite the “bull” label, this controls long signals. The two periods are named based on which direction the original algorithm primarily provides results. To maintain the default relationship, keep bullish periods lower than bearish periods.
  • Smoothing period: Applied twice. The first time is to smooth each raw momentum input, and the second time is to generate a smoothed forecast line that forms the close/low price of the candlestick. The default is 13. Increasing it (to 20-21, for example) will produce a gentler, slower oscillator with less color inversion. Reducing this (to 8, for example) will make the candle more responsive, but noisier. If BankNifty is intraday, try 8-10 to keep up with its fast fluctuations.
  • Number of neighbors: The number of nearest past bars that the kNN algorithm uses to vote. The default is 50. More neighborhoods (e.g., 80 to 100) produce more conservative, consensus-driven predictions that change direction more slowly. A small number of neighbors (e.g. 20-30) will make the oscillator faster, but it will also be more prone to false inversions. On unstable days, a higher count will more effectively filter out single session outliers.

screen

  • Show predicted line: When you turn on Amber (bullish period) and Cyan (bear stage) A momentum line containing ATR-derived channels is displayed in the oscillator pane. The default is off. Turn on if you want to see which of the two momentum inputs is dominant or how wide the current volatility band is. If you only need the candle direction, turn it off to make the pane easier to see.



Source link