Gunbot Autoconfig

Gunbot Autoconfig Automatic Trading Pair Selection

selecting trading pairs

Gunbot Autoconfig Automatic Trading Pair Selection

This is a repost of an article originally published on Medium


Experienced bot traders know that selecting “good” trading pairs can make or break an account. But, selecting trading pairs that fit a specific trading strategy is typically a task that takes quite a bit of manual work. Not great when you got into trading automation to get work off your hands.

Selecting trading pairs that match your trading strategy can make or break the results.

Frequently selecting new tradings pairs works, because pairs must match the intended strategy. Trading strategies tuned for bullish markets will usually perform awful when the market goes down, the same is true for strategies tuned for other market conditions.

I took the challenge and tried to build actual great tools for automatic pair selection in Gunbot. It’s part of a module called AutoConfig, which can automate a lot of operator tasks within Gunbot and solve the problem of selecting a specific coin pair to trade.

In this post, I’ll describe some of the ways you can work with AutoConfig to automatically select trading pairs.

What’s hard about pair selection for a trading bot?

When trying to automatically scan for new trading pairs, several hundred markets on an exchange must be scanned often, and fast.

The amount of data involved is huge when doing this with candlestick data, tickers are more suited but come with the problem that exchanges do not provide historical ticker data and tickers contain only very limited data like 24h change, current prices, and 24h volume.

Due to this limitation, other bots often provide only rudimentary pair filters directly based on the data available in tickers, like “select trading pairs with a daily volume above 300 BTC”. This is a very limited approach. Finding pairs that fit your strategy is next to impossible with simple filters like this.

Good pair selection tools would offer fine-grained filters that can help you identify the direction of a market, if the spreads are acceptably low, if the volume is increasing, etc. Gunbot can now do all of this, and more.

Unique pair filters in Gunbot

To tackle all the problems mentioned above, Gunbot can now track ticker data over time, for all pairs on an exchange. Together with a bunch of powerful filters, this allows for very precise pair selection.

When selecting pairs, you can create your own set of filters. You can also create multiple filter sets to monitor for different very specific market conditions.

Filters can be used for adding and removing trading pairs. This way you can make sure that Gunbot only trades the most interesting pairs at any time using the “Gunbot Autoconfig Automatic Trading Pair Selection”

Basic filters options

Some filters are pretty simple but very effective, think about options like:

Exclude/blacklist specific pairs, base or quote currencies.

Price filters: for example set a min/max price range to filter out extremely low valued pairs.range, for example, to filter out low satoshi valued pairs.

Volume filters: you can filter for absolute volume ranges, but also above/below median volume or a pairs volume ranking. Volume rank can, for example, be used to only select the current top10 USDT volume pairs.

Bid/ask spread: measures the percentage difference between the bid and ask, allowing you to filter out pairs with extreme spreads.

Advanced filters options

This is where it gets interesting. The advanced filters let you monitor the pair’s direction and movement over time.

Slope: the linear regression slope of a pair, expressed as a percentage of the most recent price. This tells you the predicted percentage difference between the current price and the next future price, as defined by how a Linear Regression Slope is calculated. You can use a min/max range to filter for specific slopes, for example excluding slopes too steep can be a good idea to prevent ending up with pairs that have just peaked already.

Gunbot Autoconfig Automatic Trading Pair Selection 5

Visualization of linear regression slopes: green zones are positive slopes, red zones are downwards slopes.

Price change: compare the current price with the average price for an interval. With this filter, you can easily detect if a pair is currently trading at rates above or below their average over a selected time frame.

Standard deviation: measures the amount of variation in prices within a time frame. Expressed as a percentage from the most recent price. Using standard deviation filters you can detect pairs that show “fluctuation” from their mean price. This is very useful and an essential part of Autoconfig Automatic Trading Pair Selection, to separate almost static markets from potentially interesting markets to trade on.

Gunbot Autoconfig Automatic Trading Pair Selection 6

Pair with very low standard deviation value.

Gunbot Autoconfig Automatic Trading Pair Selection 7

Pair with a moderate standard deviation value.

Standard deviation channel filters: plots a channel of the median price plus and minus the standard deviation. Triggers when price breaks down the lower band of an upwards channel, or when price breaks upwards of a downwards channel.

Gunbot Autoconfig Automatic Trading Pair Selection 8

Example of using the bullishStandardDeviationChannel filter. The market area would be where price crosses down the lower band of an upwards channel.

Trailing filters: pick prices, volume and/or slope and trail them. With a price trailing filter, you can trail down all pairs on an exchange and only add a pair when it hits a trailing buy stop close to the bottom of a downward move. The logic is pretty much identical to buy trailing in Gunbot trading strategies. When trailing volume, a pair could be added to Gunbot when it undergoes a sudden volume increase. Together with a slope filter, you can assure that the volume increase is not due to a sudden dump. With Gunbot Autoconfig Automatic Trading Pair Selection you don’t have to worry anymore.

Time frames matter for Trading Pair Selection

You can configure which time frame should be analyzed for processing filters, and in which interval data collection takes place.

For example, you can setup filtering that looks at the data of the last 12h, collected in 5-minute intervals.

Any of the filters can then use either the full 12h of data or the last x data points. This is useful because you could use multiple of the same filter types to cover different time frames. For example, you could filter for pairs that have an overall relatively flat slope but have a strongly increasing slope in the last 30 minutes.

Create cross pair filters with user variables Automatic with Autoconfig

Besides filtering market data, filter jobs can also set and filter on “user variables”. This is extremely powerful and allows different filters to interact.

A simple example of using user variables:

Filter 1 monitors the USDT-BTC price movement. Sets variable “dump”: true whenever it’s the current price is 0.5% lower than the hourly average.

Filter set 2 monitors altcoins and the user variable “dump”. Only adds trading pairs when BTC is not dumping and the conditions of filters for altcoin markets are met.

Gunbot Autoconfig Automatic Trading Pair Selection examples

AutoConfig is still pretty new and lacks a GUI for now. The config system is JSON based, the wiki has plenty of examples of how to set filters.

On the new Gunthy Marketplace (only for registered Gunbot users) you can find a bunch of ready-made filter sets using AutoConfig. I try to post something new there now and then.

Leave a Reply