BMFibEmpirical
CATEGORY
Statistical analysis indicator for NinjaTrader 8. Validation tool, not a signals tool.
Overlays the price chart and coexists with any other indicator in the suite.
HOW IT WORKS
The starting problem
The literature on Fibonacci retracements is uncomfortable and best stated plainly. Arthur Merrill, in Filtered Waves, concluded that no reliable standard retracement exists. Burton Malkiel attributes the retracement's appearance to simple price volatility. Backtest reviews agree: used alone and without confluence, Fibonacci levels do not outperform chance.
Their utility appears when they coincide with something else—support, moving averages, structure, volume—and because many traders draw the same lines.
Building another indicator that paints the 0.618 would just add noise. What didn't exist was one that answers the only question that matters: does the price really react at that depth, in this instrument?
The procedure
1. Detect the legs. Configurable, confirmed strength pivots. No repainting: a pivot that appears stays where it is.
2. Measure each retracement. For each A→B leg, it records how deep the price retraced and if it then resumed the original direction.
3. Accumulate by bands. The results are grouped into depth bands—five percentage points by default: 0–5%, 5–10%, and so on—.
4. Calculate the resumption rate with a confidence interval, and compare it against the baseline rate: the one that would be obtained at any depth.
5. Paint the result. The classic levels—23.6 / 38.2 / 50 / 61.8 / 78.6—appear colored according to their measured rate, not according to their fame. And it also marks the depths that the sample truly supports, whether or not they are Fibonacci numbers.
Statistical rigor, which is the product
This part is what separates BMFibEmpirical from a win counter.
Wilson interval, not the simple proportion. With small samples, the normal interval produces impossible bounds—below zero or above one—and overestimates certainty. Wilson performs well even with few cases.
Multiple comparisons correction. Around ten bands are evaluated at once. Without correction, finding a "significant" one is almost certain by pure chance. The threshold is divided by the number of bands evaluated (Bonferroni).
Minimum sample per band. An 80% rate with five cases says nothing. The indicator marks it as insufficient instead of showing a large and misleading number.
Baseline rate as a reference. What matters is not that a band gets 55% right, but that it gets more than average right. If they all hover around the baseline, there is no signal—and the indicator says so.
What you will see on screen
Three colors on the levels: outperforms chance, does not outperform, insufficient sample. An optional histogram with the rates per band. And a HUD with the measurement status: cumulative sample size, current baseline rate, and which bands have passed the corrected threshold.
Use from a strategy
Exposes two public methods to access it from your own code:
ValidatedDepth(double profPct) // Does this depth outperform chance?
DepthRate(double profPct) // measured resumption rate
The warning, which is part of the product
This indicator may conclude that no depth works in your instrument. That result is just as valid as the opposite, and quite a bit more useful than a backtest tweaked until it says what one wanted to hear.
It does not promise profitability. It measures.
FOR WHOM
For those who already use Fibonacci and want to know if it works for them. If you draw retracements every day, this tells you which depths the data supports in your instrument and timeframe, and which ones you are looking at out of habit.
For those who develop strategies. Before putting a Fibonacci level into the code, it is advisable to check that the level has something behind it. The two public methods allow you to access it from your own strategy.
For those who distrust the category. If you never believed in Fibonacci, this is the way to check it with your own data instead of with an opinion—including the possibility that the measurement contradicts you.
For whom it is not
It is not a signal generator. It does not draw arrows, it does not alert, it does not indicate entries or exits. It is a preliminary analysis tool.
It does not work with few bars. Statistical rigor has a cost: enough legs are needed for the bands to accumulate a sample. In long timeframes or with little loaded history, the indicator will honestly say there is an insufficient sample.
It does not replace judgment. That a depth outperformed chance in the past does not guarantee it will do so tomorrow.
TECHNICAL REQUIREMENTS
|
|
|
|---|---|
|
Platform |
NinjaTrader 8 |
|
Type |
indicator overlaid on the price chart |
|
Calculation |
at bar close |
|
Data |
any bar series—without Tick Replay, without Level II data |
|
Instruments |
any: futures, stocks, forex, CFD |
|
Additional license |
none |
|
History |
the more, the better—the sample depends on the number of detected legs |
Parameters
1 Swings
|
Parameter |
Default |
What it does |
|---|---|---|
|
Pivot strength |
5 |
bars on each side to confirm a pivot |
|
Minimum separation between pivots |
3 |
avoids overlapping legs |
|
Minimum leg size |
40 ticks |
discards irrelevant movements |
2 Measurement
|
Parameter |
Default |
What it does |
|---|---|---|
|
Width of each band |
5% |
histogram granularity |
|
Maximum depth before invalidating |
100% |
beyond the origin, the leg stops counting |
|
Distance that counts as resumption |
50% |
how far it must advance to be considered a success |
|
Minimum sample per band |
20 |
below that, it is marked as insufficient |
|
Confidence level |
95% |
before Bonferroni correction |
3 Visual
Show or hide the classic levels, the validated depths, and the histogram. Projection bars to the right (30 by default) and the four colors: outperforms chance, does not outperform, insufficient sample, and the one for the classic levels.
4 HUD
Information panel with the same design as the rest of the suite: four positions, margin, width, font size, background opacity, and text color.
Performance
The calculation runs at bar close and the drawing only traverses the visible bars. The indicator is suspended while the tab is inactive.