Skip to main content

BB

Bollinger Bands are a technical analysis tool that measures relative high and low prices. They consist of three lines: a simple moving average, an upper band, and a lower band. The upper and lower bands are plotted two standard deviations away from the simple moving average.

Traders commonly use Bollinger Bands to identify overbought and oversold conditions in the market. When prices move close to the upper band, it indicates that the market is overbought, and when prices move near the lower band, it suggests that the market is oversold. As a result, traders can use this information to make buy and sell decisions.

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

Buy method conditions

A buy order is allowed when price is below the lower band, and additionally price is at least buy level % below the lowest of EMA1 and EMA2.

Additionally you can use the Low BB setting to change the threshold from the actual lower band, to anywhere between the bands.

Sell method conditions

A sell order is allowed when price is above the upper band. Additionally, the gain % target must be reached.

Additionally you can use the High BB setting to change the threshold from the actual upper band, to anywhere between the bands.

Trading example

Example of how trading with this strategy can perform. Details and settings.

The infographic below describes what triggers trades with this strategy.

Note that this description is kept simple intentionally. In reality prices also need to be below BUY_LEVEL before a buy is triggered.

Strategy settings for BB

Buy settings

LabelConfig ParameterDefault ValueDetailed Description
Buy enabledBUY_ENABLEDtrueEnables the ability to place buy or long orders. When enabled, you can initiate buy transactions based on your strategy conditions.
Buy levelBUY_LEVEL1Sets the buy level as a percentage below the lowest EMA where buy orders are permitted. You can adjust this value between 0.1% to 5%, allowing flexibility in response to market conditions.
Low BBLOW_BB0.1Defines the target percentage for the lower Bollinger Band, which ranges from the bottom (0%) to the top (100%) of the band. This setting helps in determining optimal buy positions based on volatility and prevailing market trends.

Sell settings

LabelConfig ParameterDefault ValueDetailed Description
Sell enabledSELL_ENABLEDtrueEnables the ability to place sell or short orders. This setting allows you to execute sell transactions when certain predefined conditions of your strategy are met.
High BBHIGH_BB0.1Sets the target percentage for the upper Bollinger Band, indicating sell positions from the top (0%) to the bottom (100%) of the band. Adjust this to fine-tune your selling strategy based on market movements.
GainGAIN1Specifies the gain target above break-even as a percentage, guiding when to execute sell orders to achieve profits. You can configure this value from 0.1% to 5%, optimizing your profit-taking strategy.
Count sellCOUNT_SELL9999Limits the number of sell orders for a trading pair after which the pair is disabled. You can set this number from 1 to 50, providing control over your exposure and trading frequency.

Indicators

LabelConfig ParameterDefault ValueDetailed Description
PeriodPERIOD15Configures the candlestick period, in minutes, used for calculating indicators. Make sure to use a period supported by your exchange. This setting is crucial for aligning your strategy with the specific time frames of the market.
SMA periodSMAPERIOD30Determines the number of candles used to calculate Simple Moving Average (SMA), which is key for identifying Bollinger Bands, trend watching, and other indicators like support/resistance levels and Fibonacci retracements.
Standard deviationSTDV2Sets the standard deviation multiplier for Bollinger Bands calculation, influencing how the bands widen or tighten in response to market volatility. You can adjust this setting from 0.5 to 3 to suit different market conditions.
Medium EMAEMA116Specifies the number of candles used to calculate the medium Exponential Moving Average (EMA), important for smoothing data and identifying the direction of the medium-term market trend.
Fast EMAEMA28Defines the number of candles used to calculate the fast EMA, providing quicker signals for potential price movements and helping to identify short-term trends in the market dynamics.

Overview of effects on different order types

Config ParameterAffected Order TypesNot Affected Order Types
Buy EnabledStrategy buy, DCA buy, RT buy, RT buybackStrategy sell, Stop limit, Close, RT sell
Buy LevelStrategy buyStrategy sell, Stop limit, Close, RT sell, DCA buy, RT buy, RT buyback
Sell EnabledStrategy sell, Stop limit, RT sellStrategy buy, RT buy, RT buyback, Close, DCA buy
GainStrategy sellStrategy buy, RT buy, RT buyback, RT sell, Close, DCA buy, Stop limit
PeriodStrategy sell, Strategy buy, DCA buy (when using an indicator)RT buy, RT buyback, RT sell, Close, Stop limit
Low BBStrategy buyRT buy, RT buyback, RT sell, Close, Stop limit, Strategy sell, DCA buy
High BBStrategy sell, DCA buy (when using HIGHBB option)RT buy, RT buyback, RT sell, Close, Stop limit, Strategy buy
SMA PeriodStrategy sell, Strategy buy, DCA buy (when using HIGHBB option)RT buy, RT buyback, RT sell, Close, Stop limit
Standard DeviationStrategy sell, Strategy buy, DCA buy (when using HIGHBB option)RT buy, RT buyback, RT sell, Close, Stop limit
Slow EMAStrategy buyRT buy, RT buyback, RT sell, Close, Stop limit, Strategy sell, DCA buy
Medium EMAStrategy buyRT buy, RT buyback, RT sell, Close, Stop limit, Strategy sell, DCA buy