Skip to main content

BBTA

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.

To use Bollinger Bands TA as method in Gunbot, you can configure at which percentage from the lower band to buy and at which percentage from the upper band to sell. Orders are placed after the price moves outside the set level and then moves back in. Keep in mind that Bollinger Bands are just one tool among many for analyzing the markets, so make sure you understand how they work before relying on them for trading decisions.

How to work with it

This page explains how futures trading operates with the bbta method. The triggers for trades differ slightly from those used in spot trading.

Gunbot opens a single position, either long or short, and closes it when the target is met. If the stop is triggered before closing the trade at a profit, Gunbot will place a stop order at a loss. After closing a position, Gunbot will seek to open a new long or short position.

Buy method conditions

A long position is opened when the ask price crosses over LOW_BB. 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 opened when the bid price crosses below HIGH_BB. 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 bbta as buy method.

Buy enabled

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


Short settings

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

Sell enabled

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


Indicator settings

Relevant indicators for trading with BBTA

These settings have a direct effect on trading with bbta.

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.