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

Moving Average Crossover EA Gold - MetaTrader 5용 expert

Cristhian Alexander Gaibor Cuasquer
Cristhian Alexander Gaibor Cuasquer
4.8 (38)
2017년부터 트레이더이자 MQL5 회원입니다.
9년 동안, 대부분 XAUUSD 차트 앞에서 보낸 뒤, 제가 실제 매매에서 쓰는 도구들을 공개하기로 했습니다. 팔기 위해 만든 것은 하나도 없습니다. 모두 제게 필요해서 만들었습니다. 더 명확한 차트 해석, 모든 거래를 위한 계획, 정직한 통계, 통제된 리스크, 그리고 휴대폰으로 오는 알림입니다.
조회수:
60
평가:
(1)
게시됨:
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Two moving averages on Gold (XAUUSD), forex or any symbol: when the fast one crosses the slow one on a closed bar, the EA opens one position in the direction of the cross. Default is EMA 20 and EMA 50 on the close price, and method and price can be changed.

The trade has a stop loss and a take profit in points from the entry, and the opposite cross closes it if it is still open. An optional breakeven moves the stop to the entry plus a small offset once the trade is far enough in profit. The lot is fixed, or calculated so the stop costs a chosen percent of balance or equity.

A crossover system gives many small losses in a range and a few longer runs in a trend. That is how it works, not a defect. Test it on your broker with real ticks before any live money.

Moving Average Crossover EA Gold opening one position per EMA 20 and 50 cross on a XAUUSD chart in MetaTrader 5

Settings

Strategy

  • Fast moving average period (20) and Slow moving average period (50). The fast period must be smaller.
  • Moving average method (EMA) and Applied price (close).
  • Reverse signals (false): sells on the bullish cross and buys on the bearish one.
  • Close the position on the opposite cross (true).

Lot settings

  • Lot mode: fixed lot, risk percent of balance or risk percent of equity.
  • Fixed lot (0.01) and Risk percent per trade (1.0). The risk modes need the stop loss on, or the EA will not start.

Close / Exit

  • Take profit (600 points, 0 = none).
  • Use a stop loss (true) and Stop loss (300 points).

Risk protection

  • Maximum positions of this EA at the same time (1).
  • Move the stop to breakeven (false), Breakeven starts at this profit (300 points) and Breakeven offset (20 points).

Filters

  • Use the time filter (false), Start hour (8) and End hour (20), in server time. A window that crosses midnight works too.

Expert settings

  • Magic number, Order comment, Max slippage (30 points) and Show status on chart (true).

What it needs

  • MetaTrader 5 with Algo Trading enabled. It works on hedging and netting accounts and only touches its own positions, by symbol and magic number.
  • The cross is read on the bar that just closed, once per new bar, so a signal never appears and disappears inside a candle.
  • Distances are in points. On a gold quote with 2 decimals 300 points are 3.00 in price, with 3 decimals they are 0.30. Adjust them to your symbol.
  • Before every order it checks that the free margin covers it. If not, the order is skipped and the log says why once per bar.
  • The breakeven respects the stops level of your broker.

Make it yours

Run your own backtest on XAUUSD, EURUSD, GBPUSD, US30 and NAS100 on M15, H1 and H4, and compare EMA 20/50 against 9/21 or 50/200. Turn on the time filter for the London and New York hours on gold, or add a news filter. The signal function is a few lines and can be replaced with any rule you want, for example a Smart Money Concepts break of structure or a support and resistance level, and the lot, margin check, breakeven and position count functions can be copied into another EA as they are. To manage the stop of any position, see my Trailing Stop Breakeven Manager.

About this code

Open source. Use it as it is, adapt it, build your own version on top of it.

New versions and new tools are announced first on my MQL5 channel: https://www.mql5.com/en/channels/xander

Questions, suggestions and your own backtests are welcome in the Xander Lab group: https://www.mql5.com/en/messages/02eec85e4364dd01

More tools on my profile: https://www.mql5.com/en/users/09151993a

Provided as is, use at your own risk.

Related

Changelog

  • v1.0 - 2026-10-25 - Initial release
Auto Fibonacci Retracement Swing Levels Auto Fibonacci Retracement Swing Levels

Auto Fibonacci retracement for Gold (XAUUSD), forex and any symbol: draws the levels on the last completed swing leg by itself, with the 61.8 in its own colour, prices on each level and an optional alert. Open source code.

Forex Session Boxes London New York Asia Forex Session Boxes London New York Asia

Forex session boxes for Gold (XAUUSD), forex and any symbol: draws the Asian, London and New York sessions with their high and low extended to the right and the range in points, in your broker server time. Open source code.

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.