거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
Experts

ADX Trend Pullback EA - MetaTrader 5용 expert

Duy Van Nguy
Duy Van Nguy
안녕하세요, 저는 Duy Van Nguy입니다. MQL5.com에서 고성능 자동매매 시스템(EA), 지표 및 유틸리티를 개발하는 전문 개발자입니다. 저의 사명은 정밀하고 신뢰할 수 있으며 탁월한 성과를 내는 최고의 도구를 통해 트레이더 여러분의 성공을 돕는 것입니다. 모든 제품은 세심한 디테일로 제작되며, 빠르고 맞춤형 지원도 함께 제공됩니다.
문의 사항이 있으시면 ‘메시지 보내기’를 클릭해 주세요. 신속하게 도와드리겠습니다.
지금 프리미엄 도구를 확인하시고, 여러분의 트레이딩을 한 단계 업그레이드해 보세요:
조회수:
1078
평가:
(1)
게시됨:
업데이트됨:
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Brief Description

This Expert Advisor combines an ADX-based trend strength filter with an EMA pullback entry technique, using ATR for dynamic stop loss and take profit sizing. It is designed for trading a single symbol with one position open at a time.


What ideas is the code based on?

The strategy is built on three established concepts. First, the Average Directional Index (ADX) is used to measure trend strength: a rising ADX above a defined threshold indicates that a trend is developing or strengthening, while a flat or falling ADX suggests a weak or ranging market. Second, an Exponential Moving Average (EMA) is used as a dynamic reference level for pullback detection: price moving close to the EMA and then away from it again is treated as a pullback within the prevailing trend. Third, the Average True Range (ATR) is used to express stop loss and take profit distances in terms of current market volatility rather than fixed pip values, and the Plus/Minus Directional Indicators (+DI / -DI) from the ADX indicator are used to determine trade direction.

How can the indications be interpreted?

All calculations are performed on closed bars of the timeframe selected in the input settings, and signals are evaluated once per new bar. The entry logic requires two conditions to be satisfied together:

1. Trend filter: ADX on the previous bar must be above the ADX threshold and higher than ADX on the bar before that, indicating increasing trend strength.

2. Pullback event: the distance between price and the EMA, expressed as a multiple of ATR, must have been at or above the pullback ratio on the earlier bar and dropped below it on the previous bar. This represents price approaching the EMA and then moving away again.

When both conditions are met, the trade direction is determined by comparing +DI and -DI on the previous bar: if +DI is greater than -DI, a buy signal is generated; if -DI is greater than +DI, a sell signal is generated. The trade direction input can restrict the EA to buy-only, sell-only, or both directions.

Stop loss distance is calculated as ATR multiplied by the SL multiplier input, and take profit distance is the stop loss distance multiplied by the risk-reward ratio input. Only one position per symbol is allowed at a time, and a new position is only considered when no position is currently open.


Suitable Symbols and Timeframes

The EA is configured by default for the H1 timeframe, but the timeframe used for indicator calculations can be changed independently of the chart timeframe through the input settings. Because the logic relies on ADX, EMA, and ATR values that adapt to current volatility, it can in principle be applied to a range of liquid symbols and timeframes. Testing on the target symbol and timeframe in the Strategy Tester is recommended before live use.

Description of #include Files Used

This code does not use external #include files. All logic is contained in a single source file.

Description of Main External Variables

Variable Default Description
InpTradeDirection TRADE_BOTH Restricts trading to both directions, buy only, or sell only
InpMagicNumber 270601 Magic number used to identify orders placed by this EA
InpLotSize 0.01 Fixed lot size used for every trade
InpATR_SL_Multiplier 1.5 Stop loss distance, expressed as a multiple of ATR(14) on the previous bar
InpRR_Ratio 2.0 Take profit distance, expressed as a multiple of the stop loss distance
InpIndicatorTF PERIOD_H1 Timeframe used for ADX, EMA, and ATR calculations
InpADXPeriod 14 Period used for the ADX indicator
InpEMAPeriod 20 Period of the EMA applied to the close price
InpATRPeriod 14 Period used for the ATR indicator
InpADXThreshold 25.0 Minimum ADX value required, combined with a rising ADX, to allow an entry
InpPullbackATRRatio 0.5 Distance from the EMA, as a multiple of ATR, used to define a pullback event
002 - Inside Bar 002 - Inside Bar

Expert Advisor for testing the Inside Bar continuation hypothesis. The EA places pending orders in the direction of the Main Bar after a valid Inside Bar pattern is detected, with optional ATR and pattern quality filters.

Geometric signal validation for indicator signals Geometric signal validation for indicator signals

A state engine to provide geometric signal validation for indicator signals

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

MACD Signals MACD Signals

Indicator edition for new platform.