Trading assets with a strong trend component are of enormous interest to a trader. Such assets produce prolonged trends and are also automatically adjusted for inflation.
I have been working with XAUUSD for quite a long time and have achieved some success with this symbol. In this post I want to share one of the highly effective patterns for buying gold and oil. The system is based on price action and the universal moving average crossover indicator "Moving Average Cross Signal".
The Expert Advisor can be downloaded completely free of charge.
Your feedback and opinions on this trading system are very important. Write to me in private messages or in the comments.
For the EA to work, you need to download the free indicator "Moving Average Cross Signal" (https://www.mql5.com/en/market/product/148478) from the MQL5 Market and leave it where it is. The indicator file must stay in the "Indicators/Market" folder.
The EA is set up to work on Gold (XAUUSD) on the H1 (1 hour) timeframe. However, you can use it on any symbols and timeframes by selecting the parameters yourself.
Now that we have everything we need, let's move on to the description of the entry pattern and the trading system as a whole.
Pattern: Piercing the Moving Average
The indicator must be showing an uptrend.
The bar's open and close must be above the slow moving average (or, to be more precise, the indicator's second line).
The bar's low must be below that moving average.
Entry confirmation — a breakout of the bar's high.
Let's look at the pattern using an oil chart as an example. It works great there too!
The Trading System
Once the pattern appears, we place a pending BUY STOP order at the high of the bar that formed the signal. To exit the position we will use STOP LOSS, TAKE PROFIT and TRAILING STOP. Pending orders are kept for just 1 bar (1 hour in our case). While a position is open, no new positions are opened.
The Stop Loss is placed at the low of the pattern. The Take Profit is a multiple of the Stop Loss. The Trailing Stop is set as a percentage of price.
BUY_TPxSL = 5;
BUY_TrailingStop = -2.0;
XAUUSD, H1. Performance of this system over the 2020-2025 period using a fixed lot.
The EA is published free of charge and without restrictions — test it on your own symbols and conditions. Please share your results, remarks and ideas for improving the system in the comments to the indicator or in private messages.
Attachments forums
Pattern: Piercing the Moving Average | Download EA
FastInvest, Fri Aug 07, 2026 3:37 pm