PulseHub
OPEN-SOURCE SCRIPT

Edge Profiler - Self-Learning Signal Statistics

2 683
Almost every indicator answers one question: when should I enter. Edge Profiler answers the two questions that actually decide whether an entry is tradable: how far did this exact setup historically go against me before it resolved, and how long did it usually take.

It does that by keeping a record of its own signals on the symbol and timeframe you have open, and turning that record into a stop distance, a target and an expected holding time.

WHAT IT MEASURES

For every signal it has ever produced on the current chart, the script stores four numbers:

MAE, Maximum Adverse Excursion. How far price travelled against the signal before the signal resolved, measured in ATR units so the value is comparable across symbols and volatility regimes.

MFE, Maximum Favourable Excursion. How far price travelled in favour, in the same units.

Duration. How many bars the signal remained the active one.

Outcome. The signal-to-signal return, again in ATR units.

The last N signals are kept, older ones are dropped, so the statistics describe the current regime rather than a market that no longer exists. The sample size is adjustable.

WHAT IT DERIVES

Data Stop. Entry minus the 80th percentile of historical MAE, times the ATR at entry. Read plainly, this is a stop level that 80 percent of past signals on this chart never reached. The percentile is adjustable, so 90 gives a wider and safer stop, 70 a tighter and more aggressive one.

Data Target. Entry plus the median historical MFE. A level that half of past signals reached before resolving. Also adjustable by percentile.

Expected duration. The median bar count of past signals. The panel shows the age of the open signal as a percentage of that median, which flags a move that has already outlived what this setup normally delivers.

Expectancy. The average signal-to-signal return in ATR units. Positive means the engine has historically produced more favourable resolution than adverse on this chart. Negative is a warning, and it is deliberately shown rather than hidden.

Win rate. The share of stored signals whose signal-to-signal return was positive.

WHY EXCURSION STATISTICS AND NOT A BACKTEST

A backtest tells you what a complete rule set produced, and it is only as honest as its exit assumptions. Excursion statistics measure something narrower and more robust: the shape of the move that follows a trigger, independent of any exit rule. That makes the numbers usable no matter how you personally manage the trade. If the median adverse excursion on this chart is 0.4 ATR and you are risking 0.15 ATR, the data is telling you the stop is inside the noise, and no entry technique will fix that.

BRING YOUR OWN SIGNAL

Three transparent entry engines are included, and the statistics profile whichever one is selected:

Volatility Trail. An ATR trailing stop that flips direction when price closes through it. Default.

EMA Cross. Close crossing a single exponential moving average.

Donchian Breakout. Close breaking the highest high or lowest low of the last N bars.

Switching the engine reprofiles everything from scratch on the same chart, which makes it easy to see which of the three has the cleaner statistical footprint on the instrument you actually trade. Two engines with the same win rate can have very different adverse excursion, and that difference is what decides whether a stop survives.

ON THE CHART

Entry line, Data Stop line and Data Target line for the currently open signal.
Shaded risk zone between entry and stop, reward zone between entry and target.
Triangles at each signal.
Bars tinted by the active signal direction.
A panel with the full statistics and the live state of the open signal, including its running MAE and MFE so you can see in real time whether the current move is behaving like its own history or not.

ALERTS

Long signal.
Short signal.
Open signal has moved further against entry than the historical stop percentile.
Open signal has outlived the median duration.

SETTINGS THAT MATTER

Entry Engine. Which signal gets profiled.
Sample Size. How many past signals are kept. Smaller adapts faster and is noisier, larger is more stable and slower to react to a regime change.
Minimum Sample. Statistics stay hidden below this count instead of showing numbers built on four observations. Default 15.
Stop Percentile. The single most consequential setting. It is the trade-off between stop survival and risk size.

READING IT HONESTLY

These are descriptive statistics of past signals on one chart. They are not a forecast and they carry no guarantee. A sample of 20 signals is a hint, not evidence. Statistics drawn from a trending period will misprice risk the moment the market goes sideways, and the percentile you choose is an assumption about how much you are willing to be wrong before you are stopped. Load enough history for the sample to fill, check that expectancy is positive before you take the levels seriously, and treat a negative expectancy reading as the script telling you this engine has no edge here.

This is an analysis tool, not financial advice, and not a trading system on its own. Use it with your own risk management and position sizing. Past behaviour of any method does not guarantee future results.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by PulseWire. Read more in the Terms of Use.