FrAMA
FrAMA is a moving average with no smoothing setting. Every bar it measures the fractal dimension of the recent price curve and turns that into the weight it gives the newest price — near 1 when the market is moving in a straight line, near 0.01 when it is going nowhere. MetaTrader 5 ships it as iFrAMA, and the one length you set is only half the window it reads.
- Period set
- 14
- Bars actually read
- 28
- Smoothing settings
- 0
Illustratif — données synthétiques, pas une cotation en direct.
What FrAMA tells you
Every moving average is a decision about how much of the newest price to let in. On an EMA that decision is made once, when you pick the length, and never revisited. FrAMA remakes it on every bar. It measures how jagged the recent price curve is — its fractal dimension — and converts that straight into the weight. A market travelling in a clean line scores 1 and the average is handed the whole price, so the line sits exactly on it. A market thrashing back and forth in the same range scores 2 and the weight collapses to a hundredth, so the line goes flat. The length you set does not control the smoothing; it only controls how far back the measurement looks.
- There is no fast/slow pair and no smoothing constant — the weight is measured, not chosen
- The window is twice the period you set
- Only the line is published; the weight it used is not
- 1 Measure the ranges of the recent bars, the bars before those, and both together
- 2 Turn the three into a fractal dimension between 1 (a line) and 2 (a scribble)
- 3 Weight = e^(−4.6 × (dimension − 1)), applied to the newest price
Afficher la formule et les détails de calcul
Every moving average makes one decision: how much of the newest price to let in. On an EMA you make it once, by choosing a length. FrAMA remakes it on every bar, from a measurement:
- n1 = the range of the last N bars, n2 = the range of the N before those
- n3 = the range of all 2N bars together
- d = log₂((n1 + n2) / n3), and the weight is e^(−4.6 × (d − 1))
d is a fractal dimension: how much path the price used to get where it went. A straight line scores 1 and the weight comes out at 1 — the average takes the whole of the new price and becomes it. A pure oscillation scores 2 and the weight collapses to 0.01 — the line goes flat. Both of those are exact, not approximate.
The period you set is half the window. This is the thing worth knowing before choosing a number. Three ranges are needed and they span 2N bars, so iFrAMA with a period of 14 is reading 28. MetaTrader’s own implementation says so out loud: it sets PLOT_DRAW_BEGIN to 2 × period − 1 and refuses to calculate at all while fewer bars exist. That is why the template pairs FrAMA(14) with a fixed average of 28 — so the two lines are measuring the same stretch of chart and only the weighting differs.
Applied price does much less than it looks. The node exposes it and the generated EA passes it to iFrAMA, but the jaggedness is measured from the bars’ own highs and lows, whatever applied price is set to. It selects the series that gets smoothed; it does not change how much smoothing happens. On an ordinary moving average that setting is one of two controls. Here it is close to cosmetic.
In a strong trend the average becomes price. A weight of 1 means no history is carried at all. The line lands on price and rides it — correct behaviour, and quietly fatal to any rule built on price crossing the line, because in exactly the regime such a rule is meant to catch, the two series are identical. Compare the line against something else instead.
Two smaller things follow. The weight is not clamped: it stays inside 0.01 to 1 only while the two half-windows share a price range, and a gap between them sends d below 1 and the weight above it — on a 14-period window a 3-unit gap gives d = −0.81 and a weight near 4,080. And the weight is not published: iFrAMA has a single buffer, and it is the line. The chart above draws the factor because it is the whole point of the indicator, but no flow can branch on it.
Signaux
Les signaux distincts et testables que génère FrAMA — et le régime adapté à chacun.
Price Against the Line
Prêt dans BuilderThe Line Going Flat
Prêt dans BuilderReading the Smoothing Factor
Logique avancéeImplémentation MT5
Ce que MetaTrader 5 calcule et trace réellement — la référence de chaque règle de cette page.
Buffers
| Index | Buffer | Tracé dans MT5 comme | Ce qu'il contient |
|---|---|---|---|
| 0 | MAIN_LINE | FrAMA | The average itself, and the only series iFrAMA publishes. The fractal dimension and the smoothing factor it produces are computed inside the indicator and never exposed — there is no second buffer to read them from, which is why a flow cannot branch on how adaptive the line currently is. |
Notes de plateforme
Fonctionne mieux / utiliser avec prudence
Aucun indicateur n'est un avantage universel. Voici où FrAMA aide — et où il induit en erreur.
Fonctionne mieux
- Markets that alternate between trending and going quiet, which is what the adaptation is for
- As the trend side of a pair, where a fixed average supplies the reference it is measured against
- Higher timeframes, where a 28-bar window covers a meaningful stretch
- Anywhere a fixed length has been re-tuned repeatedly — this replaces that tuning with a measurement
Utiliser avec prudence
- As a price-cross trigger in a strong trend: the weight reaches 1, the line lands on price, and crossings become noise
- Short histories — nothing is drawn at all until twice the period has passed
- Assuming applied price changes the responsiveness; it does not, it only changes what gets smoothed
- Instruments that gap: the dimension is only bounded while the two half-windows overlap in price
Créer une stratégie FrAMA
Connectez le signal aux règles d'entrée et de sortie, puis exportez un EA MT5 compilable — sans code.
- One FrAMA node at 14 — so the window it reads is 28 bars
- One Moving Average node, EMA, set to that same 28
- FrAMA crosses above the fixed average → Close the short, then Open Buy · SL 70 / TP 210
- FrAMA crosses below it → Close the long, then Open Sell
- Both read the last closed bar, so a cross is a settled fact
Combiner FrAMA avec d'autres indicateurs
Un indicateur fonctionne rarement seul. Ces associations couvrent les angles morts de FrAMA.
FrAMA + AMA
- AMA rising
- FrAMA crosses above the fixed average
- Buy
No single-flow template pairs them. Start from FrAMA vs Fixed EMA and add an AMA node with a Compare against a second AMA at a further shift, joined to the Cross with an And gate.
Ouvrir Builder →FrAMA + ADX
- ADX above 25
- FrAMA crosses above the fixed average
- Buy
No single-flow template combines them. Add an ADX node with a Compare at 25 to FrAMA vs Fixed EMA and join it to the Cross with an And gate.
Ouvrir Builder →FrAMA + Moving Average
- A fixed EMA over 28 bars
- FrAMA over the same 28 bars
- Cross
This is the FrAMA vs Fixed EMA template itself. Change the fixed side's method from EMA to SMA to see how much of the signal came from the weighting rather than the adaptation.
Ouvrir Builder →FrAMA + DEMA
- FrAMA above the fixed average
- Fast DEMA crosses above slow
- Buy
No single-flow template pairs them. Add two DEMA nodes into a Cross on top of FrAMA vs Fixed EMA and join the two conditions with an And gate.
Ouvrir Builder →Paramètres
Valeurs de départ à valider sur votre propre paire et timeframe — pas des réglages garantis.
| Paramètre | Défaut | Plage de test suggérée | Ce que ça fait |
|---|---|---|---|
| Period | 14 | 1–999 | How far the measurement looks — and the number to be careful with, because it is half the story. The three ranges the dimension is built from span 2 × period bars in total, so a period of 14 reads 28. MT5 draws nothing until that many bars exist. This does not make the line smoother or faster in the way an EMA length does; it changes the stretch of chart the jaggedness is measured over. |
| Applied price | Close | Close / Open / High / Low / Median / Typical / Weighted | Which series gets smoothed. It does not affect the adaptation at all: the fractal dimension is measured from the bars' highs and lows regardless of what is set here. That makes it a far smaller lever than on an ordinary moving average, where applied price and length are the only two controls there are. |
| Shift | 0 | 0–100 | Which bar to read. The template sets it to 1 so a cross is decided on a closed bar. This is not the same as iFrAMA's own ma_shift, which slides the whole line sideways on the chart — the Builder pins that to 0 and exposes only the bar offset, so there is one shift here rather than two. |
| Timeframe | Current | Current / M1–MN1 | Which timeframe's bars the measurement runs on. Set it above the chart and the line becomes a slower regime backdrop for entries timed on the chart's own bars — the usual way to use an adaptive average as a filter rather than a trigger. |
Préréglages de départ
Exemples de marché
Où FrAMA fonctionne, où il échoue et comment un filtre change le résultat.
The line woke up
A quiet stretch keeps the average flat while price crosses it repeatedly; then a genuine move starts, the weight climbs toward 1 and the line lifts off the fixed average it had been sitting on. The separation, not the price move, is what the template trades.
A cross with nothing behind it
The two averages touch and part again inside a range where neither is really sloping. The dimension never leaves the top of its scale, so the adaptive line never actually accelerated — the crossing came from the fixed side drifting.
The same range, with a strength test attached
The identical stretch with a trend-strength condition joined to the cross. The lines still touch; no order is sent, because the flow was asked for a number the flat line cannot supply on its own.
Indicateurs associés
FAQ
- Is FrAMA built into MetaTrader 5?
- Yes. iFrAMA is a standard MQL5 function taking a symbol, a timeframe, the period, an ma_shift and an applied price, and the terminal also ships a FrAMA custom indicator under Indicators\Examples. The Builder calls the built-in function, so a generated EA carries no dependency on any file being present in the terminal that runs it.
- What does the period actually control?
- How far back the measurement looks — and it is half the window. The dimension needs the recent `period` bars, the `period` before those, and the combined stretch, so a period of 14 reads 28 bars and nothing is drawn until 28 bars exist. It is not a smoothing length. Doubling it does not halve the responsiveness the way it would on an EMA; it changes the stretch of chart the jaggedness is measured over.
- How is it different from AMA?
- Both replace a fixed smoothing constant with a measured one, and they measure different things. Kaufman's AMA uses an efficiency ratio — how much net distance the price covered against how much total distance it travelled. FrAMA uses the fractal dimension of the curve, which is about how jagged the path is rather than how far it got. A market can travel a long way by a very rough route, and that is exactly where the two disagree.
- Why does changing applied price barely do anything?
- Because it is not in the part that adapts. The fractal dimension is computed from the bars' highs and lows regardless of the setting; applied price only selects the series that the resulting weight is applied to. On an ordinary moving average applied price is one of only two controls, so the habit of treating it as significant carries over — here it is close to cosmetic.
- Can I use the smoothing factor as a signal?
- Not from this node. iFrAMA publishes one buffer and it is the average itself; the dimension and the weight are computed inside and discarded. The chart on this page draws the factor because it is what the indicator is about, but a Builder flow cannot read it. If a flow needs an explicit statement that the market is quiet, that has to come from a different indicator.
- Can I build a FrAMA EA without coding?
- Yes. The FrAMA vs Fixed EMA template puts a FrAMA node at 14 next to a Moving Average node set to EMA 28 — the same window FrAMA reads — and trades the crossings between them, closing the opposite side before it enters. The period, the fixed length and method, the shift, the stop distances, the lot and the spread limit are all EA inputs.
- How should I validate settings before going live?
- Backtest on quality tick data, then demo, and check two things that are specific to this indicator. First, that the test period is long enough to contain both regimes — an adaptive average tested only in a trend is being judged on the half of its job it does not need to do. Second, that the instrument does not gap much: the weighting is only well behaved while the two half-windows overlap in price, so an instrument with frequent gaps is testing the arithmetic as much as the strategy. And because the period is a window rather than a smoothing length, resist scanning it — the number that wins a scan is describing the sample, not the market.
Articles connexes
Glossary