VIDyA
VIDyA is an exponential moving average whose smoothing factor is multiplied, every bar, by the absolute value of a normalised Chande Momentum Oscillator. That multiplier sits between 0 and 1, so the line can never be faster than the EMA of the same period — and when the recent ups and downs cancel out it is exactly zero and the line stops moving altogether.
- Smoothing ceiling
- 0.1538
- Average of ceiling
- 31.4%
- Warmup bars
- 20
示意性 — 合成資料,非即時報價。
What VIDyA tells you
Take an exponential moving average and, on every bar, multiply its smoothing factor by how one-sided the recent price changes have been. When the last few bars all went the same way the multiplier is near one and the average behaves like the EMA it was built from. When the ups and downs cancel out the multiplier collapses toward zero and the average barely moves — at exactly zero it does not move at all. The knob people expect to be about volatility is not: the multiplier is a ratio with the size of the moves in both halves, so it is scale-free. Multiply every price change in a series by a hundred and the smoothing factor comes out identical to eight decimal places.
- The factor is capped at the EMA's own — VIDyA is never faster than the EMA of the same period
- It is scale-free: bigger moves do not speed it up, more one-sided moves do
- In a balanced stretch the factor reaches zero and the line freezes
- 1 Measure how one-sided the last CMO-period changes were, as a number from 0 to 1
- 2 Multiply the EMA's own smoothing factor by it
- 3 Apply that reduced factor to this bar's price
顯示公式與計算詳情
Every adaptive moving average on this hub answers the same question differently: how much should this bar count? FrAMA answers with the fractal dimension of the price path, AMA with an efficiency ratio, and VIDyA with the one-sidedness of the recent changes:
alpha = 2 / (1 + EMA period) <- the ceiling, fixed
cmo = |(sum of ups - sum of downs) / (sum of ups + sum of downs)| <- 0..1
VIDYA[i] = price[i] * alpha * cmo + VIDYA[i-1] * (1 - alpha * cmo)
Because cmo never exceeds 1, the effective factor never exceeds the EMA’s own. Over 4,980 random bars at the defaults, zero bars reached the 0.1538 ceiling and the average was 31.4% of it — the responsiveness of a 40-period EMA, not a 12-period one. VIDyA is a way of being slower in some conditions. It has no mechanism for being faster.
It does not react to volatility. The multiplier is a ratio with the size of the moves in both halves, so they cancel. Take one series, multiply every step by 10 and then by 100, and the mean factor is the same number every time:
| Price steps | Mean smoothing factor | Share of ceiling |
|---|---|---|
| ×1 | 0.04762324 | 30.955% |
| ×10 | 0.04762324 | 30.955% |
| ×100 | 0.04762324 | 30.955% |
What moves it is direction. Fix the sizes of every step so total movement is identical, and vary only the chance that each step continues the last one’s direction:
| Persistence | Share of ceiling |
|---|---|
| 0.30 | 20.9% |
| 0.50 | 29.1% |
| 0.70 | 40.8% |
| 0.90 | 68.5% |
| 1.00 | 100.0% |
That is the whole indicator. The useful consequence is that in a balanced market the line stops — over ranging stretches it moved less than 0.05 in four bars on 51.1% of bars, against 22.4% for EMA 12 — and a line that is not moving cannot cross another one. The cost is on the same page as the benefit: after a step from 100 to 110 followed by flat prices, VIDyA halts at 107.7765 and never arrives, while EMA 12 closes the gap in 18 bars.
訊號
VIDyA 提供的可回測訊號 — 及每個訊號適合的市場狀態。
Fast Line Crosses the Blunt One
Builder 可實現The Line Goes Flat
Builder 可實現Price Runs Away From a Frozen Line
進階邏輯MT5 實作
MetaTrader 5 實際計算與繪製的內容——本頁每條規則的依據。
緩衝區
| 索引 | 緩衝區 | MT5 中的繪製方式 | 存放內容 |
|---|---|---|---|
| 0 | VIDYA_Buffer | VIDYA | The line, and the only buffer the indicator declares — one buffer, one plot, mapped with INDICATOR_DATA. There is no second series holding the smoothing factor, so a flow cannot branch on how adaptive the line currently is; the panel on this page derives that from the same arithmetic rather than reading it. Note the name: unlike the MA family this indicator does not use MAIN_LINE, and its plot label is built at runtime as VIDYA(cmo, ema). |
平台說明
最佳適用場景 / 謹慎使用
沒有任何指標具有普適優勢。以下是 VIDyA 發揮作用的場景 — 以及可能誤導的場景。
最佳適用場景
- Markets that alternate between clean runs and long balanced stretches
- As the slower half of a pair, where refusing to move in chop is the point
- M15 and above, where a 20-bar warmup and a 50-bar CMO window are cheap
- Reading the pair's separation rather than the single line's level
謹慎使用
- Expecting it to lead price: it is bounded below the EMA it is built from, never above
- Reading it as a volatility-adaptive average — it does not respond to volatility at all
- A CMO period of 1, where the multiplier is always 1 and the indicator is a plain EMA
- Very long CMO periods, which push the average factor down to a tenth of the ceiling
構建 VIDyA 策略
將訊號接入進場和出場規則,然後匯出可編譯的 MT5 EA — 無需撰寫程式碼。
- A VIDyA node with CMO 9 and EMA 12
- A second VIDyA node with CMO 50 and the same EMA 12
- Crossover of the two → close any sell, then open a buy · SL 70 / TP 210
- Crossunder → close any buy, then open a sell, mirrored
- Shift 1 on both, so the cross is judged on closed bars
將 VIDyA 與其他指標組合
單一指標很少獨立有效。這些組合彌補了 VIDyA 的盲點。
VIDyA + ATR
- ATR at 14
- Stop loss in ATR mode
- VIDyA crossover
The Stop Loss node has an ATR mode, so replacing the fixed distance needs no extra condition — swap the mode and set the multiplier.
開啟 Builder →VIDyA + ADX
- ADX above 25
- VIDyA crossover
- Buy
No single-flow template combines them. Add an ADX node with a Compare at 25 and join it to the VIDyA Cross with an And gate.
開啟 Builder →VIDyA + Standard Deviation
- Std Deviation at 20
- VIDyA crossover
- Buy
Add a Std Deviation node and a Compare against a level chosen from the instrument, then join it to the VIDyA Cross with an And gate.
開啟 Builder →參數
在您自己的貨幣對和時間框架上驗證的起始值 — 非保證設置。
| 參數 | 預設值 | 建議測試範圍 | 功能說明 |
|---|---|---|---|
| CMO period | 9 | 1–1000 | How many bars the one-sidedness is measured over. This is the sensitivity knob and the only one that changes how adaptive the line is. Measured on 4,000 random bars with EMA 12 fixed, the average smoothing factor is 42.5% of the ceiling at CMO 5, 31.0% at 9, 20.8% at 20 and 12.9% at 50 — behaving like EMAs of roughly 30, 41, 61 and 100 periods respectively. A value of 1 is degenerate: with one change in the window, one of the two sums is always zero, the ratio is always 1, and the indicator is a plain EMA. |
| EMA period | 12 | 1–1000 | The smoothing period whose factor, 2/(1 + period), is the ceiling. At 12 that ceiling is 0.1538. Raising this period lowers the ceiling and slows everything proportionally; it does not change how the line adapts, only how fast it is allowed to be at full adaptation. |
| Applied price | PRICE_CLOSE | Close / Open / High / Low / Median / Typical / Weighted | The series both halves read. Unlike FrAMA — where the adaptation comes from the bars' own highs and lows and applied price only enters the final smoothing — here the CMO is computed from the applied price too, so changing it changes how adaptive the line is as well as what it smooths. |
| Shift | 1 | 0–100 | Which bar the Builder reads. The template uses 1, so decisions are made on closed bars. This is the node's read offset, not the indicator's own ma_shift — the Builder always passes 0 for that, so there is no way to slide the plotted line forward from here. |
| Timeframe | Current | Current / M1–MN1 | Which timeframe's bars feed the calculation. Note the warmup travels with it: nothing is drawn until EMA period + CMO period − 1 bars exist, which is 20 at the defaults and 62 with the blunt CMO 50 the template also uses. |
初始預設
市場示例
VIDyA 有效的場景、失效的場景,以及篩選器如何改變結果。
Both lines wake up together
A run begins, the CMO 9 line's factor climbs toward the ceiling and it pulls away from the CMO 50 line, which needs far more agreement before it moves. The separation is the signal, and it happened because the moves were one-sided rather than because they were large.
Separation without a trend
A balanced market still drifts, and a slow drift is one-sided enough to nudge the fast line past the blunt one. This is the entry that the trend-strength filter above exists to test, and it is why a little under half the template's entries land outside a trend.
The chop that produced nothing
Prices move as much as they did in the trending stretch, but the ups and downs cancel, both factors collapse toward zero and neither line moves enough to cross. No trade is taken — which is the behaviour being paid for.
FAQ
- Is VIDyA built into MetaTrader 5?
- Yes. iVIDyA is a standard function, and MetaQuotes also ships the source as VIDyA.mq5 under MQL5\Indicators\Examples, which is where the arithmetic on this page comes from. It declares one buffer, plots one line in the chart window, and sets PLOT_DRAW_BEGIN to EMA period + CMO period − 1.
- Is VIDyA faster than a normal moving average?
- No, and it cannot be. Its smoothing factor is the EMA's factor multiplied by a value between 0 and 1, so EMA(n) is the ceiling for VIDyA(any CMO, n). Measured over 4,980 random bars at CMO 9 / EMA 12, not one bar exceeded that ceiling and the average was 31.4% of it — closer to the responsiveness of a 40-period EMA than a 12-period one.
- Does it adapt to volatility?
- No. The multiplier is a ratio with the sizes of the moves in both the numerator and the denominator, so they cancel. Multiplying every price step in a test series by 100 — a hundred times the volatility, identical directions — leaves the mean smoothing factor identical to eight decimal places. What changes it is how one-sided the moves are: fixing the sizes and varying only the persistence of direction moved the factor from 20.9% of the ceiling to 100%.
- What happens when the market goes sideways?
- The factor falls toward zero and the line slows to a halt. In a ranging stretch, 51.1% of bars saw the line move less than 0.05 over four bars, against 22.4% for a 12-period EMA on the same data. The upside is that a frozen line does not produce crossovers; the downside is that if a real move arrives during a balanced stretch, the line is late — after a step change followed by quiet prices it took 84 bars to catch up where the EMA took 18.
- Which period should I change, the CMO one or the EMA one?
- Change the EMA period to change speed, and the CMO period to change how selective it is. The EMA period sets the ceiling — 2/(1 + period) — and the CMO period sets what fraction of that ceiling you get on average: 42.5% at CMO 5, 31.0% at 9, 20.8% at 20 and 12.9% at 50, with the EMA period held at 12 throughout.
- Why does the template use two VIDyA lines with the same EMA period?
- So that the difference between them is sensitivity rather than speed. Both are capped at the same 0.1538, and the CMO periods of 9 and 50 decide how much agreement each needs before it moves. The practical consequence is measurable: over 7 series of 20,000 bars, 56.7% of the template's entries landed in a trending stretch against a 47.5% chance level, while EMA 30 × EMA 100 — matched to the two lines' average effective periods — managed 16.2% and EMA 12 × EMA 28 managed 18.8%, both far below chance.
- Does it make more money than a moving average cross?
- Not in the measurement on this page, and it would be worth distrusting anyone who claims otherwise from a synthetic test. Total distance captured came out at 2,429 against 2,625 for EMA 30 × EMA 100 over the same seven series. What changed was the distribution: 38.9% of trades profitable against 35.1%, 52 bars held against 146, and 0.701 of distance per trade against 2.819. It trades more often, holds for less time and picks different moments — it does not extract more.
- Can I build this without coding?
- Yes. The VIDyA Sensitivity Cross template has two VIDyA nodes — CMO 9 and CMO 50, both with EMA period 12 and shift 1 — feeding a crossover and a crossunder that close the opposite position before opening a new one, with 70 / 210 pip distances. The CMO periods, the EMA period, the applied price, the stops, the lot and the spread limit are all EA inputs.
- How should I validate settings before going live?
- Backtest on quality tick data and then demo, and check two things specific to this indicator. First, confirm the warmup: with CMO 50 the blunt line needs 62 bars before it exists, so a short test period silently trades on fewer signals than you think. Second, compare it against the plain EMA of the same period on the same data — if the results are indistinguishable, the CMO period is short enough that you are paying for an EMA in disguise, and CMO 1 is the extreme case where that is exactly true.