BollingerBandsWithEngulfing

Bollinger Bands with Engulfing is a strategy developed by Pawel Kosinski. It includes:

  • finding an occurrence of the bullish Engulfing candlestick pattern within Bollinger Bands
  • controlling the risk-reward ratio
  • setting up a stop-loss for automatic exits

A buy to open simulated order is added when both of the following events happen at the same time:

  • An Engulfing pattern closes above the lower of the Bollinger Bands.
  • The risk-reward ratio is above the minimum value (1.0 by default). Calculated as the ratio of the distance between the high price and the upper Bollinger band to the distance between the high price and the stop price.

A sell to close simulated order is added when either of the following conditions is true:

  • High price pierces the upper Bollinger band.
  • Low price falls below the stop price.

Stop price is equal to the current close less ATR multiplied by the specified factor.

Input Parameters

Parameter Description
length The length for which Bollinger Bands are to be calculated.
num dev Half-distance between the upper and the lower band. Measured in standard deviations of the close price.
atr factor The factor by which ATR is to be multiplied when calculating the stop price.
reward risk ratio The minimum value of the risk-reward ratio for the simulated buy signal to be added.

Plots

Plot Description
UpperBand The upper Bollinger band.
LowerBand The lower Bollinger band.
BullishEngulfing Bullish Engulfing pattern.
StopLoss The stop-loss plot.

Further Reading

1. "Combining Bollinger Bands With Candlesticks" by Pawel Kosinski. Technical Analysis of Stocks & Commodities, October 2019.