Neuron Squeeze Momentum
- インディケータ
- バージョン: 1.20
Neuron Squeeze reads the volatility cycle. Bollinger Bands contracting inside the Keltner Channels is the signature of a market storing energy; the bands pushing back outside is the signature of a market spending it. This indicator marks both states bar by bar on the zero line, drives a four-colour linear-regression momentum histogram that shows which side is in control and whether that control is building or bleeding away, and grades the depth of every coil on a panel so a shallow pause never reads like a real one. It is an indicator for chart analysis only: it draws on the chart, it does not place, modify or close trades, it does not send orders, and it does not manage positions or accounts.
The squeeze itself is a well-known volatility method; what is added here is the grading, the state duration, the momentum meter and an alert engine that fires on the bar the coil releases rather than leaving you to watch for it. Native MQL5, no DLLs, closed bars are final, and it runs on forex, gold and metals, indices and crypto across any timeframe.
=== HOW IT WORKS ===
Two envelopes are measured over the same window, and they measure different things. The Bollinger Bands are built from the standard deviation of closing prices, so they widen when closes stray from their own mean. The Keltner Channels are built from average True Range, so they widen when bars themselves get tall. Comparing the two asks a precise question: is price oscillating in a band narrower than the size of recent bars would imply? When the answer is yes, the market is coiling.
That comparison produces three states, and every bar carries the marker for its own state. Squeeze ON means the Bollinger Bands sit entirely inside the Keltner Channels — compression, and the stand-by condition. Squeeze OFF means the bands have expanded back outside the channels — the coil has released. No squeeze means bands and channels are crossed and no clean reading exists.
Momentum is not price minus a moving average. Price is first detrended against the whole recent structure: the midpoint between the highest high and the lowest low of the window is averaged with the simple moving average of closes, and that composite centre is subtracted from the close. A least-squares regression is then fitted across the window of those detrended values and read at its endpoint. The result reacts to where price sits relative to both the extremes and the mean of its own range, and the regression endpoint smooths the series without the lag a moving average would add.
The histogram carries two facts in one colour. Above or below zero gives the side in control; bright or dark gives whether the reading is accelerating or fading. Because a bar dims as soon as momentum stops extending, the warning appears while the histogram is still on its own side of zero — before the cross, not after it.
The compression meter turns the yes/no squeeze into a number. It measures the Bollinger width against the Keltner width, so a coil that has collapsed to a third of the channel reads very differently from one that has just slipped inside it. Once the squeeze fires, the same meter flips to expansion and grades how far outside the channels the move has carried, so the reading stays live through the whole cycle instead of sitting at zero between coils.
The classic preset reproduces the rendering traders already know from the widely-used public implementation of this method, in which the Bollinger deviation is scaled by the Keltner multiplier. Switch it off and the Bollinger deviation input is used instead, giving a textbook 2.0 band. The preset is on by default so charts match what you are used to.
=== WHAT IS INCLUDED ===
| Module | What it does |
|---|---|
| Squeeze markers | A marker on the zero line for every bar, coloured by state: squeeze on, squeeze off, or no reading. The run of markers is the coil, and its length is visible at a glance. |
| Momentum histogram | Linear-regression momentum in four colours — above zero rising and fading, below zero falling and fading — so direction and the change in direction are read from one bar. |
| Compression meter | Bollinger width measured against Keltner width and shown as a percentage with a bar. Grades how deep the coil is while it holds, then flips to expansion once it fires. |
| State & duration | SQUEEZE ON, FIRED, EXPANDED or NEUTRAL with the number of bars the state has held. A twenty-bar coil and a three-bar pause stop looking alike. |
| Momentum meter | The current histogram value scaled against the last hundred bars, tagged fade the moment acceleration stops, so strength is read in context rather than in absolute numbers. |
| Signal panel | The Neuron panel on the price chart, one of nine anchors, scalable from 70% to 250% for any screen. Reads closed bars only. |
| Light & dark themes | Two tuned palettes, not one palette dimmed. A sun/moon icon in the panel header switches between them live. |
| Adaptive markers | Zero-line marker colours fit themselves to a light or dark chart background instead of vanishing into it, and follow along when the chart theme changes. |
| Alerts | Squeeze release, squeeze start and momentum zero-cross, each switchable on its own, by terminal popup, phone push notification or email. Evaluated on closed bars, once per bar. |
| EA buffers | Squeeze state and compression exposed as plain numeric buffers, readable by an Expert Advisor with a single CopyBuffer call. |
=== HOW TO READ IT ===
While the squeeze markers hold, the market is coiling and nothing needs to be done. Read the compression percentage and the bar count together: a high reading held for many bars is a market that has wound tight, and those are the releases worth waiting for. A shallow reading that lasts three bars is a pause, not a setup.
The first bar whose marker changes from on to off is the release. The histogram at that moment gives the direction the market chose, and the momentum meter says how strong that choice is against the last hundred bars. A release into a bright, extending histogram is the market committing; a release into a dim histogram near the bottom of its own range is the coil leaking rather than breaking.
While the move runs, the histogram is the thing to watch. Bright bars mean momentum is still extending. The first dark bar is the first sign that it is not, and it appears before the histogram crosses zero — which is the entire reason the colour is split four ways instead of two.
The panel and every plotted value are read from the last closed bar, so what you see on a completed bar is what it will still show tomorrow.
=== INPUTS ===
| Setting | Default | What it does |
|---|---|---|
| Calculation | ||
| Bollinger Bands period | 20 | Lookback for the Bollinger basis and its deviation. Higher gives fewer and broader squeezes. |
| Bollinger Bands deviation | 2.0 | Standard-deviation multiplier. Used only when the classic preset is off. |
| Keltner Channel period | 20 | Lookback for the channel midline, its range average, and the momentum regression window. |
| Keltner Channel multiplier | 1.5 | Range multiplier setting channel width. Lower makes the channels tighter and squeezes rarer. |
| Keltner uses True Range | true | True Range for the channel width; off uses plain high minus low, which ignores gaps. |
| Classic preset | true | Scales the Bollinger deviation by the Keltner multiplier, reproducing the familiar rendering of this method. |
| Dashboard | ||
| Show dashboard | true | Show the state, compression and momentum panel on the price chart. |
| Dashboard position | Bottom Left | One of nine chart anchors. |
| Dark mode | true | Initial theme; the sun/moon icon in the header toggles it live. |
| Dashboard size % | 100 | 70 to 250. Scales the whole panel — text, meters and padding together — for 4K screens or small laptops. |
| Appearance | ||
| Momentum above zero, rising | Lime | Bullish and accelerating. |
| Momentum above zero, falling | Green | Bullish but fading. |
| Momentum below zero, falling | Red | Bearish and accelerating. |
| Momentum below zero, rising | Maroon | Bearish but fading. |
| Marker: no squeeze | Blue | Bands and channels crossed. |
| Marker: squeeze ON | White | Compression active. |
| Marker: squeeze OFF | Gray | Compression released. |
| Histogram width | 4 | Thickness of the momentum bars, 1 to 5. |
| Marker width | 2 | Thickness of the zero-line markers, 1 to 5. |
| Marker symbol | 251 | Wingdings character code. 159 gives a dot, 89 gives a cross. |
| Auto-fit marker colour | true | Adapts marker colours to a light or dark chart background so they never disappear into it. |
| Alerts | ||
| Alert on squeeze release | true | Fire on the bar the coil releases, naming the momentum direction. |
| Alert on squeeze start | false | Fire when compression begins. |
| Alert on momentum zero-cross | false | Fire when the histogram changes side. |
| Terminal popup alert | true | Popup in the terminal. |
| Push notification to phone | false | Mirror alerts to the MetaTrader app. |
| Email alert | false | Mirror alerts to the email configured in the terminal. |
Fixed internals, not exposed as inputs: the standard deviation is a population figure divided by N, the regression is read at its endpoint with no offset, the momentum meter scales against the last hundred bars, and a released squeeze reads as FIRED for five bars before settling to EXPANDED.
=== GOOD TO KNOW ===
- Closed bars are final — once a bar closes, its histogram value, its colour and its marker are fixed and are never redrawn. The forming bar updates live as price moves, exactly as on any oscillator, so read signals from the close if you want confirmed readings only. The panel ignores the forming bar entirely.
- Indicator, not an EA — Neuron Squeeze analyses and draws. It does not place, modify or close orders, and it makes no forecast of price. The decision, the risk and the sizing are yours.
- Alerts behave — each event is evaluated once per closed bar and never fires twice for the same bar, loading history never produces a burst of stale alerts, and everything is muted inside the Strategy Tester and during optimization.
- For EA developers — buffer 4 carries the squeeze state (0 none, 1 on, 2 off) and buffer 5 the compression percentage, positive while the bands are inside the channels. Buffer 0 is momentum and buffer 1 its colour index. All are readable with iCustom and CopyBuffer.
- Platform — MetaTrader 5, any symbol and any timeframe. The oscillator plots in its own sub-window; the panel is drawn through the built-in Canvas on the price chart. No DLLs, no file access, no network calls.
- Light & dark — one click re-themes the panel, each mode with its own palette rather than a dimmed copy of the other, and the zero-line markers fit themselves to your chart background independently.
- Settings — the defaults of 20, 2.0, 20 and 1.5 are the standard values and a sound start on any instrument. Higher timeframes give fewer and cleaner coils; lower timeframes give more of them, and more noise with them.
