Volatility Term Structure Panel
A single ATR or standard-deviation reading tells you how big the current move is, but not whether that is unusual for right now versus the recent past. This panel computes realised volatility - the standard deviation of log returns, expressed as a percentage - over a short, medium and long window, then compares the short reading to the long one as a ratio. When the short-window figure sits well above the long one, activity is expanding: the market has picked up a pace that the longer window has not yet caught up to. When the short figure sits well below the long one, the opposite is true - a recent lull sits inside a longer window that still carries an older, larger swing. Reading three windows together, rather than one number in isolation, is what a genuine term structure comparison requires; a single volatility reading cannot tell you which side of that transition the market is currently on. The panel updates on every tick from fully closed bars only, so the figures shown never depend on the still-forming bar and cannot revise after the fact. Despite the "term structure" name, all three windows are measured on the chart's own single timeframe - this compares three bar-count lengths, not three different chart periods, and needs no multi-timeframe handle logic on either platform. Notes and limitations - Realised volatility here uses simple log-return standard deviation, not a range-based estimator - it is a close-to-close read and shares that method's blind spot to large intrabar excursions. - The three windows are independent snapshots, not a fitted curve; this is a practical three-point comparison, not a full econometric term-structure model. - The medium window is informational only and does not affect the EXPANDING/COMPRESSING classification. - This does not predict direction - only whether the pace of movement is currently above or below its own recent norm.
Indicator · MT5 · v1.0 · Free
About Volatility Term Structure Panel
Volatility Term Structure Panel is an indicator for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 10 settings, such as Short period, Medium period and Long period. MQL source code included.
Files in the download: VolatilityTermStructurePanel.ex5, VolatilityTermStructurePanel.mq5, VolatilityTermStructurePanel.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Short period | 10 | Short window, bars, for realised volatility |
| Medium period | 20 | Medium window, bars |
| Long period | 50 | Long window, bars |
| Expand ratio | 1.2 | Short/long ratio at or above this = "expanding" |
| Compress ratio | 0.8 | Short/long ratio at or below this = "compressing" |
| Corner | CORNER_LEFT_UPPER | Panel corner |
| X distance | 10 | Panel horizontal offset, pixels |
| Y distance | 20 | Panel vertical offset, pixels |
| Font size | 10 | Panel font size |
| Alerts | true | Alert once per closed bar on a regime change |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: ATR · Alerts · MT5 Indicator · MQL5 Source Code