AI Algorithms: A Walkthrough of the Strategy

blur, chart, computer-1853262.jpg

Hi everyone,

 

In the last few blogs, I started talking about my trading algorithm, and after hearing lots of feedback, I wanted to clarify the exact strategy. This article will walk you through an example trade that the algorithm made.

A quick overview of the strategy

The algorithm’s strategy is not dependent on the direction of the market. In other words, this means that whether the market goes down or up, the trades will be profitable, hence creating a continuous passive income.

 

This is achieved through buying and selling positions in the forex market, and as you guessed, this will mean that at any given time, either the “buys” or the “sells” are profiting. Meanwhile, the other side would be accumulating a negative balance until they are closed with a reversal (as shown in Figure 1).

Figure 1: Schematic of the strategy
Figure 2: Live trades with the strategy

In the schematic above, the top three trades will profit, and the last two will close at a loss. The algorithm is set so that the target price to close all positions is where the profit exceeds the loss.

This can be seen in Figure 2, where an overall profit of £3.39 for the “Sells” was generated.

A live trading example

Figure 3: Screenshot of EURUSD between 21st Dec 11:00- 22nd Dec 14:15

So let me walk you through this live trade. The green bars indicate a price increase, and the red bars indicate a price decrease.

 

If you look at the bottom left of figure 3, the market has been pushing upwards from 1.21330. Since then, “sell” positions have been accumulating with the upward movement. The target price (bottom blue dotted line) for the “sell” positions has been lagging behind the current price. This means that no matter how much the price has moved from the first opened position (1.21330), the market will only need to reverse back to the bottom blue dotted line for an overall profit to be made.

What about the “buys”?

Figure 4: Buy positions of EURUSD between 21st Dec 11:00- 22nd Dec 14:15

Alongside the accumulation of the “sell” positions, the algorithm also places “buy” trades. During the same time frame between Dec 21 and Dec 22, several buy positions were opened and closed, as can be seen in figure 4.

 

The losses seen in figure 4 are part of the same strategy applied to the buy positions, which is the reverse of what can be seen in figure 1. You can identify these by the timestamps and the closing prices, which are all the same.

The results after a few hours

Figure 5: Screenshot of EURUSD between 21st Dec 11:00- 22nd Dec 16:00

The current price hit the take profit (previous bottom blue dotted line), closing all the “sell” positions at a profit (See Figure 6).

 

This now resets the algorithm to place new “sell” positions, while the buys are starting to accumulate in Figure 5.

 

However, hypothetically, if the market did continue to rise, more “sell” positions would be placed, moving the target price for the accumulated sells even higher and closer to the current price. This would occur while the “buy” positions continue closing at a profit.

Figure 6: The closed positions of the accumulating sells

The algorithms automatically closed all trades simultaneously at the price of 1.21991 (EURUSD). As you can see, the top four trades profited, whereas the bottom three closed at a loss, resulting in an overall profit of $9.95.

Conclusion

The message I want to convey is that the algorithm works like ping pong, where regardless of which side the ball hits, profit is made.

 

The benefit of automatic trading is that unlike a manual trader, who would simply hold one position for the duration of the movement, the algorithm can utilize the constant fluctuations to profit at every peak, instead of holding continuously. Not only does automatic trading reduce the need for time-consuming technical analysis, but it also allows us to access the entire 24/5 forex mark

The Challenge

A known risk and challenge is what happens if the market continues to spike. This requires a trading plan and proper risk management, which I have discussed in more detail in my previous post.

Scroll to Top