Putting a lot of what we’ve learned so far into practice, we’ll now code a strategy that buys on the popular bullish engulfing candlestick pattern.
The first step is to define the pattern. Looking closer at the image above, we see that a bullish engulfing could be defined with a few conditions.
Now we translate the above three rules into Easylanguage.
Now we have the conditions and only need to put them into an if-statement, like below, coupled with an exit of your choice:
If Close<Open and Open<Close and Close>Open then buy next bar open;
If barssinceentry=5 then sell next bar open;
In the exercise section below, you will find more candlesticks to practice on.