SparkHedge MT5 EA v1.10 Source Code
Pinned Free
Influencer
MT5v1.10
Two-way pending-order hedge + dynamic grid + martingale averaging + long/short lock close + simple panel. Good for ranging and long/short-churn markets.
Details & Usage Instructions
Core Features
1. Two-way Pending-order Layout
First-order distance: current price ± first distance.
Averaging distance: current price ± averaging distance.
Order price moves with current price; auto-rewrite at trailing step.
After fill, auto-enter position management.
2. Three Opening Rhythms
By new candle: open only on new candle, period selectable.
By time interval: open every N seconds.
Immediate: no limit, open anytime.
3. Five Trading Sessions (PC time)
Each group independently enableable.
Supports cross-midnight sessions.
All off = trade all day.
4. Martingale Averaging Lot
First order: start lot, scaled up by ratio when above adaptive-capital start.
Averaging: start lot × averaging-multiplier^n.
Max single-order lot cap.
Lot decimal places adjustable.
5. Dynamic Order Distance
First-order distance.
First averaging distance.
Second averaging distance (switch when price detaches).
Platform min-distance auto-correction.
6. Multi-level Close System
Long/short hedge overall-profit close: both held and overall profit target → close all.
Overall-profit close: overall profit target → close all.
One-side profit close: long or short alone hits target → close that side.
Stop-loss amount: overall loss target → close all.
Both-side loss close: both-side combined loss target → close all (needs overall-profit off).
Floating loss to stop averaging: one-side floating loss over threshold → stop that side's averaging.
7. Hedge Lot-imbalance Judgment
After long, shorts far exceed longs (>3× and diff >0.2 lot): mark closeable.
After short, longs far exceed shorts (>3× and diff >0.2 lot): mark lockable.
8. Post-close Control
Stop trading after close (optional).
Wait N seconds after close before new order (optional).
9. Platform Risk
Spread limit: no open above set value.
Leverage limit: no open below set value.
Margin check: need >2× available margin to open.
Panel
Info area
Balance, equity, free margin
Long count, lots, P/L
Short count, lots, P/L
Total P/L
PC time + in/out-session status
Chart aids
Long average line (blue dashed)
Short average line (red dashed)
One-click buttons
Close long
Close short
Close all
Button P/L color: profit blue, loss gray
Confirm popup before execute
Suitable Market
Good for ranging markets, long/short-churn markets.
Not for extreme one-sided, no-pullback, frequent-gap markets.
1. Two-way Pending-order Layout
First-order distance: current price ± first distance.
Averaging distance: current price ± averaging distance.
Order price moves with current price; auto-rewrite at trailing step.
After fill, auto-enter position management.
2. Three Opening Rhythms
By new candle: open only on new candle, period selectable.
By time interval: open every N seconds.
Immediate: no limit, open anytime.
3. Five Trading Sessions (PC time)
Each group independently enableable.
Supports cross-midnight sessions.
All off = trade all day.
4. Martingale Averaging Lot
First order: start lot, scaled up by ratio when above adaptive-capital start.
Averaging: start lot × averaging-multiplier^n.
Max single-order lot cap.
Lot decimal places adjustable.
5. Dynamic Order Distance
First-order distance.
First averaging distance.
Second averaging distance (switch when price detaches).
Platform min-distance auto-correction.
6. Multi-level Close System
Long/short hedge overall-profit close: both held and overall profit target → close all.
Overall-profit close: overall profit target → close all.
One-side profit close: long or short alone hits target → close that side.
Stop-loss amount: overall loss target → close all.
Both-side loss close: both-side combined loss target → close all (needs overall-profit off).
Floating loss to stop averaging: one-side floating loss over threshold → stop that side's averaging.
7. Hedge Lot-imbalance Judgment
After long, shorts far exceed longs (>3× and diff >0.2 lot): mark closeable.
After short, longs far exceed shorts (>3× and diff >0.2 lot): mark lockable.
8. Post-close Control
Stop trading after close (optional).
Wait N seconds after close before new order (optional).
9. Platform Risk
Spread limit: no open above set value.
Leverage limit: no open below set value.
Margin check: need >2× available margin to open.
Panel
Info area
Balance, equity, free margin
Long count, lots, P/L
Short count, lots, P/L
Total P/L
PC time + in/out-session status
Chart aids
Long average line (blue dashed)
Short average line (red dashed)
One-click buttons
Close long
Close short
Close all
Button P/L color: profit blue, loss gray
Confirm popup before execute
Suitable Market
Good for ranging markets, long/short-churn markets.
Not for extreme one-sided, no-pullback, frequent-gap markets.

Risk Warning:Resources on this site are for learning, research and technical exchange only, and do not constitute any investment advice. Before running any EA on any account, please do thorough forward-testing on a demo account first; no strategy can guarantee profits.