VibeFox Zscore Revert
- Indicators
- Version: 1.0
- Activations: 5
VibeFox Zscore Revert — the Z-score mean-reversion channel with automatic entry points
VibeFox Zscore Revert is a real-time mean-reversion indicator for MetaTrader 5. It measures how far price has strayed from its moving average in units of standard deviation — the classic Z-score — and draws a three-line channel right on the price chart: a middle mean line and two outer bands placed a chosen number of standard deviations away. When price stretches out to tag an outer band and then closes back inside, the indicator marks a mean-reversion entry, expecting price to snap back toward the center. Every control is gathered into one modern interactive panel.
How the indicator works
The engine is built on two standard statistical measures of the closing price. The mean (mu) is a simple moving average over the Period setting — this is the middle line, the value price is expected to revert to. The standard deviation (sigma) is computed over the Deviation Period and measures how volatile price is around that mean. The Z-score of any bar is simply Z = (price − mu) / sigma: the normalized distance of price from its mean, expressed in standard deviations.
The outer bands are placed at a fixed Z-score set by the Threshold: the upper band sits at mu + k·sigma and the lower band at mu − k·sigma, where k is the threshold in sigmas. When price touches an outer band, its Z-score has reached +/-k — a statistically stretched, over-extended state from which mean reversion is expected. The three band values are drawn as line objects directly on the price chart, while the indicator itself lives in its own subwindow, where the control panel sits.
The mean-reversion logic
Mean reversion is the idea that price, after an unusually large excursion away from its average, tends to return toward that average. Z-score turns this into a precise, unit-free measure: the further Z is from zero, the more stretched price is, and the stronger the pull back to the middle line.
The indicator turns a band tag into an entry only when price confirms the reversal by closing back inside the channel. A Revert BUY occurs when a bar's low pierces the Lower band (Z reaches −k) but the bar closes back above it — the down-stretch is rejected and a move back up toward the mean is expected. A Revert SELL is the mirror image: a bar's high pierces the Upper band (Z reaches +k) but the bar closes back below it — the up-stretch is rejected and a move back down toward the mean is expected. Signals are evaluated only on closed bars; the forming bar is ignored, so a marker never repaints once it is placed.
Entry points
The main value of VibeFox Zscore Revert is its automatic entries. When a reversion is confirmed on a closed bar, the indicator places a clear marker right on the price chart. The behavior is controlled by the Revert toggle, which enables the mean-reversion entries (both the BUY at the lower band and the SELL at the upper band). Turn it off to keep only the channel on screen without any markers.
Buy and sell markers are colored separately with the Buy and Sell color settings, so direction is read instantly. The Marker selector switches the glyph between a plain cross (+), filled triangles, or arrows with a tail, while the Size control scales the marker in pixels (6 to 40) to fit any chart density.
Full visual control
The three band lines are colored independently: Middle for the mean line, Upper for the upper band and Lower for the lower band, and the thickness of all three is set with Width from 1 to 5 pixels. Each band line and both entry markers support a transparency setting (0-100%) in the color picker popup, so you can blend them softly into the chart background or make them stand out sharply.
Interactive on-chart panel
The whole interface is a smooth canvas-based panel built for fast mouse control. The Z-score parameters are gathered into tidy rows, and the entry block is set apart with its own gold ENTRY heading, so signal settings do not get mixed up with line settings. The panel header holds the control icons.
Power — turns the drawing of entry markers on and off without removing the indicator from the chart.
Settings (gear) — opens and closes the settings section.
Updown (arrows) — moves the panel between its subwindow and the main chart.
Close (cross) — closes the indicator.
Resizable — drag the bottom-right corner to scale the panel.
Collapsible — a double click on the header collapses the panel into a compact strip.
Mouse wheel — hover over any numeric field and scroll the wheel to change the value without opening the keyboard.
Settings and personalization
The Settings button opens a section where the panel is fitted to your workspace: a light, dark or automatic Theme, an adjustable panel width, header size, row height and font size. Extra touches let you hide the bottom bar via Hide Footer, shrink the header when collapsed with Mini Header, and automatically collapse the panel on a click outside it. Almost every parameter changes live right on the panel — the input fields on the Inputs tab only set the starting values. You can also run several independent copies on one chart by giving each a unique Instance, to compare different settings side by side.
Entry notifications
You do not need to sit and guard the chart waiting for a reversion. Each entry can be sent through several notification channels that are enabled independently right on the panel.
Alert — a pop-up message inside the terminal.
Push — a mobile notification to the MetaTrader app on your phone.
Email — a letter sent through the terminal's mail settings.
Telegram — the alert text together with a chart screenshot, sent straight to your Telegram chat.
Enable only the channels you need, and you will be notified the moment a new reversion entry appears on the symbol and timeframe you are working with.
Visual history (HTML report)
Enable the Html channel, and every entry signal is saved to an HTML report together with a screenshot of the chart at the moment it fired. The report is stored in the terminal's Files folder, in the VibeFox_Zscore_Revert directory (MQL5/Files/VibeFox_Zscore_Revert/result.html), and opens in any browser — you get a visual log of all the reversions the indicator found. A one-click trash button clears the report and its screenshots whenever you want to start over.
Telegram Alerts
Signals can also be delivered straight to your Telegram chat — the alert text together with a screenshot of the chart at the moment of detection. Turn on the Telegram channel and enter your bot token and chat id in the inputs.
Delivery rides on the HTML report: each new signal is written into the report, and the report — opened in a browser — forwards it to your Telegram chat on its own. For this reason, enabling Telegram automatically keeps the Html report on, and the two channels work together.
Built-in multilingual help
A full help page is built into the panel, available in multiple languages, so every control is explained right where you use it.
Parameters (Inputs tab)
Most settings can also be changed live right on the panel (the Settings button) — the input parameters only set the initial values at startup.
Zscore Revert
Period (SMA mean / mu) — the period of the simple moving average used as the mean (middle line). Default: 20.
Deviation Period (sigma) — the period of the standard deviation used to size the bands. Default: 20.
Threshold (Z-score, k sigma) — the band distance in standard deviations; bands sit at mu +/- k·sigma. Default: 2.0.
Bars of history to process — how many bars back the channel and entries are computed, 0 = all available. Default: 200.
Middle Line Color — the color of the mean line. Default: DodgerBlue.
Middle Line Transparency — mean line transparency in percent, 0-100. Default: 0.
Upper Band Color — the color of the upper band. Default: OrangeRed.
Upper Band Transparency — upper band transparency in percent, 0-100. Default: 0.
Lower Band Color — the color of the lower band. Default: OrangeRed.
Lower Band Transparency — lower band transparency in percent, 0-100. Default: 0.
Line Width — the thickness of the band lines in pixels, 1..5. Default: 1.
Entry Points
Revert (return to mean from a band) — enables the mean-reversion entries (BUY at the lower band, SELL at the upper band). Default: on.
Marker Font Size — the size of the entry markers in pixels, 6..40. Default: 12.
Entry Marker — the marker glyph: Cross (+), Triangle, or Arrow. Default: Arrow.
Buy Color — the color of the BUY marker. Default: LimeGreen.
Buy Transparency — buy marker transparency in percent, 0-100. Default: 0.
Sell Color — the color of the SELL marker. Default: Red.
Sell Transparency — sell marker transparency in percent, 0-100. Default: 0.
Notifications
Push Notification — enables push alerts to the MetaTrader mobile app. Default: off.
Alert Popup — enables pop-up alerts inside the terminal. Default: off.
Email — enables email alerts through the terminal's mail settings. Default: off.
Html Report — saves each signal with a chart screenshot to Files/VibeFox_Zscore_Revert/result.html. Default: off.
Telegram — forwards signals with chart screenshots to a Telegram chat via the HTML report. Default: off.
Telegram - bot token — the token of the Telegram bot used for delivery. Default: empty.
Telegram - chat id — the target Telegram chat identifier. Default: empty.
Panel / Settings
Panel width, px — the width of the on-chart panel in pixels, 300..800. Default: 800.
Header size — the height of the panel header, 1..6. Default: 1.
Theme — the color theme of the panel: Light, Dark, or Auto. Default: Auto.
Row height (px) — the height of each parameter row in pixels. Default: 34.
Font size — the font size used inside the panel. Default: 8.
Hide Footer — hides the bottom bar of the panel. Default: off.
Mini Header on collapse — shows a compact header strip when the panel is collapsed. Default: off.
Close on click outside — automatically collapses the panel when clicking outside it. Default: off.
Instance — a unique number for each copy of the indicator on the same chart, allows running multiple instances side by side. Default: 1.
Panel Start Window — sets the initial position of the panel: main chart or subwindow. Default: Subwindow.
