Description
EA LAB / TREND & PULLBACK / EA017
Heiken Flow
Find the flow.
Wait for the pullback.
Trade the closed-candle decision.
Smoothed Heiken Ashi and EMA context turn a trend into a precise sequence: regime, pullback, confirmation, risk and execution.

THE DECISION SEQUENCE
CROSS → PULLBACK → CONFIRM
One candle establishes the pullback. The next closed candle supplies confirmation. Only then can the EA submit a market entry.
What this EA does
EA017 automates smoothed-Heiken-Ashi / EMA crossover context, pullback and closed-candle confirmation on MT5. Configurable exits and swing trailing let you research the behavior on your own broker data.
What actually triggers an entry?
Heiken Flow calculates smoothed HA internally and compares its close with an EMA of native candle closes. The chart timeframe drives signals; H4 is the supplied research reference. Both BUY and SELL logic are implemented.
| CHECK | BUY | SELL |
|---|---|---|
| Regime | Most recent HA close crossing above EMA | Most recent HA close crossing below EMA |
| Current direction | Closed HA bar 1 remains above EMA | Closed HA bar 1 remains below EMA |
| Pullback on bar 2 | Native high/low overlaps HA body zone plus tolerance | Same overlap rule, mirrored regime |
| HA color on bar 1 | Bullish when matching color is enabled | Bearish when matching color is enabled |
| Confirmation | Selected bullish engulfing/pinbar, or HA-only mode | Selected bearish engulfing/pinbar, or HA-only mode |
| Timing | Market BUY at next-bar Ask after gates pass | Market SELL at next-bar Bid after gates pass |
Bar 2 is the pullback candle; bar 1 is the confirmation candle. The entry happens on the next bar, at available market prices. A pullback by itself is not a signal.
Choose your confirmation
Native price action
Choose engulfing OR pinbar, engulfing only or pinbar only. A BUY pinbar must close bullish, have a lower wick at least the configured multiple of body size and a lower wick larger than its upper wick. SELL mirrors these rules.
HA color only
Mode 3 skips the native price-action pattern. Matching HA color is still a separate switch. The supplied GOLD H4 preset uses this mode with matching color enabled, so its trades do not require a pinbar or engulfing.
Code defaults versus the supplied preset
| SETTING | CODE DEFAULT | GOLD H4 EXAMPLE |
|---|---|---|
| HA / EMA | 20 / 200 | 6 / 23 |
| Crossover age / tolerance | 80 / 30 points | 0 / 0 points |
| Confirmation | Engulfing OR pinbar | HA color only; matching color=true |
| One entry per cross | true | false |
| TP | Fixed 3R | R-multiple=3.0 |
| Opposite HA closure | true | true |
| Swing trailing | OFF | ON / H2 |
| Initial SL / buffer | Previous smoothed HA / 30 points | Same |
| Pyramiding | OFF | OFF |
Age=0 disables the explicit age rejection, but the search still looks back roughly 300 bars. Loading the SET replaces the defaults. A generic HA20/EMA200 description must not be mistaken for the HA6/EMA23 configuration behind this report.
Example historical backtest
| CONTEXT | SUPPLIED REPORT |
|---|---|
| Release / symbol / timeframe | EA017 v1.03 / GOLD.pro / H4 |
| Period / broker | 2025.01.01 – 2026.10.01 / OANDA TMS Brokers S.A. |
| Deposit / leverage / sizing | USD 5,000 / 1:100 / 3% of equity |
| Net profit / final balance | USD 98,413.21 / USD 103,413.21 |
| Profit Factor / trades / win rate | 1.72 / 305 / 42.95% |
| Relative equity drawdown | 28.86% (USD 4,463.75) |
| Maximal equity drawdown | USD 16,398.26 (26.79%) – a different extremum |
| Largest loss / losing sequence | USD -8,952.14 / 10 consecutive losses |
| History quality / ticks | 99% / 145,069,618 |
| Model and costs | Exact modeling mode and complete cost assumptions not stated in report summary |
One historical configuration, not verified live performance or out-of-sample validation. The original deal table reconstructs 306 balance points: the initial deposit plus 305 closing trades; entry deals have zero balance impact in this report, and matches the final balance. Balance is not floating equity. Past results do not guarantee future performance.
Actual trades: the original MT5 charts
These are supplied GOLD.pro H4 visual-test screenshots for v1.03. Both winning and losing trades are visible. Click a chart to inspect the full-size original.




Risk, limits and operating details
Risk-percent mode uses current account equity and initial SL distance. Fixed lot and ARS are alternatives. Broker minimum-lot normalization can exceed nominal risk; the total-volume input applies only inside risk-percent sizing. These are not guaranteed loss caps.
Pyramiding can be OFF, every signal or only when all own positions are profitable. Position counting differs on netting accounts. Broker hours, daily realized P/L limits, entry-deal count and optional spread filter can block new entries without liquidating current trades.
Stops and buffers are in symbol points. Broker minimum-stop and freeze restrictions can reject an entry or trailing modification. InpCloseAtEndTime is reserved and has no end-time liquidation action in this release.
Research with Custom max
Select Custom max in MT5. Smooth Equity is the default; Net Profit is the alternative. Both apply minimum-trade and maximum-relative-equity-DD gates (defaults: 40 trades, 35%). Smooth Equity adds equity linearity, positive balance weeks, stagnation and underwater penalties. A rejected pass receives a huge negative ranking value; the score is not a return percentage.
Optimize a small set of signal parameters first, then exit and trailing behavior. Keep risk fixed, test nearby values and reserve a later period for forward validation. Generic seeded ranges differ from the supplied preset, including its HA6/EMA23 values.
Your customer package
- Compiled EA017 v1.03 EX5.
- GOLD H4 example SET with a blank license field.
- 21-page English manual with settings and trade examples.
- START_HERE and release notes.
The package excludes private MQ5 source and customer keys. Authorized customer access supplies the software after purchase.
Installation and license
- Copy EX5 to MQL5/Experts and refresh Navigator.
- Open the exact broker symbol and H4 for the example; load the supplied SET.
- Review point size, minimum volume, risk and exits.
- Enter your EA017 purchase key and allow https://ea-lab.dev in MT5 WebRequest settings.
- Enable Algo Trading and check LICENSE ACTIVE; Strategy Tester uses TESTER MODE without online activation.
- Backtest and demo-test your broker configuration before live use.
EA LAB licensing allows two authorized account/server combinations per purchase. Temporary network/server failure can use a 72-hour grace period after successful validation. Invalid licensing blocks new entries while existing positions continue receiving EA management. MT5 must remain running for HA exits and trailing.
Frequently asked questions
Does the chart timeframe matter?
Yes. Signals use the attached chart timeframe. H4 is the supplied example; another timeframe changes the strategy.
Can it trade markets other than gold?
There is no hard-coded symbol restriction, but the supplied evidence covers GOLD.pro H4 only. Research each broker symbol separately.
Why did a 3R trade close early?
Opposite HA color or swing trailing may close before the target. A positive SL result is possible after trailing.
Does the preset require a pinbar?
No. It uses HA-color-only confirmation, with matching HA color enabled.
Do I need a custom indicator?
No. HA calculation is internal and EMA uses the standard MT5 indicator.
Historical results are not a forecast. Leveraged trading can cause substantial loss. Support: ea@ea-lab.dev.




Reviews
There are no reviews yet.