Lodestar
- エキスパート
-
Alex Amuyunzu Raymond
I’m an experienced MQL5 developer and software engineer specializing in building robust, high-performance algorithmic trading systems for MetaTrader 5. My work goes beyond standard EA development — I design intelligent, scalable solutions that combine market logic, automation, and external - バージョン: 1.5
- アクティベーション: 5
"LODESTAR — Where Institutional Session Logic Meets Retail Accessibility."
What Lodestar Actually Is
Lodestar is not another grid martingale, not another RSI crossover, not another "holy grail" repackaged from a YouTube tutorial. Lodestar is a conditional, cost-aware session execution engine — a research-grade Expert Advisor for MetaTrader 5 that trades the world's major cash and futures sessions using the same logic that real institutional desks apply every single day: participation-weighted direction, regime filtering, cost budgeting, and session boundaries.
Most retail EAs fail because they ignore when they trade. They fire signals at 3 AM on a dead FX pair, cross the rollover with triple swap exposure, and hand the broker half their edge in spread. Lodestar was built from the ground up to fix exactly that problem.
It is a session engine, not a signal generator. It knows when Frankfurt opens, when the DAX cash market starts, when the London fix runs, when the JGB auction settles, when the NYSE bell rings, and when the CME closes. It knows that the EURUSD at 08:00 London is not the same instrument as the EURUSD at 22:00 New York. It sizes every trade in ticks, not pips, in R-multiples, not dreams. And it flatlines itself before rollover, before weekends, and before red-folder news — automatically, with no babysitting.
If you are a serious trader who has been burned by "set and forget" EAs, Lodestar is the answer. It is designed to be studied, tested, and trusted — not blindly trusted, but trusted because the logic is visible, auditable, and honest.
The Core Philosophy: Sessions, Regimes, and Cost
Lodestar operates on three pillars that separate it from 99% of the MQL5 market:
1. Session-Aware Trading. Every trade is tied to a specific session window defined in exchange local time, converted to GMT, and then to your broker's server time — with hand-coded DST rules for the EU, UK, US, Japan, Hong Kong, Singapore, Kuwait, and Brazil. This means Lodestar trades the DAX during Xetra cash hours, the Nikkei during TSE hours, gold during the London PM fix window, and the S&P during the NYSE regular session. It does not guess. It does not approximate. It computes.
2. Regime Selection. Before any trade is taken, Lodestar measures the opening window in two ways: participation ratio (session volume vs. the 20-session median) and efficiency ratio (net move divided by total path). From these it derives a regime: DRIVE (trending, high participation), STRETCH (mean-reverting, low efficiency), or PULLBACK (trend with a healthy retracement). Each regime unlocks only the modules that are statistically appropriate for it. In a trending market, Lodestar takes breakout drive trades. In a choppy market, it takes stretch reversions. In a clean pullback, it takes trend continuations. The wrong module never fires in the wrong regime.
3. Cost Budgeting. Every setup is priced before it is placed. Lodestar computes the spread cost as a fraction of R — the actual money you pay to enter and exit relative to the amount you are risking. If the spread plus a configurable stress buffer exceeds the cost limit (default 0.15R), the trade is rejected. No exceptions. This single rule eliminates the most common cause of retail EA death: paying 30% of your edge to the broker on every round trip.
The Eight Modules: One Engine, Eight Trades
Lodestar is not eight separate EAs glued together. It is one execution engine with eight strategic modules, all sharing the same risk kernel, the same session table, and the same guard pipeline.
-
M1 — Participation Open Drive. At the end of the opening window (default 15 minutes), if the session shows high participation and directional efficiency, Lodestar places a stop order beyond the opening range with a fixed R target. This is the classic "opening drive" pattern that institutional desks trade on every cash open.
-
M2 — Stretch Reversion. When price stretches more than 2.5 ATR from the 25-bar mean, capitulation volume appears, and an exhaustion wick forms, Lodestar fades the move back to the mean. The stop is beyond the extreme. The target is the mean. This is the trade that catches the exhaustion of a failed auction.
-
M3 — DAX Overnight Drift. A time-based drift trade on the DAX from 17:20 CET to the next cash open, with a hard ATR stop. Disabled by default in intraday-only mode.
-
M4 — Failed-Probe Reversal. When price probes beyond the opening range but fails to trigger the M1 stop, Lodestar reverses against the failed probe with a target at the range midpoint. This is the "trap" trade that catches breakout traders on the wrong side.
-
M5 — USDJPY Gotobi Flag. On JST days that are multiples of 5 (the traditional gotobi fixing days), Lodestar flags USDJPY and filters out shorts on that pair for the entire session. This is a real institutional pattern that most retail traders have never heard of.
-
M6 — Asian-Range Fade. When the Asian session ranges cleanly and price sweeps one side of the range then closes back inside (with ADX below 20), Lodestar fades back to the range midpoint. This is the classic "sweep and revert" pattern.
-
M7 — Trend Pullback. On H1, Lodestar checks EMA50 vs EMA200 and the slope of EMA50. If a trend exists, it waits for an M15 pullback to EMA20 with RSI confirmation, then enters in the direction of the higher-timeframe trend.
-
M8 — Gold London-Open Drive. A specialized version of M1 tuned for XAUUSD at the London open, with its own ATR scaling and a hard news blackout (double-length) around high-impact events.
Each module is independently enabled or disabled. Each has its own SL factor, hold time, and entry window, all defined in a single readable table. Nothing is hidden.
The Risk Engine: Built for Prop, Built for Survival
Lodestar's risk engine is not an afterthought. It is the spine of the system.
-
Risk per trade is computed from equity, not balance, and sized in pure tick-value using SYMBOL_TRADE_TICK_VALUE_LOSS . If your broker quotes a weird tick value, Lodestar uses the correct one.
-
Minimum lot respect. If the calculated risk is below the minimum lot, the trade is skipped, not over-risked. This is enforced at the function level, not as a "best effort."
-
Daily drawdown halt. If equity drops by the configured daily percentage (default 3%), Lodestar flattens everything and stops trading for the rest of the day.
-
Total drawdown halt. If equity drops by the configured total percentage from peak (default 8%), Lodestar halts permanently until the global variable is manually cleared.
-
Correlation cap. Total open index risk is capped as a percentage of equity (default 1%). You cannot accidentally have 5 correlated DAX/CAC/MIB trades blowing up together.
-
Max open positions across positions and pendings, enforced by magic number.
-
Post-fill verification. After every fill, Lodestar re-computes the actual risk. If the fill slipped and the risk exceeds budget by more than 20%, the position is closed immediately and logged.
This is not "risk management" as a marketing word. This is risk management as a discipline.
The Guards: Every Reason a Trade Is Rejected
Lodestar logs every single rejection reason to a CSV journal. Nothing is silent. The guard pipeline runs in this exact order, and any failure exits cleanly:
-
No setup (module declined to build).
-
Cost above limit (spread + stress > max cost R).
-
Expiring contract (B3 futures near roll).
-
Flat window (rollover/weekend).
-
Market closed (broker trade mode or stale quotes).
-
News blackout (high-impact calendar events for the row's currencies).
-
Max open orders reached.
-
Symbol already exposed.
-
No-hedge rule (US profile).
-
Consensus rule (DE/FR/IT group — only one position).
-
No spread history for this minute.
-
Spread above N× the same-minute median.
-
SL inside broker stops level.
-
TP inside broker stops level.
-
Stop entry too close or already passed.
-
Entry deadline passed.
-
Risk impossible (min lot exceeds budget).
-
Correlation cap exceeded.
-
Margin check failed.
-
Order rejected by broker (with full retcode text).
Twenty reasons, all logged, all auditable. When you look at a Lodestar journal, you know exactly why every trade was or was not taken. This is what "transparency" actually means.
The Journal and Trade Log
Lodestar writes two CSVs per account, automatically:
-
Lodestar_journal_<login>.csv — every TAKEN and SKIP decision with server time, local time, symbol, row, module, action, reason, score, cost in R, direction, lots, and risk money.
-
Lodestar_trades_<login>.csv — every closed position with open/close time, symbol, module, direction, volume, prices, net money, risk money, and R-multiple.
On tester runs, a third file is written: Lodestar_R_<profile>.csv — the full R-multiple distribution, ready to be analysed in Excel or Python. OnTester() returns net expectancy in R with a trade-count penalty (target 30+ trades), so optimisation does not overfit to a handful of lucky trades.
Profile Presets: One Click, One Market
Lodestar ships with ten market profiles:
-
Europe — DAX, CAC, MIB, EURUSD, EURGBP, gold.
-
Germany/France/Italy — with consensus rule (only one of the three indices traded).
-
UK — FTSE, GBPUSD.
-
Japan — Nikkei, USDJPY, with gotobi flag.
-
Singapore — HK50, Nikkei, gold.
-
Kuwait — gold, oil (intraday forced, swap-free friendly).
-
USA — S&P, Nasdaq, major FX, FIFO + no-hedge enforced.
-
Canada — S&P, Nasdaq, USDCAD.
-
Latin America — offshore S&P, gold, FX (with reduced max lot).
-
Brazil B3 — WIN and WDO futures with automatic contract rolling.
Select a profile, and Lodestar loads the right sessions, symbols, aliases, DST rules, and market rules for that region. No manual configuration.
Symbol Resolution: It Finds Your Broker's Names
Lodestar does not assume your broker calls it "GER40." It ships with a wide alias table covering every common naming convention: GER40, DE40, DAX40, GER30, DE30, DAX, GERMANY40, DEU40, DEUIDX — and dozens more for every symbol. If your broker has a unique suffix (like EURUSDm , US100.cash , DE40_SB ), Lodestar's scoring-based alias matcher finds the right symbol automatically. You can also extend the alias table at runtime via InpAliases .
For B3 futures, Lodestar picks the most liquid non-expiring contract from the option chain, and rolls automatically once per server day — but never while exposed. No gap risk on rollover day.
Placebo and Stress Modes: The Honest Research Tool
Two features that no marketing EA would include, and that serious researchers will love:
-
Placebo mode ( InpPlacebo ). When enabled, Lodestar keeps the exact same timing, bracket, and risk, but randomises the direction with a seeded RNG. This lets you test whether your edge is real or whether you are just riding beta. If Lodestar's directional logic does not beat its own placebo, you know the edge is not in the direction.
-
Cost stress ( InpStressPts ). Adds a configurable number of points to every entry and subtracts from every target, simulating a worse broker or a volatile spread environment. If your strategy only works at zero stress, it does not work.
These two features alone make Lodestar worth the price for anyone doing serious quantitative work.
Self-Tests: The EA That Verifies Itself
On OnInit() , Lodestar runs a self-test suite covering:
-
Symbol alias matching (suffix, prefix, rejection cases).
-
Lot-sizing math (exact budget, budget-respecting floor, impossible-risk refusal).
-
US and EU DST transition dates (both start and end, both sides of the switch).
-
CET/UK/NY time conversions on the exact DST gap weeks.
-
No-DST zones (JST, KWT, HKT).
-
FIFO oldest-position selection.
-
B3 contract code pattern (WINZ26, WDOF27, not WINFUT).
-
B3 contract picking (skips expiring, picks liquid).
If any self-test fails, the EA refuses to load. This is how you know the core math is correct before a single trade is placed.
The Dashboard: Everything, On-Chart
When running live or in visual mode, Lodestar displays a compact on-chart dashboard showing:
-
Active profile and local time.
-
Enabled modules.
-
Intraday/Prop/Placebo/Regime status flags.
-
Equity, day P&L, day DD, total DD, risk used.
-
Halt state (daily, total, or active).
-
Next high-impact news event.
-
Per-row status: symbol, session ID, stage, regime, participation, efficiency, spread vs. median, traded flag.
-
Last decision.
No clutter. No marketing. Just the numbers that matter.
Who Lodestar Is For
-
Serious retail traders who want session-aware execution without writing their own engine.
-
Prop firm challengers who need strict drawdown control, news blackouts, and consistency rules baked in.
-
Quantitative researchers who want a transparent, auditable, journal-everything framework they can extend.
-
Anyone who has lost money to a "set and forget" EA and wants to understand why every trade was taken.
Who Lodestar Is Not For
-
Traders looking for a "100% win rate" holy grail. Lodestar does not promise profits. It promises process.
-
Traders who want to run it on a cent account with a $50 deposit. The risk engine is designed for real capital.
-
Traders who refuse to read a journal. Lodestar's value is in its transparency; if you do not use it, you are wasting it.
The Honest Disclaimer
Lodestar is a research tool. No profit is implied or guaranteed. Past performance in a tester does not guarantee future results in live markets. Spreads widen, slippage happens, brokers change rules, and markets regime-shift. Lodestar is designed to survive those realities — not to pretend they do not exist. Trade it on demo first. Then trade it small. Then scale only if the journal proves the edge on your broker, your account, and your market conditions.
That is the honest pitch. That is what a serious tool sounds like.
Summary Table
| Feature | Detail |
|---|---|
| Platform | MetaTrader 5 |
| Profiles | 10 (Europe, DE/FR/IT, UK, Japan, Singapore, Kuwait, USA, Canada, LatAm, Brazil) |
| Modules | 8 (M1–M8), independently switchable |
| Regimes | DRIVE / STRETCH / PULLBACK, auto-detected |
| DST zones | EU, UK, US, JST, HKT, SGT, KWT, BRT — hand-coded |
| Risk presets | Conservative / Balanced / Prop / Custom |
| Halts | Daily + total, equity-based |
| Guards | 20 rejection reasons, all logged |
| Journals | 2 CSVs live, 1 extra in tester |
| Placebo mode | Yes, seeded RNG |
| Cost stress | Yes, configurable |
| Self-tests | Yes, blocks load on failure |
| Dashboard | Yes, on-chart |
| B3 auto-roll | Yes, never while exposed |
