Automated math-based index trading for MetaTrader 4. Calculates daily levels, determines bias, and executes a strict 3-trade pending order sequence — fully automated.
Open Source — Free to use. Expires 2026-03-28. By Syarief Azman.
A rules-based mathematical approach to US index trading.
At 18:00 New York time, the EA reads the previous completed NY day's OHLC data and the day-before-yesterday's close (PRV). These values are locked for the session.
Net Change = CV − PRV. If positive → Buy-only day. If negative → Sell-only day. If zero → No trades. Opposite-direction trades are never allowed.
A pending order is placed at the PRV level. This is the activation trade — T2 and T3 are only placed after T1 fills.
After T1 fills: T2 enters at the extreme level (Low for buys, High for sells) and T3 enters at the CV level.
All trades share a single TP: CV + Net Change. If bearish, the TP projects downward automatically.
At 15:29 NY the next day, the trading window closes. Unfilled pending orders are cancelled automatically.
| Symbol | Meaning | Chart Color |
|---|---|---|
| PRV | Previous Reference Value (2 days ago close) | 🟠 Orange |
| CV | Closing Value (yesterday's close) | 🔵 Cyan |
| H | Daily High | 🔴 Red |
| L | Daily Low | 🟢 Green |
| TP | Take Profit = CV + Net Change | 🟡 Yellow |
Precision index trading with mathematical edge.
Uses daily OHLC levels and net change calculations to determine directional bias — no indicators, pure math.
Designed specifically for US30 and NAS100 trading with NY session timing.
Executes a strict T1 → T2 → T3 pending order sequence, all sharing a unified take profit target.
Locks levels at 18:00 NY time and trades until 15:29 the next day. Fully DST-aware.
Live panel showing account info, bias, levels, order status, and expiry countdown.
Fixed lots or dynamic risk-percent sizing, spread filter, and optional emergency stop loss.
Restrict the EA to approved symbols only, with configurable CSV list for broker variants.
Automatically cancels unfilled pending orders after the trading window closes.
Get MathEdge Pro running on your MT4 terminal.
MT4: Download MathEdge Pro v1.1 - MT4.ex4 using the button above.
MT5: The MT5 source file (MathEdge Pro.mq5) is available in the MT5/ folder. Open it in MetaEditor and compile to get the .ex5 file.
MT4: Open MT4 → File → Open Data Folder. Place the .ex4 file in MQL4/Experts/.
MT5: Open MT5 → File → Open Data Folder. Place the .ex5 file in MQL5/Experts/.
Restart the terminal or right-click the Navigator panel and select Refresh.
Open a US30 or NAS100 chart (any timeframe — the EA is timeframe-independent). Drag MathEdge Pro onto the chart. In the Common tab, enable Allow live trading. No DLL imports required.
Set your Lots or enable UseRiskPercent. If your broker uses a different symbol name (e.g. US30m, NAS100.cash), add it to AllowedSymbolsCSV. Set DrawLevels = true and ShowDashboard = true to verify levels against TradingView.
Always test on a demo account first. Ensure the AutoTrading button is ON (green). The EA will start at the next 18:00 NY session.
All parameters are adjustable from the EA input dialog.
| Parameter | Default | Description |
|---|---|---|
MagicNumber | 260128 | Unique ID for this EA's orders |
Lots | 0.10 | Fixed lot size per trade |
UseRiskPercent | false | Calculate lots dynamically based on RiskPercent |
RiskPercent | 1.0 | % of free margin risked per trade |
MaxSpreadPoints | 300 | Orders skipped if spread exceeds this value |
PlacePendingOrders | true | Place pending orders at calculated levels |
CancelPendingsAfterWindow | true | Cancel unfilled pendings after window closes |
CloseOpenAtWindowEnd | false | Close open positions when window ends |
EmergencySL_Points | 0 | Hard stop-loss in points (0 = disabled) |
DrawLevels | true | Draw PRV, CV, H, L, TP lines on chart |
ShowDashboard | true | Display live info panel on chart |
| Problem | Solution |
|---|---|
| EA not trading | Check that AutoTrading is ON and the symbol matches the whitelist |
| "Symbol not allowed" | Add your broker's symbol name to AllowedSymbolsCSV |
| Levels differ from TradingView | Toggle UseCustomNYDailyOHLC — broker D1 boundaries may differ from NY 18:00 |
| Orders skipped (spread) | Spread exceeds MaxSpreadPoints — wait for lower spread or increase the limit |
| T2/T3 not appearing | T2 and T3 only place after T1 fills — this is by design |
Please understand the risks before using MathEdge Pro.
Always test on a demo account before using real money
Past performance does not guarantee future results
US30 and NAS100 are highly volatile — use appropriate position sizing
The strategy has no built-in SL — set EmergencySL_Points for safety
The EA relies on NY session timing — ensure your broker's time aligns correctly
Verify levels match your reference source, especially initially
US30 and NAS100 (and broker variants like US30m, NAS100.cash). Add your broker's exact symbol name to AllowedSymbolsCSV if needed.
No — the EA is timeframe-independent. It uses daily OHLC data calculated from M1 bars at NY session boundaries.
T2 and T3 only place after T1 is filled — this is by design. T1 acts as the activation trade.
Toggle UseCustomNYDailyOHLC between true and false. Your broker's D1 candle boundaries may differ from NY 18:00 boundaries.
No. The strategy is specifically designed for US index math. Using it on forex would produce meaningless levels.
The core strategy does not define a stop loss. Set EmergencySL_Points > 0 for a safety net if desired.