In this post, we’ll go through a Bullish and Bearish Engulfing Candlestick Pattern Amibroker AFL Code. The AFL code can be downloaded free of cost and imported into Amibroker.
Bullish and bearish engulfing candlestick patterns are popular technical analysis tools used by traders to identify potential trend reversals in the market. A bullish engulfing pattern occurs when a small red candlestick is followed by a larger green candlestick, with the green candlestick’s open price lower than the previous red candlestick’s close price and the green candlestick’s close price higher than the previous red candlestick’s open price. This pattern suggests that buyers have gained control of the market, and a bullish trend reversal may be imminent.
On the other hand, a bearish engulfing pattern occurs when a small green candlestick is followed by a larger red candlestick, with the red candlestick’s open price higher than the previous green candlestick’s close price and the red candlestick’s close price lower than the previous green candlestick’s open price. This pattern suggests that sellers have gained control of the market, and a bearish trend reversal may be imminent. By identifying these patterns, traders can make more informed decisions about their trades and potentially profit from market movements.
Also Read: Most Powerful Candlestick Patterns You Must Know
Bullish and Bearish Engulfing Candlestick Pattern Amibroker AFL Download
Please download the AFL code from this link. It can be readily imported into Amibroker.
Bullish and Bearish Engulfing Candlestick Pattern Amibroker AFL Screenshot
Check out the screenshot of this AFL below
AFL Explanation
This code calculates the body size of the current candle and the previous candle using the abs()
function. The Ref()
function is used to refer to the previous candle’s open and close prices.
For a bullish engulfing pattern, the current candle’s close price should be higher than the open price, the current open price should be lower than the previous open price, the current close price should be higher than the previous close price, and the current body size should be larger than the previous body size. Similarly, for a bearish engulfing pattern, the current open price should be higher than the close price, the current close price should be lower than the previous close price, the current open price should be higher than the previous open price, and the current body size should be larger than the previous body size.
If a bullish engulfing pattern is detected, the code plots a green hollow up arrow using PlotShapes()
, and generates an alert using AlertIf()
. Similarly, if a bearish engulfing pattern is detected, the code plots a red hollow down arrow and generates an alert.
Overall, this code is a useful tool for identifying bullish and bearish engulfing patterns in Amibroker. By plotting signals and generating alerts, traders can quickly spot potential trend reversals and adjust their trading strategies accordingly.
Also Read: How to plot a candlestick chart in an Excel Sheet?
Disclaimer
All the AFLs posted in this section are for learning purposes. Trading Tuitions does not necessarily own these and we don’t have any intellectual property rights on them. We might copy useful AFLs from public forums and post them in this section in a presentable format. The intent is not to copy anybody’s work but to share knowledge. If you find any misleading or non-reproducible content then please inform us at support@tradingtuitions.com
AFL Link is not working
Now its working sir, Thank you
For me Still NOT working. please help
Hi Puru,
May I know what is not working?