A Little of History

This article explain in details the strategy that took second place in Dukascopy´s Strategy Contest in December 2018. Before talking about the strategy itself, I would like to clarify that I am a beginner in the world of Forex and the financial market in general. I started my journey more or less in May of the year 2017, with binary options, and I had good and bad experiences in the modality, like every person who starts in the financial market. After a few months trading binary options, I began to study and operate the Forex market gradually, always using graphical analysis. After a few more months trading forex, with daily studies of the pairs and placing pending orders to roll in the middle of the night, I decided to risk automated trading, after watching a video on the internet where the speaker said that it was possible do have much more success in trading using softwares that did the operations automatically. I remember seeing this video in December 2017, and in January 2018 I started researching how to develop a robot that could run the strategies I already knew to operate the Forex market.

At that time, I was lucky to already be operating on the Dukascopy platform which provide a block programming solution, since I have some programming knowledge that I learned in college (I am an electrical engineer), but nothing in depth, and Visual JForex is simply a formidable solution for anyone who wants to program their strategies without having a thorough knowledge in any programming language. Being a bit rusty and also not so familiar with the platform, it took me a while to get my first program successfully. I used the platform User's Guide as well as articles and videos on the internet, to continue my journey. After some time of study and numerous attempts to make a program that carried out a classic strategy of three exponential moving averages, I was able to succeed in the execution of the program. I remember until today the joy that was to see my first backtest, when in the simulation a capital of 300 dollars reached 2700 in a month, and it broke to zero the following month. Then, began a battle to create a risk management of that strategy, so that it would not break the account so easily. There were countless attempts and ideas to try to stabilize the strategy, but without much success. The next step was to test new strategies with other indicators: Bollinger Bands, Ichimoku Clouds, RSI, TVS, Keltner Bands, Donchian Channel, until finally finding the winning strategy that gave rise to this article.

I really like to study and research about financial market and new ideas of trading, always reading and researching new strategies, indicators, testing and adapting everything I see in my searches. In one of my surveys, I tried to adapt a simple idea of candle crossing moving average, and then came the good results of ​​the winning strategy, a very simple but very powerful strategy that became a strategy with high potential to win the strategy contest.


The Strategy in Details

The strategy is extremely simple and uses only two indicators to open positions. The first, and most important, is the 9-period exponential moving average (EMA) that defines when the entry trigger will be given and in which direction the position will be opened. The second is the ADX, later placed as a fine-tuning, allowing the trigger to be triggered only when the ADX indicates that the market is in trend. The EMA trigger works very simply. If the candle (period 1 hour) opens above the EMA and closes below the EMA, a pending short order will be placed at the minimum of the candle, opening the position if the market movement continues downward. The same happens if the candle opens below the EMA and closes above it. A long pending order will be placed at the maximum of the candle, opening the position if the market continues to rise. ADX works as a filter, not allowing orders to be placed if its value is below 16. Let's look at some pictures to understand better:


Picture 1. Short position placed after candle opens above EMA 9 and closes below.

In the picture we can see that there was no time for the pending position to be placed, because the candle made a marubozu, following a down movement and earning 5 pips of profit. On the same day, three hours later, we checked the candle at 14:00, overtaking the EMA from the bottom up, opening a pending position at the maximum of the candle:


Picture 2. Pending order placed on the maximum of the candle, after the candle opens below the EMA and closes above it.

In this case, we can follow the opening of the pending position, as the candle has created a wick after its closure. The next hour, the position is open as the market continues to rise, and get another 5 pips of profit in the long position:


Picture 3. Pending position becomes open position and gains 5 pips of profit.


During the two operations, we can verify that the ADX indicator was above 16 points, allowing positions to be opened:


Picture 4. In both operations, the ADX indicator was above 16 points.

An improvement in the strategy, which did not exist in its original version, was the use of a trailing stop, with a step of only 1 pip, after 5 pips of profit. This allows to pick up sudden market movements, not limiting the order to just 5 pips of profit, when the market goes up or down quickly:


Picture 5. Operation of 11 pips of profit, achieved through the use of trailing stop.

Another implementation made in the strategy was to make it more dynamic. Sometimes, pending positions took days to execute, not allowing other positions to be opened, since the strategy accepts only one order at a time. A logic was then implemented in order to cancel pending orders at the end of the day, closing the pending positions that did not open during that day.

The choice of the 60 pips stop loss, and the 5 pips trailing step trigger, were conclusions designed and analyzed through a number of backtests and EUR / USD pair analyzes, noticing that was a successful combination for that pair. Through several backtests and also with the use of the optimization tool of JForex the value of 10 lots for trading amount also shown a excellent performance.

Conclusion

The strategy's profit expectation is very good, especially when used in the monthly contest, when it starts the month with an amount of money, and the result is measured at the end of the month. It has been found that the profit positions rate is extremely high, with only 1 or 2 losses per month. There is still an expectation of this strategy to take first place in the contest, when in some month it has no stop loss. Although very good, strategy in these configuration is not a winner in the long run and must be adapted in some way so that it can be used continuously in a real account.
Translate to Inglese Show original