Adaptive EMA Envelope EA
- Experts
- Versão: 4.10
Adaptive EMA Envelope EA
Adaptive EMA Envelope EA is a MetaTrader 5 Expert Advisor that trades closed-candle signals from an EMA-centered adaptive volatility envelope. The band calculation is embedded in the EA; no separate indicator purchase is required.
Entry logic
The default mode buys when a candle closes back above the lower band after the preceding candle closed below it. It sells when a candle closes back below the upper band after the preceding candle closed above it.
The alternative mode buys on a close below the lower band and sells on a close above the upper band. This is a countertrend entry rule, not a breakout-following rule. Entries use completed candles and are evaluated once per new candle. The EA checks its logic on a five-second timer.
Adaptive bands
The central line is an EMA of closing prices. Band distance uses the greater of a Wilder-smoothed ATR component and a True Range shock component. Expansion response and contraction smoothing are separately adjustable. Defaults are EMA 50, ATR 14, ATR multiplier 2.5, shock multiplier 1, expansion response 1 and contraction period 20.
Position management
Buy and sell baskets are managed separately. Additional positions require a new qualifying band signal and an adverse price distance from the latest same-direction entry. Volume increases by the lot increment. Recovery distance also depends on the configured distance multiplier and current lot size. Spread, entry distance and maximum position counts constrain new entries.
The profit target is applied to each directional basket. Swap adjustment can be enabled; it uses floating position profit plus swap and does not include commissions. Profit lines are reference levels, not guaranteed execution prices or broker-side take-profit orders.
Optional hedge mode opens an opposite position when the configured floating loss threshold is reached. The loss threshold uses account currency. Hedge volume is derived from the total non-hedge volume and the hedge ratio. Hedge positions use an initial stop loss and a configurable breakeven trigger. Broker minimum stop distances can increase the actual initial hedge stop distance.
Requirements and settings
This strategy requires a MetaTrader 5 hedging account because it manages multiple independent positions and can hold opposite positions. Netting accounts are not supported. Auto Trading must be enabled for execution. Use a unique magic number for independent strategies on the same symbol. The symbol and timeframe come from the chart.
Distance inputs use a pip defined as ten points for symbols quoted with three or five digits, and one point otherwise. Review these distances for metals, indices and other non-Forex instruments. Requested lots are adjusted to broker volume limits and steps; small requested lots can be increased to the broker minimum.
Risk and behavior
Recovery positions increase exposure during adverse price movements. Ordinary basket positions do not have individual stop losses, and there is no account equity stop. Hedge mode is optional and does not guarantee loss limitation. The terminal must remain running and connected for basket exits and hedge management. Sustained trends, gaps, execution conditions and insufficient margin can produce substantial losses.
The open-candle bands change with prices. Historical values can change if broker history or the historical starting point changes. Default parameters are not optimized for every symbol or timeframe. Test the chosen configuration before use. No profit, loss recovery or particular trading outcome is guaranteed.
