MT4 · MT5 · US30 · NAS100

MathEdge Pro

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.

Strategy

How It Works

A rules-based mathematical approach to US index trading.

1

Lock Daily Levels

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.

2

Calculate Bias

Net Change = CV − PRV. If positive → Buy-only day. If negative → Sell-only day. If zero → No trades. Opposite-direction trades are never allowed.

3

T1: Activation Trade

A pending order is placed at the PRV level. This is the activation trade — T2 and T3 are only placed after T1 fills.

4

T2 & T3: Follow-Up Entries

After T1 fills: T2 enters at the extreme level (Low for buys, High for sells) and T3 enters at the CV level.

5

Unified Take Profit

All trades share a single TP: CV + Net Change. If bearish, the TP projects downward automatically.

6

Window Closes

At 15:29 NY the next day, the trading window closes. Unfilled pending orders are cancelled automatically.

Key Levels

SymbolMeaningChart Color
PRVPrevious Reference Value (2 days ago close)🟠 Orange
CVClosing Value (yesterday's close)🔵 Cyan
HDaily High🔴 Red
LDaily Low🟢 Green
TPTake Profit = CV + Net Change🟡 Yellow
Capabilities

Key Features

Precision index trading with mathematical edge.

📐

Math-Based Strategy

Uses daily OHLC levels and net change calculations to determine directional bias — no indicators, pure math.

📊

US Index Specialist

Designed specifically for US30 and NAS100 trading with NY session timing.

🎯

3-Trade Sequence

Executes a strict T1 → T2 → T3 pending order sequence, all sharing a unified take profit target.

NY Session Timing

Locks levels at 18:00 NY time and trades until 15:29 the next day. Fully DST-aware.

📈

On-Chart Dashboard

Live panel showing account info, bias, levels, order status, and expiry countdown.

🛡️

Smart Risk Control

Fixed lots or dynamic risk-percent sizing, spread filter, and optional emergency stop loss.

🔧

Symbol Whitelist

Restrict the EA to approved symbols only, with configurable CSV list for broker variants.

📉

Auto Cleanup

Automatically cancels unfilled pending orders after the trading window closes.

Getting Started

Installation Guide

Get MathEdge Pro running on your MT4 terminal.

1. Download the EA

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.

2. Install in MetaTrader

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.

3. Attach to Chart

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.

4. Configure Inputs

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.

5. Start on Demo

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.

Configuration

EA Settings

All parameters are adjustable from the EA input dialog.

ParameterDefaultDescription
MagicNumber260128Unique ID for this EA's orders
Lots0.10Fixed lot size per trade
UseRiskPercentfalseCalculate lots dynamically based on RiskPercent
RiskPercent1.0% of free margin risked per trade
MaxSpreadPoints300Orders skipped if spread exceeds this value
PlacePendingOrderstruePlace pending orders at calculated levels
CancelPendingsAfterWindowtrueCancel unfilled pendings after window closes
CloseOpenAtWindowEndfalseClose open positions when window ends
EmergencySL_Points0Hard stop-loss in points (0 = disabled)
DrawLevelstrueDraw PRV, CV, H, L, TP lines on chart
ShowDashboardtrueDisplay live info panel on chart
Help

Troubleshooting

ProblemSolution
EA not tradingCheck that AutoTrading is ON and the symbol matches the whitelist
"Symbol not allowed"Add your broker's symbol name to AllowedSymbolsCSV
Levels differ from TradingViewToggle 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 appearingT2 and T3 only place after T1 fills — this is by design
⚠️ Important

Risk Disclaimer

Please understand the risks before using MathEdge Pro.

🧪
Demo First

Always test on a demo account before using real money

📉
No Guarantees

Past performance does not guarantee future results

📊
Index Volatility

US30 and NAS100 are highly volatile — use appropriate position sizing

💰
No SL by Default

The strategy has no built-in SL — set EmergencySL_Points for safety

Session Dependent

The EA relies on NY session timing — ensure your broker's time aligns correctly

👀
Monitor Daily

Verify levels match your reference source, especially initially

Support

Frequently Asked Questions

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.