ATFX Tutorial: How to Build an EA Trading Strategy Using a Single Moving Average, KDJ and ATR

Deep News10-27

On 27 October, ATFX published a tutorial explaining moving-average trading strategies, which include both multiple moving-average approaches and single moving-average approaches.

A greater number of moving averages provides richer ways to identify and confirm trends, and reduces reliance on other technical indicators such as MACD, RSI and KDJ. ATFX advocates diversifying the types of technical indicators and avoiding giving any single category of indicator too much weight in a strategy, so it prefers to use a single moving average.

There are currently two mainstream moving-average algorithms. One is the simple moving average (MA), the most traditional type. The MA assigns the same weight to every closing price within its parameter window, and can objectively show changes in the average closing price. The other is the exponential moving average (EMA), which is used more widely in short-term trading. The EMA uses the formula 2/(N+1) to assign a preset weight to each candlestick, where N is the position of the candlestick. For the first candlestick, N equals 1; for the second, N equals 2; for the third, N equals 3, and so on.

It can be seen that the closer a value is to the latest candlestick, the higher its weight; the further a historical value is from the latest candlestick, the lower its weight. This means the EMA is a more sensitive indicator than the MA and stays closer to the latest trend changes. Therefore, the EA strategy analyzed today uses the EMA.

EA Trading Strategy Based on a Single Moving Average + KDJ + ATR

Buy conditions for the strategy: 1. The closing price of the latest candlestick is above EMA (20). 2. The K line crosses above the D line, and the crossover point is in the oversold zone (K/D/J values below 30).

Stop-loss conditions for the strategy (closing the position when any one is met): 1. The initial stop-loss is the market price minus one times the ATR. 2. When profit reaches one times the ATR, a trailing stop is activated, with the first trailing stop placed at the opening price. 3. The closing price of a candlestick is below EMA (20).

Take-profit conditions for the strategy (taking profit when any one is met): 1. The take-profit price is the market price plus two times the ATR (if the initial stop-loss is two times the ATR, then the take-profit range becomes three times the ATR). 2. A moving trailing stop acts as take-profit. 3. The KDJ indicator forms a death cross in the overbought zone.

Notes: 1. Half of the position can be closed for take-profit first, while the other half waits for other closing signals (provided the trend is good). 2. Do not trade during the Asian session; trade after 15:00 Beijing time. 3. Do not trade within half an hour before or half an hour after major data releases such as nonfarm payrolls, CPI and interest-rate decisions. 4. Do not trade more than three times in a single day. 5. Manual trading is prohibited; the strategy is only supported when converted into an EA program for automated trading.

ATFX risk warning, disclaimer and special statement: Markets carry risk, and investment requires caution. The above content represents only the personal views of the analyst and does not constitute any operational advice. Please do not treat this report as your sole reference. An analyst's views may change at different times, and updated content will not be announced separately.

Disclaimer: Investing carries risk. This is not financial advice. The above content should not be regarded as an offer, recommendation, or solicitation on acquiring or disposing of any financial products, any associated discussions, comments, or posts by author or other users should not be considered as such either. It is solely for general information purpose only, which does not consider your own investment objectives, financial situations or needs. TTM assumes no responsibility or warranty for the accuracy and completeness of the information, investors should do their own research and may seek professional advice before investing.

Comments

We need your insight to fill this gap
Leave a comment