Skip to main content

BB

Bollinger Bands are a technical analysis indicator that help identify relative high and low prices. Using this information, you can potentially buy at lower prices and sell at higher prices.

The indicator consists of three lines: the middle line is a simple moving average, and the other two lines are plotted above and below it at a certain distance away. This distance is calculated using standard deviation, which measures how much the price has varied from its average value over a given period of time. The wider the distance between the upper and lower bands, the higher the volatility of the price.

Using Bollinger Bands in Gunbot, you can configure the percentage at which to trigger trades. Specifically, you can set the percentage from the lower Bollinger Band at which to buy, and the percentage from the upper Bollinger Band at which to sell. Once prices meet the predetermined distance from the bands, orders are automatically placed by Gunbot.

How to work with it

Gunbot will open one position, either long or short, and close this position when the target is reached. When the stop is hit before profitably closing a trade, Gunbot will place a stop order at loss. After closing a position, Gunbot will again look to open a new long or short position. Gunbot will not add to existing open positions.

Please don't manually add to or reduce positions opened by Gunbot, unless you stop running Gunbot on this trading pair until you've closed this position.

info

Using bb (futures) is only meaningful with MEAN_REVERSION enabled.

The info below assumes you have set this.

The examples below show how the basic triggers for bb work. Additionally, you can use confirming indicators and settings like ROE trailing.

Buy method conditions

A long position is allowed when the ask price is below LOW_BB and LONG_LEVEL. In the example above LOW_BB would be set to 0, which represents the actual lower Bollinger Band. With different values you could set a target above (positive value) or below (negative value) the lower band.

Sell method conditions

A short position is allowed when the bid price is above HIGH_BB and SHORT_LEVEL. In the example above HIGH_BB would be set to 0, which represents the actual upper Bollinger Band. With different values you could set a target below (positive value) or above (negative value) the upper band.

Conditions to close

Position is closed when the desired ROE (return on equity) is reached. This is a percentage from the entry point, taking leverage into consideration.

Conditions to stop

A position is closed at loss when negative ROE reaches the STOP_LIMIT target.

Long settings

Buy settings are the primary trigger for long orders. These parameters control the execution of long orders when using bb as buy method.

Buy enabled

Set this to false to prevent Gunbot from opening long positions.


Long Level

This sets the target for opening a long position at a percentage above the highest EMA.

When you set this to 1, buy orders will only be placed when the current price is at least 1% above the currently highest EMA.


Short settings

Buy settings are the primary trigger for short orders. These parameters control the execution of short orders when using bb as sell method.

Sell enabled

Set this to false to prevent Gunbot from opening short positions.


Short Level

This sets the target for opening a short position at a percentage below the lowest EMA.

When you set this to 1, sell orders will only be placed when the current price is at least 1% below the currently lowest EMA.


Indicator settings

Relevant indicators for trading with BB

These settings have a direct effect on trading with bb.

Period

This sets the candlestick period used for trading, this affects all indicators within the strategy.

Only use supported values. The trading settings editor suggests valid values for the selected exchange..

Setting a short period allows you to trade on shorter trends, but be aware that these will be noisier than longer periods.


Low BB

This sets the target for buying. Negative values are allowed.

The bot will buy after prices first move under the set % from the lower Bollinger Band, then cross over the set level.

When set to 0, the lower Bollinger Band is the target. When set to 30, the target is 30% above the lower Bollinger Band - the upper band is at 100% from the lower band. Negative values are allowed.


High BB

This sets the target for selling. Negative values are allowed.

The bot will sell after prices first move over the set % from the upper Bollinger Band, then cross down the set level. Additionally GAIN must be reached.

When set to 0, the upper Bollinger Band is the target. When set to 30, the target is 30% under the upper Bollinger Band - the lower band is at 100% from the upper band. Negative values are allowed.


SMA Period

This defines the number of periods used for calculating Bollinger Bands.


Standard Deviation

This value defines the multiplier used for calculating Bollinger Bands.