Gold Automated Trading Bot

XAUUSD RSI Trading Bot — MetaTrader 5
MetaTrader 5 · Expert Advisor XAUUSD
RSI Trading Bot

Expert Advisor for systematic execution and controlled exposure on Gold (XAUUSD)

RSI
Core Strategy
1
Trade at a time
MT5
Platform
XAU
Gold / USD
01 — Overview

What this product is

This product is a MetaTrader 5 Expert Advisor (EA) designed to automate trade entries and basic position management on XAUUSD (Gold). The EA executes a rule-based technical approach with the goal of reducing manual intervention and supporting consistent execution under user-defined conditions.


The system is intentionally simple and transparent: it relies on clear RSI signals, basic exposure control (one active trade per symbol and Magic Number), and a set of adjustable parameters to fit broker conditions — spread, minimum volume, volatility, and more.

02 — Logic

How the EA operates

A

Symbol & Price Validation

The EA connects to the user-defined symbol (XAUUSD, XAUUSDm, GOLD, or broker-specific name). On each tick, it checks that valid bid/ask prices are available and that the symbol can be traded.

B

New-Bar Evaluation

To avoid unstable decisions during candle formation, the EA primarily evaluates conditions on a new bar — using the most recently closed candle to calculate RSI and decide whether entry conditions are met.

C

Spread Filter

Before attempting a new entry, the EA calculates spread in points. If the current spread is above the configured maximum, the EA blocks new entries — especially relevant for XAUUSD's variable liquidity.

D

One Trade at a Time

The EA checks whether there is already an open position for the same symbol and Magic Number. If a position exists, no new one is opened — preventing stacking and simplifying performance evaluation.

E

Signal & Execution

If no position is open and entry rules are satisfied, the EA places a buy or sell order using a fixed lot size defined by the user and attaches Stop Loss and Take Profit automatically.

03 — Strategy

RSI — Relative Strength Index

The strategy is based on the RSI indicator, commonly used to measure momentum and identify potential overbought/oversold conditions. Thresholds are fully configurable to control trade frequency.

BUY
RSI ≤ BuyBelowRSI

Low RSI suggests strong downward movement and potential exhaustion of selling pressure — triggering a buy entry.

SELL
RSI ≥ SellAboveRSI

High RSI suggests strong upward movement and potential exhaustion of buying pressure — triggering a sell entry.

04 — Position Management

Stop Loss, Take Profit & Optional Close

SL

Auto Stop Loss

Each trade is opened with a Stop Loss defined in points, setting a maximum loss level per trade based on lot size and SL distance.

TP

Auto Take Profit

Each trade is opened with a Take Profit defined in points. The TP sets the target exit level at a distance configured by the user.

OPT

Close on Opposite Signal

An optional setting (CloseOnOpposite) allows the EA to close an open position when an opposite RSI condition appears — usable as an additional exit rule or disabled to rely solely on SL/TP.

05 — Risk

Risk Management

The EA uses fixed lot sizing. Practical risk control depends on user configuration — effective exposure is driven by lot size, SL distance in points, and symbol specifications (tick value, contract size, spread).

Important on XAUUSD: Gold can experience wide intraday swings and variable spreads. Use small lot sizes aligned with account size. Set SL/TP according to volatility and the selected timeframe. Avoid excessively tight SL values affected by spread and market noise. Leverage does not change profit/loss per price movement — it changes margin requirements.

06 — Parameters

Key Inputs

Symbol Exact broker symbol name to trade (e.g. XAUUSD, XAUUSDm, GOLD)
Timeframe Chart timeframe or a fixed timeframe for evaluation
RSI Period RSI calculation period
BuyBelowRSI Oversold threshold — EA enters BUY when RSI ≤ this value
SellAboveRSI Overbought threshold — EA enters SELL when RSI ≥ this value
Lots Fixed lot size for all entries
SL Points Stop Loss distance in points from entry price
TP Points Take Profit distance in points from entry price
MaxSpreadPoints Maximum allowed spread before entry is blocked
CloseOnOpposite Enable / disable closing on opposite RSI signal
Magic Number Unique identifier to distinguish EA positions
MaxSlippagePoints Slippage tolerance in points (if included in version)
07 — Installation

Getting Started on MT5

1
Copy the file
Place the compiled EA file (.ex5) into the MQL5/Experts folder.
2
Refresh Navigator
Restart MT5 or right-click the Navigator panel and select Refresh.
3
Open the chart
Open the XAUUSD chart (or broker equivalent) and select a timeframe.
4
Attach the EA
Drag the EA from the Navigator onto the chart window.
5
Enable Algo Trading
Click the Algo Trading button in the MT5 toolbar and enable "Allow Algo Trading" in the EA settings.
6
Configure parameters
Set symbol name, lots, SL/TP, RSI thresholds, spread limit, and Magic Number.
7
Monitor the Journal
Check Experts/Journal tab for activity logs, execution confirmations, and any blocked entry reasons.
08 — Compatibility

Platform & Requirements

This EA is designed for MetaTrader 5 only. Broker symbol naming may require adjustment. Suitable for users who want simple automation, one-trade-at-a-time exposure control, and transparent RSI-based rules.

MetaTrader 5 XAUUSD / Gold Fixed Lot Sizing RSI Strategy Single Position
XAUUSD RSI EA

This EA automates a defined technical strategy. Performance depends on broker conditions, spreads, execution quality, volatility regimes, trading hours, and user-selected parameters. Recommended workflow: backtest → demo validation → gradual live deployment.

필터:
리뷰 없음
리뷰 답변