Available filters
AutoConfig jobs offer a range of filter types, including ticker filters, pair state filters, generic filters, and user variables.
Ticker filters allow for the request of exchange ticker data at the time a job runs. Different filters can be applied to add or remove pairs, but not all filters may work on every exchange due to availability of required data. For instance, on Huobi AutoConfig, last price is used instead of bid/ask for all price-related filters.
The table below shows an overview of available ticker filter types with their descriptions and additional details.
Type | Description |
---|---|
Price higher than set | Returns true if the price is higher than set. |
Price lower than set | Returns true if the price is lower than set. |
Current price x% above average | Returns true if the current price is at least x% higher than the average price of all snapshots. |
Current price x% below average | Returns true if the current price is at least x% lower than the average price of all snapshots. |
Current 24h volume x% above avg | Returns true if the current 24h volume is at least x% higher than the average 24h volume of all snapshots. |
Current 24h volume x% below avg | Returns true if the current 24h volume is at least x% lower than the average 24h volume of all snapshots. |
24h volume higher than set | Returns true if the 24h volume is higher than set (volume in base). |
24h volume lower than set | Returns true if the 24h volume is lower than set (volume in base). |
24h price percentage change higher | Returns true if the 24h price percentage change is higher than set. |
24h price percentage change lower | Returns true if the 24h price percentage change is lower than set. |
Bid-ask percentage difference high | Returns true if the percentage difference between bid and ask is higher than set. |
Bid-ask percentage difference low | Returns true if the percentage difference between bid and ask is lower than set. |
Slope for all prices bigger than set | Returns true if the slope for all prices in snapshots is bigger than set. |
Slope for all prices smaller than set | Returns true if the slope for all prices in snapshots is smaller than set (executed only when max snapshot sample size is reached). |
Standard deviation bigger than set | Returns true if the standard deviation for all prices in snapshots is bigger than set (executed only when max snapshot sample size is reached). |
Standard deviation smaller than set | Returns true if the standard deviation for all prices in snapshots is smaller than set (executed only when max snapshot sample size is reached). |
24h volume rank higher than set | Returns true if a pair's 24h volume rank (rankings are specific per base) is higher than set. |
24h volume rank lower than set | Returns true if a pair's 24h volume rank (rankings are specific per base) is lower than set. |
Price within defined range from lower band | Returns true if the price is within a defined range from the lower band and other conditions are met (detects downwards breakout from upwards channel). |
Price within defined range from upper band | Returns true if the price is within a defined range from the upper band and other conditions are met (detects upwards breakout from downwards channel). |
Trailing filters trail down prices or volume and help to optimize Gunbot strategies. There are three types of trailing filters: buyTrailing, volumeTrailing, and slopeTrailing. Buy trailing is like a regular strategy, but it only adds pairs after hitting their trailing stop. This helps to avoid long cycling times when trailing massive numbers of pairs. Note that these filter types are only compatible with addPairs jobs on exchanges that provide ask prices or volume in tickers, and they only work when used as the first filter set of a job.
For example, here's a configuration for buy trailing:
- Collect up to 60 ticker snapshots, adding a new snapshot every minute.
- Use the 60 collected bid prices for a pair to calculate an EMA.
- Continuously trail down all pairs using a trailingRange of 1% of the ask price.
- The filter passes when the ask prices cross over the trailing stop while being below buyLevel (which is a percentage below the EMA calculated by this filter).
Volume trailing works like buy trailing, but base volume is used instead of prices. Slope trailing works like buy trailing but trails the slope percentage of a pair. Buy level is based on the same EMA as it is for buy trailing.
Filters using internal Gunbot data
Pair state filters use data from the internal ledger to filter pairs that have already cycled since the last (re)start. State data includes indicator values, balance data, candle data, and much more. There are six different types of pair state filters available, including exact match, biggerThan, smallerThan, compareBigger, compareSmaller, differenceBigger, and differenceSmaller.
Generic filters can be used with any job type and come in nine different types, such as checking if a variable value is exactly as defined or if it is bigger or smaller than the target.
Gunbot also allows you to define user variables for each job, which can be used for filtering in other jobs. By using user variables, you can avoid repeating multiple filter conditions across multiple jobs and make job dependencies possible.
Lastly, instead of using a single set of filters, you can add multiple sets of filters in a job to monitor different conditions. If a pair passes all filters in any of the filter sets, changes are made.