Volumes
Volumes is the tick count of a bar copied straight into buffer 0 — no smoothing, no warm-up, no period to set. The one comparison MetaTrader makes lives in buffer 1, the colour, and it paints equal counts as a fall; the Builder can only read buffer 0, so a flow that wants to know whether activity rose has to rebuild that comparison from nodes.
- Buffers
- 2 — data and colour
- Warm-up bars
- 0
- Bars painted as a fall on a tie
- 0.9% to 16.7%
Ilustratif — data sintetis, bukan kutipan langsung.
What Volumes tells you
Every other indicator on this hub computes something. This one does not. MetaTrader's Volumes assigns the bar's tick count into its output buffer and stops, so what you are reading is the rates array with a handle wrapped around it. On FX that count is the number of price updates the broker sent during the bar, not the size that changed hands — a busy minute and a large trade look the same. Two consequences run through the whole page. The first is that MetaTrader's only judgement about volume lives in the second buffer, the colour. It asks whether this bar beat the last one, and it asks with a strict greater-than, so equal counts are painted as a fall. The second is that the raw number does not transfer between instruments or timeframes. That is why the template divides rather than thresholds, and why almost every measured statement here is a range across market types rather than a single figure.
- No period, no smoothing, no warm-up — the indicator adds a handle, not a calculation
- MT5's own colour rule paints ties as a fall, so red is the more common colour
- Absolute counts do not transfer; a ratio against recent bars does
- 1 The terminal counts price updates while a bar is open
- 2 Buffer 0 receives that count unchanged; buffer 1 records whether it beat the previous bar
- 3 A flow divides the count by a recent average to get a number that travels between instruments
Tampilkan rumus & detail perhitungan
MetaTrader’s Volumes does not calculate anything. Its OnCalculate walks the bars and assigns the count into the output buffer, then records one comparison in a second buffer:
buffer0[i] = (double)volume[i] <- the rates array, unchanged
buffer1[i] = (volume[i] > volume[i-1]) ? 0 : 1 <- the colour; strict >, so a tie is "1"
volume[] is the tick volume unless the indicator is created with VOLUME_REAL, which the Builder never does. There is no period, no moving average and no PLOT_DRAW_BEGIN: the value for a bar is complete as soon as the bar exists, and the first bar of the buffer is set before the loop starts.
Everything else on this page is built on top of that by the flow, not by the indicator. The template’s relative volume is
avg = (v[2] + v[3] + v[4]) / 3 <- shifts 2, 3 and 4
rel = (avg != 0) ? v[1] / avg : 0 <- shift 1, the last closed bar
which is a ratio and therefore comparable between instruments, unlike the count itself.
In MQL5 the call is iVolumes(symbol, period, applied_volume). The third argument is an applied volume, not an applied price — the indicator has no price input at all, which is why this page’s applied-price section says the concept does not apply rather than saying “fixed to Close”. The generated EA reads the result with CopyBuffer(handle, 0, shift, 2, buf), so buffer 1 — the colour, and with it the platform’s only opinion about whether a bar was busier than the last — never leaves the terminal.
Sinyal
Sinyal yang dapat di-backtest dari Volumes — dan kondisi pasar yang cocok untuk masing-masing.
Back to Average
Siap di BuilderQuiet Bar Veto
Siap di BuilderNew Extreme on Falling Activity
Logika lanjutanImplementasi MT5
Apa yang benar-benar dihitung dan digambar MetaTrader 5 — acuan bagi setiap aturan di halaman ini.
Buffer
| Indeks | Buffer | Digambar di MT5 sebagai | Isinya |
|---|---|---|---|
| 0 | VOLUME | Colour histogram | The bar's volume, assigned straight from the rates array — the source is one line, ExtVolumesBuffer[i] = (double)volume[i]. No averaging, no lag, and nothing to warm up: the value for a bar is known the moment the bar exists. This is the buffer the Builder reads. |
| 1 | COLOR_INDEX | Colour index for the histogram above | 0 when this bar's count is strictly greater than the previous bar's, 1 otherwise. That strictness is the whole content of the colour: a bar with exactly the same count as the one before it is painted as a fall. Not reachable from the Builder, which always copies buffer 0. |
Catatan platform
Bekerja paling baik / gunakan dengan hati-hati
Tidak ada indikator yang merupakan keunggulan universal. Inilah di mana Volumes membantu — dan di mana ia menyesatkan.
Bekerja paling baik
- As a second condition on a rule that already has a reason to trade
- Timeframes where a bar holds enough ticks that a tie is rare
- Instruments and sessions you have measured, because the thresholds do not transfer
- Flows that compare volume with volume, rather than with a fixed number
Gunakan dengan hati-hati
- Reading tick volume as traded size — on FX it is a count of price updates
- Fixed thresholds such as 'volume above 500', which mean different things per symbol and timeframe
- Comparisons on shift 0, where the count is still growing and the answer changes within the bar
- Assuming a busier bar is a more meaningful bar; the indicator has no opinion about direction
Buat strategi Volumes
Hubungkan sinyal ke aturan masuk dan keluar, lalu ekspor EA MT5 yang dapat dikompilasi — tanpa kode.
- Four Volumes nodes, reading the last closed bar and the three before it
- Two adds, a constant and two divides, producing the ratio the flow compares
- Ratio above 1.5 and the bar closing above its open → Open Buy · SL 60 / TP 60
- Ratio above 1.5 and the bar closing below its open → Open Sell, mirrored
- Ratio back below 1.0 → Close, wired before the entries so it is emitted first
Gabungkan Volumes dengan indikator lain
Satu indikator jarang berdiri sendiri. Kombinasi ini menutupi titik buta Volumes.
Volumes + BW MFI
- Volumes at two shifts
- BW MFI at two shifts
- And gate
Volumes + Donchian Channel
- Donchian upper band
- Volumes above its recent average
- And gate
No single template holds both. Add a Donchian node with a Cross of price against the upper band, then join it to the relative-volume Compare with an And gate.
Buka Builder →Volumes + ATR
- ATR at 14
- Volumes above its recent average
- Stop loss in ATR mode
Add an ATR node and switch the Stop Loss node to its ATR mode; the volume side needs no change.
Buka Builder →Parameter
Nilai awal untuk divalidasi pada pasangan dan timeframe Anda sendiri — bukan pengaturan yang dijamin.
| Parameter | Default | Rentang uji yang disarankan | Fungsinya |
|---|---|---|---|
| Applied volume | Tick | — | iVolumes accepts VOLUME_TICK or VOLUME_REAL, and the Builder always passes VOLUME_TICK. Real volume is not available from most FX brokers — it is reported as zero — so the node does not offer the choice. On an exchange-traded symbol where real volume does exist, the generated EA still reads the tick count. |
| Shift | 1 | 0–100 | Which bar the node reads. The template uses 1 so that decisions are made on a closed bar. Shift 0 is the bar still forming, where the count only grows: a comparison against it is true or false depending on when in the bar you ask, and it can flip several times before the bar closes. |
| Timeframe | Current | Current / M1–MN1 | Which timeframe's bars are counted. This matters more here than for most indicators, because the typical count per bar is what decides how noisy the ratio is and how often ties occur — the same threshold behaves differently on M1 and H1 on the same instrument. |
| Bars in the average (template) | 3 | 2–20 | How many bars the flow averages before dividing. This is not a setting of the indicator: the Builder has no average-of-volume node, so the template builds the average from one Volumes node per bar. Raising it means one more handle per bar and a steadier denominator. |
| Surge threshold (template) | 1.5 | 1.2–3.0 | How far above the recent average the bar has to be. Measured on five synthetic tick-count series, the same 1.5 fired on 0.00% of bars in a structureless series averaging 100 ticks and on 18.89% in one with a daily cycle — so this is the number to re-measure first when you change instrument or timeframe. |
| Exit threshold (template) | 1.0 | 0.6–1.0 | The level relative volume must fall back through to close the position. Lowering it makes the hold longer and much less predictable: at 0.6 one of the five series reached a 50-bar cap on 51.4% of trades, while at 1.0 no series reached it at all. |
Preset awal
Contoh pasar
Di mana Volumes bekerja, di mana ia gagal, dan bagaimana filter mengubah hasilnya.
A break that someone traded
Price leaves a range on a bar carrying several times the recent number of ticks, and the flow takes the direction of that bar. The position is closed a few bars later when activity is back to normal, whether or not price is.
The busy bar that went nowhere
A burst of ticks inside a narrow range — an argument rather than a move. The count says the bar was busy, the indicator has nothing to say about direction, and the candle's own open and close are all the flow has to go on.
The quiet hour
The same pattern arrives in a thin session. Relative volume never reaches the threshold, so nothing is taken — and on thin bars the ratio is at its noisiest, which is the case for measuring the threshold per session rather than trusting one number.
Indikator terkait
FAQ
- Is MT5's Volumes real traded volume?
- Only where the broker provides it, and the Builder never asks for it. The indicator takes an applied-volume argument that can be VOLUME_TICK or VOLUME_REAL, and the generated EA always passes VOLUME_TICK — the number of price updates in the bar. On most FX feeds real volume is reported as zero, which is why the node does not offer the choice.
- Why does the histogram look red more often than green?
- Because MetaTrader paints ties as a fall. The colour buffer is `curr > prev ? 0 : 1`, a strict comparison, so a bar with exactly the same count as the previous one gets the falling colour. On synthetic counts with no trend in activity, green appeared on 41.70% of bars at a mean of 3 ticks and 49.57% at a mean of 1000 — the missing share is the tie rate, 16.70% and 0.90% respectively. The effect is only visible on thin bars.
- Can I read the colour buffer from the Builder?
- No. The codegen copies buffer index 0 for this node, and only the Custom Indicator node lets you choose a buffer index. Rebuilding the comparison costs a second Volumes node at the next shift plus a Compare, and it reproduces the platform's answer exactly as long as the Compare uses a strict greater-than. The BW MFI template already contains that rebuild if you want to see it wired up.
- What is a good volume threshold?
- There is no such number, and that is the most useful thing this page can say. The same 1.5x rule fired on 0.00% of bars in a structureless series averaging 100 ticks and on 18.89% in one with a daily cycle, with three other series between. A threshold on the raw count is worse still, because the count scales with the instrument, the timeframe, the session and the broker's feed. Measure the rate on your own data before choosing, and re-measure when any of those change.
- Why does the template use four Volumes nodes?
- Because there is no node that averages volume, and a Compare node reads only the current value of its inputs. Reading four bars therefore means four nodes, which become four iVolumes handles created with identical arguments — the shift is applied in the CopyBuffer call, not when the handle is made. A single node does copy the bar you point at and the one before it, but that second value is reachable only through a Cross node.
- Can I change the surge threshold in the EA's inputs?
- No. Compare nodes write their threshold into the code as a literal, so the compiled EA carries `vol_rel > 1.5` and offers inputs only for the magic number, slippage, once-per-bar, lot size, the two stop distances and the maximum spread. Changing the threshold means editing the flow in the Builder and generating again.
- Does a volume surge mean the move will continue?
- Nothing on this page claims that, and nothing measured here could establish it. The measurements are of how often rules fire and how long the flow holds, on synthetic series with known properties — a question about the rules rather than about markets. Whether activity carries information about the next move needs your own instrument, your own costs and an out-of-sample test. That is also why the template's exit is defined by the same measurement as its entry rather than by a profit target.
- Can I build this without coding?
- Yes. The template is four Volumes nodes feeding two adds, a constant and two divides to make the ratio, two Compare nodes for the entry and exit thresholds, two OHLC nodes for the direction of the surge bar, two And gates, and Open Buy / Open Sell / Close. The stop distances, lot size and maximum spread are EA inputs; the thresholds and the averaging length are set in the Builder.
Artikel terkait
Glossary