On this page
What Laguerre shows
Laguerre transforms Close through four recursive filter stages into a value between 0 and 1. It is sometimes called Laguerre RSI, but it does not use the standard RSI average-gain/average-loss calculation. The 0.2 and 0.8 levels describe oscillator crossings; they do not establish a complete entry, stop or exit rule.
ForexBestRobots edition 1.04 is a marked adaptation of EarnForex 1.03, based on Emerald King’s work. It adds parameter and data guards, deterministic bounded-window recalculation, separate instance ownership and explicit confirmation timing. The downloads retain the unchanged original, copyright notices, Apache 2.0 and a patch showing our changes.
The four-stage calculation
Each new Close updates L0, L1, L2 and L3 using their previous values. CU is the sum of positive adjacent differences; CD is the sum of their negative magnitudes. The result is CU/(CU+CD). If the total is at most 1e−12 times the absolute Close, this edition returns 0 to avoid an unstable division. Zero is a valid reading.
All four stages start at zero at the oldest retained source candle. CountBars includes the forming candle: 950 by default, from 3 to 100000; 0 does not mean all history. The bounded window is rebuilt on every calculation. Its rolling start, Gamma and corrected prices can change older values. Candles before that window remain empty; there is no separate fixed warm-up period.
L0_t = (1-g) * Close_t + g * L0_(t-1) L1_t = -g * L0_t + L0_(t-1) + g * L1_(t-1) L2_t = -g * L1_t + L1_(t-1) + g * L2_(t-1) L3_t = -g * L2_t + L2_(t-1) + g * L3_(t-1) CU_t = max(L0-L1,0) + max(L1-L2,0) + max(L2-L3,0) CD_t = max(L1-L0,0) + max(L2-L1,0) + max(L3-L2,0) Laguerre_t = CU_t / (CU_t + CD_t)
Real EUR/USD examples
These are our reconstructions from archived real EUR/USD H1 OHLC, not terminal screenshots or a profit backtest. Each CSV includes the full calculation window. The final source record is an opening-price fixture for the next forming candle. Times are UTC; broker candle boundaries can differ.



Timeframes and confirmation
TimeFrame=PERIOD_CURRENT uses the chart timeframe. An equal or lower selection also uses the chart timeframe. A higher selection must be an exact integer multiple of the chart duration; otherwise initialization is rejected. The program maps actual CopyRates timestamps. If history is not ready or invalid, it clears its outputs rather than retaining stale values.
Previous compares the two latest closed source candles at the next source opening. Current compares the forming source candle with the preceding closed one and can retract. Historical MTF plots map the final higher-candle value back to its opening; lower candles in that block can therefore change while the source candle forms. A plotted historical crossing is not proof that it was known at that earlier time.
Settings and defaults
| Input | Default | Practical meaning |
|---|---|---|
Comment_Main | "=======================" | Visual separator; no calculation effect. |
Gamma | 0.7 | Filter coefficient: finite 0 ≤ Gamma < 1. |
CountBars | 950 | Latest source candles including the forming one; integer 3–100000. Larger windows cost more CPU. |
TimeFrame | PERIOD_CURRENT | Calculation timeframe; see the mapping and fallback rules above. |
Comment_Alerts | "=======================" | Visual separator; no calculation effect. |
AlertOnUpperCross | false | Enable notifications for a fall below UpperLevel. |
AlertOnLowerCross | false | Enable notifications for a rise above LowerLevel. |
UpperLevel | 0.80 | Upper threshold; 0 ≤ LowerLevel < UpperLevel ≤ 1. |
LowerLevel | 0.20 | Lower threshold under the same ordering rule. |
TriggerCandle | Previous | Previous uses closed source candles; Current is provisional. |
AlertPopup | true | Popup delivery; also enable at least one crossing condition. |
AlertSound | false | WAV delivery; also enable a crossing condition. |
AlertSoundFile | "alert.wav" | Sound file name, 1–128 characters, available to the terminal. |
AlertEmail | false | Email delivery; configure the terminal first. |
AlertPush | false | Push delivery; configure the terminal and MetaQuotes ID first. |
Comment_Arrows | "=======================" | Visual separator; no calculation effect. |
EnableDrawArrows | false | Draw arrows independently of notification switches. |
ArrowBuyCode | 241 | Upward arrow symbol code, integer 1–255. |
ArrowSellCode | 242 | Downward arrow symbol code, integer 1–255. |
ArrowSize | 3 | Arrow size, integer 1–5. |
ArrowBuyColor | clrLimeGreen | Upward-arrow color. |
ArrowSellColor | clrRed | Downward-arrow color. |
IndicatorName | "FBR_Laguerre" | Unique name per chart: 1–20 ASCII letters, digits, underscores or hyphens. |
Events, arrows and notifications
An upward event requires previous ≤ LowerLevel and current > LowerLevel; a downward event requires previous ≥ UpperLevel and current < UpperLevel. Both crossing switches are false by default. AlertPopup=true alone sends nothing. EnableDrawArrows is separate and false by default; the 0.5 line is only a reference.
Attachment, reset and recovery after missing history are silent for the active trigger candle. Gaps do not replay a queue of old messages. Later, Previous can notify once per new source opening; Current allows at most one attempt per source candle per direction. A failed channel attempt is consumed, not retried on every tick. Email and push require an online configured desktop terminal.
Confirmed arrows are placed at the first chart opening at or after the next source opening, never backdated to the event candle. Current can also show one provisional LIVE arrow, which moves and disappears if the crossing retracts. Use a distinct IndicatorName for each copy; cleanup is restricted to owned objects. The program does not send trading orders.
Install and compile
- Extract the ZIP for your desktop MT4 or MT5 platform.
- In MetaTrader choose File → Open Data Folder, then MQL4 or MQL5.
- Copy the package’s Indicators folder there; keep upstream separately as the original reference.
- Open Laguerre_ForexBestRobots.mq4 or .mq5 in the matching MetaEditor, press F7 and inspect errors and warnings.
- Refresh Navigator → Indicators and attach to a demo chart with enough history and a unique IndicatorName.
- Start with notification conditions disabled; compare closed source candles before enabling and configuring delivery channels.
Download Laguerre free
Each platform ZIP contains the marked source, unchanged EarnForex original, Apache 2.0, upstream identification, change notes, a patch, checksums and installation instructions in all 12 site languages. No DLL, external include or account registration is required to download it.
These are source packages without ready EX4/EX5 files. Numerical and modeled-API tests outside MetaTrader do not verify native MetaEditor compilation, terminal rendering or actual notification delivery. Compile and inspect diagnostics in the matching desktop terminal, then test on demo. Desktop custom indicators cannot be installed directly in the mobile app.
Free source ZIP · ForexBestRobots edition 1.04 · Compile in MetaEditor
Changing values and limitations
Gamma changes sensitivity; the history window and feed also matter. The current value and MTF block can change before source closure. Rolling the zero-seeded window or correcting history can change older values as well. This edition does not promise an immutable historical line.
Values near 0 or 1 can persist during a trend; 0.2/0.8 crossings can repeat in a range. The examples do not estimate win rate or include spread, commissions, position sizing or exit rules. Treat the oscillator as a calculation to investigate, not a guarantee of reversal or profit.
Frequently asked questions
Is Laguerre the same as standard RSI?
No. It uses four recursive Close-filter stages and adjacent-stage differences, rather than the standard RSI average gains and losses.
Which timeframes are supported?
Current, equal or lower selections use the chart timeframe. A higher timeframe must be an exact integer multiple of the chart duration.
When is a crossing confirmed?
Previous confirms after the source candle closes, at the next source opening. Current is provisional; lower-chart positions 1 and 2 are not necessarily closed higher candles.
Why is the line empty?
History may be unavailable or invalid, the chart candle may precede CountBars, or another instance may own that IndicatorName. Check the terminal Journal.
Does CountBars=0 load all history?
No. Valid integer values are 3–100000; 950 is the default and includes the forming source candle.
Can arrows work without notifications?
Yes. EnableDrawArrows is independent of both crossing-condition flags and the popup, sound, email and push switches.
Are these compiled and verified in MetaTrader?
No. They contain MQ4/MQ5 source. The numerical and modeled-API checks do not replace native compilation and demo-terminal testing.
Sources and review scope
The review follows the pinned EarnForex code and our documented changes. Original authorship and license notices are retained. The real-data figures are our own calculations; inclusion does not imply endorsement by Emerald King or EarnForex.