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.
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
- Description
- Values
- Order types
- Name
Set this to false to prevent Gunbot from opening long positions.
Values: true or false
Default value: true
Affects | Does not affect |
---|---|
Strategy buy | Strategy sell |
DCA buy | Stop limit |
RT buy | Close |
RT buyback | RT sell |
Parameter name in config.js
: BUY_ENABLED
Long Level
- Description
- Values
- Order types
- Name
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.
Values: numerical – represent a percentage.
Default value: 1
Affects | Does not affect |
---|---|
Strategy buy | RT buy |
RT buyback | |
RT sell | |
Close | |
Stop limit | |
Strategy sell | |
DCA buy |
Parameter name in config.js
: LONG_LEVEL
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
- Description
- Values
- Order types
- Name
Set this to false to prevent Gunbot from opening short positions.
Values: true or false
Default value: true
Affects | Does not affect |
---|---|
Strategy buy | Strategy sell |
DCA buy | Stop limit |
RT buy | Close |
RT buyback | RT sell |
Parameter name in config.js
: SELL_ENABLED
Short Level
- Description
- Values
- Order types
- Name
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.
Values: numerical – represent a percentage.
Default value: 1
Affects | Does not affect |
---|---|
Strategy sell | RT buy |
RT buyback | |
RT sell | |
Close | |
Stop limit | |
Strategy buy | |
DCA buy |
Parameter name in config.js
: SHORT_LEVEL
Indicator settings
Relevant indicators for trading with BB
These settings have a direct effect on trading with bb
.
Period
- Description
- Values
- Order types
- Name
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.
Values: numerical– represents candlestick size in minutes.
Default value: 15
Affects | Does not affect |
---|---|
Strategy sell | RT buy |
Strategy buy | RT buyback |
DCA buy (when using an indicator to trigger) | RT sell |
Close | |
Stop limit |
Parameter name in config.js
: PERIOD
Low BB
- Description
- Values
- Order types
- Name
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.
Values: numerical – represents a percentage.
Default value: 0
Affects | Does not affect |
---|---|
Strategy buy | RT buy |
RT buyback | |
RT sell | |
Close | |
Stop limit | |
Strategy sell | |
DCA buy |
Parameter name in config.js
: LOW_BB
High BB
- Description
- Values
- Order types
- Name
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.
Values: numerical – represents a percentage.
Default value: 0
Affects | Does not affect |
---|---|
Strategy sell | RT buy |
DCA buy (when using HIGHBB option for DCA) | RT buyback |
RT sell | |
Close | |
Stop limit | |
Strategy buy |
Parameter name in config.js
: HIGH_BB
SMA Period
- Description
- Values
- Order types
- Name
This defines the number of periods used for calculating Bollinger Bands.
Values: numerical – represents a number of candlesticks.
Default value: 50
Affects | Does not affect |
---|---|
Strategy sell | RT buy |
Strategy buy | RT buyback |
DCA buy (when using HIGHBB option for DCA) | RT sell |
Close | |
Stop limit |
Parameter name in config.js
: SMAPERIOD
Standard Deviation
- Description
- Values
- Order types
- Name
This value defines the multiplier used for calculating Bollinger Bands.
Values: numerical (recommended: between 1.9 and 2.1) - represents a multiplier value used in the bollinger bands calculation.
Default value: 2
Affects | Does not affect |
---|---|
Strategy sell | RT buy |
Strategy buy | RT buyback |
DCA buy (when using HIGHBB option for DCA) | RT sell |
Close | |
Stop limit |
Parameter name in config.js
: STDV