Sweep Ledger
- Indicatori
- Versione: 1.0
- Attivazioni: 5
Most liquidity tools draw a level and leave you to guess whether it mattered.
Sweep Ledger keeps a record. Every structural high and low it draws carries an
outcome: whether price only wicked through it, or actually closed beyond it, and
whether that breakout was still holding a fixed number of bars later. The running
tally sits on the panel, so you can see how levels on this symbol and this
timeframe have actually behaved before you commit to the next one.
What Gets Recorded
A level is created only after a swing high or low is confirmed by a fixed number
of bars on both sides, so it cannot appear retroactively. From then on it is
tracked until something happens to it, and the result is written once and never
revised.
Wick. Price pushed past the level intrabar but the bar closed back inside.
Breakout. The bar closed beyond the level, which starts a fixed verdict horizon.
Held. At the end of that horizon price was still beyond the level.
Failed. By the end of the horizon price was back inside.
Untouched. The level was never reached while it existed.
The panel shows the counts and the rates per side, for highs and lows separately.
A breakout whose horizon has not elapsed is counted as pending and is excluded
from the rates, so a decided outcome is never mixed with an undecided one.
The Statistics Are Calibrated, Not Just Computed
Any rule that scores two outcomes can be built so that one of them is easier to
reach, and it will then report an impressive number that means nothing. The
verdict rules here were checked against synthetic random data with no trend and
no memory, where the honest answer is close to a coin flip. The follow-through
rate reads 53.9 percent on that data and the point of control hold rate reads
57.6 percent, both close enough to neutral that a reading away from those levels
on a real market carries information.
Two consequences you can see in the product. First, wick rejections and breakouts
are counted separately and never share a denominator, because they are different
events. Second, a percentage is withheld entirely until the sample is large
enough, and the raw count is shown instead. A rate computed from a handful of
samples is indistinguishable from chance, and showing it as a percentage would
invite you to trade on noise.
Structural Volume Profile
The profile is built between the currently active structural high and low rather
than over a fixed bar count, so it describes the range the market is actually
working in. Each bar of volume is distributed across every price bin its range
covers, weighted by overlap, instead of being dumped into the bin holding its
close, which would invent a volume spike at the close of every wide bar.
The point of control and the value area are derived from that profile and drawn
to the right of price. Point of control touches get their own small ledger, with
the level frozen at the moment of the touch so the recorded outcome cannot drift
as the profile keeps filling.
If a symbol reports no real volume while the real volume source is selected, the
indicator falls back to tick volume, counts how many bars that affected, and
displays the count. A core feature that degrades silently is worse than one that
says so.
Non-Repainting, And Why
Three things enforce it rather than one claim asserting it.
Only closed bars are processed. The bar in progress never contributes to a level,
a sweep, a verdict or a volume bin.
Every level waits for confirmation. A swing is only knowable a fixed number of
bars after it happened, so a level cannot be inserted into the past.
The calculation window is anchored to a date rather than to a bar count. A
window measured backwards from the newest bar slides forward every time a bar
closes, which moves where the calculation began and can therefore change what it
concluded about history. Here the start is pinned for as long as the indicator
stays on the chart, so the window only ever grows and nothing already decided
moves under you. Re-attaching it re-anchors on purpose, so that asking for one
month gives you the most recent month rather than one that ended weeks ago, and
the panel always prints the anchor date and the bar count so you know exactly
what the totals cover. If the chart has not downloaded enough history to give you
the window you asked for, the panel says so rather than quietly handing you a
shorter one.
Underneath all of that, a level is judged only by the bars around it. Its verdict
does not depend on where the window began, so a mark on your chart means the same
thing no matter when you loaded it.
Panel
The panel is draggable and collapsible, and it remembers its position and state
per chart across timeframe changes. Layout is measured from the actual rendered
text rather than assumed, so it stays correct at any font size and on any display
scaling. Every figure on it is counted from the current calculation, never from
whether something initialised successfully.
Alerts
Three independent alerts, each switched separately, and each routable to popup,
push notification or email: a level being swept, a verdict being written, and a
point of control touch resolving. Alerts fire on closed bars only.
Email alerts are sent by the terminal, not by the indicator, so they require
MT5 - Tools - Options - Email to be configured first. Popup and push need no
setup.
Reading It From An Expert Advisor
Four data buffers are exposed through iCustom: the active structural high, the
active structural low, the point of control of the current profile, and the net
count of sweeps on each bar, positive when highs were swept and negative when
lows were. All four draw nothing on the chart.
Parameters
41 inputs in 8 groups. The defaults below are a working starting point.
Structure. Swing Length 15 bars each side, Sweep Buffer 0.05 ATR, Verdict Horizon
10 bars, ATR Period 100, Max Levels Kept Per Side 64, Min Samples Before Showing
Rate 10.
History Range. Range as a period rather than a bar count - 3 Days, 7 Days,
15 Days, 1 Month, 3 Months or All - because a fixed bar count means a completely
different span on M1 than on H4. Min Bars Regardless Of Range 2000, which widens
the window on the higher timeframes, where a month holds 504 bars of H1 and 30 of
D1 - far too few for any rate to clear its sample floor. Max Bars Safety Cap
30000.
Volume Profile. Profile Resolution 120 bins across the window - a bin count
rather than a fraction of volatility, so the resolution is the same on every
symbol and in every regime. Profile Width 60 bars, Volume Source tick or real,
Max Drawn Profile Bins 250, Value Area Percent 70, and switches for the profile,
the point of control and the value area.
Levels. Show Active Levels, Fade After 150 bars, Show Sweep Markers.
Panel, Colors, Alerts, Diagnostics. Panel corner, position, minimum width and
font size; the full colour set; the three alerts and their three delivery
methods; and a diagnostics log switch that reports per-pass counts when you are
tuning.
Usage
Start by leaving the defaults alone and reading the panel rather than the chart.
Give it enough history for the counts to mean something. The rates stay hidden as
raw counts until the sample reaches the minimum, which is the signal that the
numbers are not yet worth acting on.
What you are looking for is a side that behaves differently from a coin flip on
your instrument and timeframe. A high follow-through rate on one side says
breakouts there tend to continue; a low one says they tend to get faded. Both are
tradeable, in opposite directions, and both are visible before you take the trade
rather than after.
Swing Length sets what counts as structural. Larger values track fewer, more
significant levels; smaller values track more of them. Verdict Horizon sets how
long a breakout is given to prove itself, and it should reflect how long you
would actually hold a trade.
Compatibility
MetaTrader 5, any symbol, any timeframe. Uses tick volume by default so it works
on instruments that do not report exchange volume, with an explicit fallback
counter when real volume is selected but unavailable. No DLLs, no external files,
no internet access, and no dependence on any other indicator.
Support
For questions and support, please use the comments section of this product page
or contact the author through the MQL5 messaging system.
