AutoConfig
Automated config changes for Gunbot. Enables you to automatically add or remove trading pairs, or change pair overrides - using filter criteria you define.
Available for Gunbot Standard and higher.
Gunbot AutoConfig is a collection of tools you can use to dynamically manage your config files.
You can create "jobs" to do something you would normally do by hand, for example scan an exchange for potential pairs to add, and schedule the job in a cron-like format.
Examples of things you can do with AutoConfig:
    Scan exchanges and automatically add pairs: for example add pairs with volume > 500 BTC and for which price is rising. You can even filter on buy trailing stops for all pairs on an exchange.
    Simulate your filter settings for adding pairs: you can collect your own data for backtesting and simulate all possible filters.
    Scan exchanges to remove pairs from your config: for example remove pairs without quote balance for which volume has dropped below 100 BTC.
    Change the strategy for pairs from your config: for example set a bag handling strategy when the pair did buy but prices dropped a lot.
    Change the exchange delay.
    Monitor pair state information and automatically set pair overrides: for example set a different DU_BUYDOWN after the first round of DU happened.
    Handle hedging in bitRage: use your own criteria to initiate hedging from BTC to USDT in bitRage (or the other way around).
    Set user variables as output for a filter job, which can be used to filter on in other jobs.
    Complete orchestration of complex trading setups: you can use javascript to create custom autoconfig filters and to set override or variable values. This allows for completely custom scenarios.

How it works

There is a single config file for AutoConfig (autoconfig.json), which can contain one or many jobs. As soon as Gunbot (re)starts or the autoconfig.json file is changed, all jobs in the config are scheduled (any pre-existing scheduled job is removed in this process).
When a job is processed, changes to config.js are only made for pairs that have passed every filter.
    The autoconfig.json file can contain one or many jobs, each with its own schedule.
    One job always applies to one exchange.
    One job can have one or many filters.
    Within a job, you can set filters for which pairs it applies.
If a job successfully completes, the changes are written to config.js and Gunbot starts using the new settings. Most config changes, like pair override changes, are applied without causing a bot restart. If a job causes no changes, for example because it tries to place already existing overrides, it won't cause a Gunbot restart.
Schedules are set per job in a format similar to how cron jobs are set. If you're not used to the format, use a website like https://crontab-generator.org/ to generate it.
All config options are available in the browser interface. Even if you prefer manually editing the config file, it's recommended to create a config example using the interface, this way you can be sure all essential parameters exist.
If you use a very fast schedule, for example with jobs that might update your bot config every few seconds, prevent unexpected config changes and make it a habit to not make manual settings changes using the browser anymore while AutoConfig jobs are running.

Job types (with config examples)

Each job type has a number of obligatory parameters, these are described below for each job type.
Additionally, there are optional parameters you can use to extend the functionality of a job.

Adding pairs

Type name in config: addPairs
This job type uses ticker filters.
Job output: add trading pairs to a specific exchange.
Pair options:
include: included pairs (processed first). Any pair on the exchange that matches any of the includes, will be processed. In case you also use the exclude option, the resulting pairs after processing the includes is the starting point for processing excludes, which will remove items from this list of pairs.
Included items do not need to be whole pair names, as long as part of the string matches an actual pair, it will be included. Input as comma separated list, does not accept spaces between items. Can not be empty.
exclude: excluded pairs (processed last). Any pair on the exchange that matches any of the excludes, won't be processed.
Excluded items do not need to be whole pair names, as long as part of the string matches an actual pair, it will be excluded. Input as comma separated list, does not accept spaces between items. Can be empty.
maxPairs: maximum number of allowed pairs. In case a filter action would result in more pairs than this setting, the config will be filled up to the max number of allowed pairs. Only enabled pairs count towards maxPairs.

Other obligatory parameters:

strategy: this defines the strategy that will be assigned to pairs added by this job. It must be the exact name of an existing strategy in your config.js file.
snapshots: defines how many ticker snapshots are saved to perform calculations on. Relevant for filter types that include Interval in their name.
For example: snapshots is set to 10, this means that the ticker data for the last 10 times the job runs are saved and some of the values in it are used for calculating average values over time.

Config example

The example below shows a job that does the following:
    Scan Binance tickers every minute
    Automatically add BTC-x pairs (but not BTC-DOGE, which is excluded) that have a top 10 volume ranking and for which the bid/ask spread is below 0.2%
    Added pairs get the "gain" strategy assigned
    Allows for up to 25 active trading pairs on Binance
1
{
2
"addTopVolumePairs": {
3
"pairs": {
4
"exclude": "DOGE",
5
"include": "BTC-",
6
"maxPairs": 25,
7
"exchange": "binance"
8
},
9
"filters": {
10
"filter1": {
11
"type": "maxVolumeRank",
12
"max": 11
13
},
14
"filter2": {
15
"type": "maxSpreadPct",
16
"max": 0.2
17
}
18
},
19
"schedule": "* * * * *",
20
"snapshots": 1,
21
"type": "addPairs",
22
"strategy": "gain"
23
}
24
}
Copied!
****

Removing pairs

Type names in config: removePairs (uses ticker filters) or removePairs2 (uses state filters).
You must have at least one pair set per exchange you use this job type on.
Job output: removes trading pairs from a specific exchange.
Pair options:
exclude: pairs that should not be scanned for possible removal. Any active pair that matches any of the excludes, won't be processed.
Excluded items do not need to be whole pair names, as long as part of the string matches an actual pair, it will be excluded. Input as comma separated list, does not accept spaces between items. Can be empty.
There is no include options for this filter type. Pairs in your config (that have already cycled in Gunbot) are basically the list of includes.
noBag (true/false): when true, only pairs with a balance below MIN_VOLUME_TO_SELL that have no open orders and are not in reversal trading, are filtered for possible removal. When set to false, all pairs in config are filtered.
removeDisabled (true/false): when true, each time a removePairs job is ran it will remove all disabled pairs for the exchange the job runs on - regardless of filter settings. Useful, for example, when you use COUNT_SELL.

Other obligatory parameters:

snapshots: defines how many ticker snapshots are saved to perform calculations on. Relevant for filter types that include Interval in their name.
For example: snapshots is set to 10, this means that the ticker data for the last 10 times the job runs are saved and some of the values in it are used for calculating average values over time.

Config example

The example below shows a job that does the following:
    Scan Binance tickers every ten minutes
    Remove any pair that has has a volume ranking below 20, besides pairs containing BNB or XVG in their name.
    Additionally, remove all disabled pairs from the config.
1
{
2
"removeCrap": {
3
"pairs": {
4
"exclude": "BNB,XVG",
5
"noBag": false,
6
"removeDisabled": true,
7
"exchange": "binance"
8
},
9
"filters": {
10
"filter1": {
11
"type": "minVolumeRank",
12
"min": 20
13
}
14
},
15
"schedule": "*/10 * * * *",
16
"snapshots": 1,
17
"type": "removePairs"
18
}
19
}
Copied!

Change strategy

Type names in config: changeStrategy (uses ticker filters) or changeStrategy2 (uses state filters).
This job type is basically the same as how removePairs works, but this one changes a pairs strategy instead of removing the pair.
You must have at least one pair set per exchange you use this job type on.
Job output: change assigned trading strategy for pairs on one exchange.
****
Pair options:
exclude: pairs that should not be scanned for possible removal. Any active pair that matches any of the excludes, won't be processed.
Excluded items do not need to be whole pair names, as long as part of the string matches an actual pair, it will be excluded. Input as comma separated list, does not accept spaces between items. Can be empty.
There is no include options for this filter type. Pairs in your config (that have already cycled in Gunbot) are basically the list of includes.
bag (true/false): when true, only pairs with a balance below MIN_VOLUME_TO_SELL that have no open orders and are not in reversal trading, are filtered for possible removal. When set to false, all pairs in config are filtered.
****
Other obligatory parameters:
strategy: the target strategy to set for pairs matching all filters.
snapshots: defines how many ticker snapshots are saved to perform calculations on. Relevant for filter types that include Interval in their name.
For example: snapshots is set to 10, this means that the ticker data for the last 10 times the job runs are saved and some of the values in it are used for calculating average values over time.

Config example

The example below shows a job that does the following:
    Scan Binance tickers every 15 minutes
    Change the assigned strategy for any pair that has below median trading volume, except BTC-LTC
    Assign the strategy "baghandler" to these pairs
1
{
2
"changeStrat": {
3
"pairs": {
4
"exclude": "BNB-LTC",
5
"bag": true,
6
"exchange": "binance"
7
},
8
"filters": {
9
"filter1": {
10
"type": "belowMedianVolume"
11
}
12
},
13
"schedule": "*/15 * * * *",
14
"snapshots": 1,
15
"type": "changeStrategy",
16
"strategy": "baghandler"
17
}
18
}
Copied!

Managing overrides

Type name in config: manageOverrides
This job type uses state filters.
Job output: changes overrides for pairs on a specific exchange.
Pair options:
include: included pairs (processed first), can not be empty. Any active trading pair that matches any of the includes, will be processed. In case you also use the exclude option, the resulting pairs after processing the includes is the starting point for processing excludes, which will remove items from this list of pairs.
Included items do not need to be whole pair names, as long as part of the string matches an actual pair, it will be included. Input as comma separated list, does not accept spaces between items. Can not be empty.
exclude: excluded pairs (processed last). Any active trading pair that matches any of the excludes, won't be processed.
Excluded items do not need to be whole pair names, as long as part of the string matches an actual pair, it will be excluded. Input as comma separated list, does not accept spaces between items. Can be empty.
****
Other obligatory parameters:
overrides: contain zero or more overrides, these will be set for each pair that passes all filters when a job is executed.
clearOverrides (true/false): when set to true, all existing overrides for a pair are removed before placing the new ones.
****

Config example

The example below shows a job that does the following:
    Scan Binance pairs every minute, process filters on all active trading pairs that include "USDT" or "BNB" and do not include "DOGE" or "ETH" in their pair name.
    Set a DU_BUYDOWN override for all pairs that have ducount 1
1
{
2
"DynamicDU1": {
3
"pairs": {
4
"exclude": "DOGE,ETH",
5
"include": "USDT,BNB",
6
"exchange": "binance"
7
},
8
"filters": {
9
"ducount": {
10
"type": "exact",
11
"ducount": 1
12
}
13
},
14
"overrides": {
15
"DU_BUYDOWN": 3
16
},
17
"clearOverrides": false,
18
"schedule": "* * * * *",
19
"type": "manageOverrides"
20
}
21
}
Copied!

Change exchange delay

Type name in config: changeDelay
This job type uses state filters.
Job output: changes the exchange delay for a specific exchange.
Pair options:
include: included pairs (processed first), can not be empty. Any active trading pair that matches any of the includes, will be processed. In case you also use the exclude option, the resulting pairs after processing the includes is the starting point for processing excludes, which will remove items from this list of pairs.
Included items do not need to be whole pair names, as long as part of the string matches an actual pair, it will be included. Input as comma separated list, does not accept spaces between items. Can not be empty.
exclude: excluded pairs (processed last). Any active trading pair that matches any of the excludes, won't be processed.
Excluded items do not need to be whole pair names, as long as part of the string matches an actual pair, it will be excluded. Input as comma separated list, does not accept spaces between items. Can be empty.
****
Other obligatory parameters:
delay: exchange delay in seconds, this value will be set when one or more pairs in the job pass all filters.
****

Config example

The example below shows a job that does the following:
    Scan Binance pairs every minute, process filters on all active trading pairs that include "USDT" or "BNB" and do not include "DOGE" or "ETH" in their pair name.
    Set a the exchange delay for Binance to 10 in case at least one pair matches the filter
1
{
2
"DynamicDU1": {
3
"pairs": {
4
"exclude": "DOGE,ETH",
5
"include": "USDT,BNB",
6
"exchange": "binance"
7
},
8
"filters": {
9
"ducount": {
10
"type": "exact",
11
"ducount": 1
12
}
13
},
14
"delay": 10,
15
"schedule": "* * * * *",
16
"type": "changeDelay"
17
}
18
}
Copied!

Manage bot settings

Type names in config: manageBotSettings (uses state filters).
This job type is basically the same as how changeStrategy works, but this type is able to change the global bot settings.
You must have at least one pair set per exchange you use this job type on.
Job output: change assigned parameters in the bot section. Happens when at least one pair passes all filters
****
Pair options:
exclude: pairs that should not be filtered. Any active pair that matches any of the excludes, won't be processed.
Excluded items do not need to be whole pair names, as long as part of the string matches an actual pair, it will be excluded. Input as comma separated list, does not accept spaces between items. Can be empty.
There is no include options for this filter type. Pairs in your config (that have already cycled in Gunbot) are basically the list of includes.
****
Other obligatory parameters:
bot: the target bot settings.
****

Config example

1
{
2
"botsettings": {
3
"pairs": {
4
"exclude": "",
5
"include": "BTC-",
6
"exchange": "binance"
7
},
8
"filters": {
9
"price": {
10
"type": "biggerThan",
11
"Ask": 0.00000001
12
}
13
},
14
"bot": {
15
"BOT_DELAY": 20,
16
"BOT_CCLEAN": 9991
17
},
18
"schedule": "* * * * *",
19
"type": "manageBotSettings"
20
}
21
}
Copied!

Hedge (for Gunbot)

Type names in config: hedgeGB (uses ticker filters) or hedgeGB2 (uses state filters).
You must have at least one pair set per exchange you use this job type on.
Job output:
You can define a "hedge pair" like USDT-BTC, between which Gunbot should hedge when the market conditions are right for it. If you prefer hedging between completely other currrencies, like BTC-ETH - you can do that too.
It works with two autoconfig jobs, in which you define when it should hedge and to which currency it should hedge.
    When a pair can be hedged without intermediate pair, autoconfig will change a pair like BTC-ETH to USDT-ETH and panic sell directly to ETH.
    When an intermediate pair is needed, the pair will be panic sold first and then traded on the defined hedge pair.
****
Pair options:
Pair filtering is hardcoded to the defined hedge pair.
exclude: used as placeholder
bag: used as placeholder
baseFrom: base currency to hedge away from
baseTo: base currency to hedge to
hedgePair: pair used for hedging, like USDT-BTC
****
Other obligatory parameters:
setVariable: hedging will only work when both hedging jobs set a variable with the currency it last hedged to, this makes sure that the direction can be tracked for the next hedging action.

Config example

You'll need two jobs to do this, one for each hedging direction:
1
{
2
"hedging": {
3
"pairs": {
4
"exclude": "",
5
"exchange": "binance",
6
"bag": false,
7
"baseFrom": "BTC",
8
"baseTo": "USDT",
9
"hedgePair": "USDT-BTC"
10
},
11
"filters": {
12
"filter1": {
13
"type": "yourTickerFilter",
14
"min": "0.0000000001"
15
},
16
"filter2": {
17
"type": "variableNotExist",
18
"hegdedTo": "BTC"
19
}
20
},
21
"filters2": {
22
"filter1": {
23
"type": "yourTickerFilter",
24
"min": "0.0000000001"
25
},
26
"filter2": {
27
"type": "variableExact",
28
"hegdedTo": "BTC"
29
}
30
},
31
"setVariable": {
32
"hegdedTo": "USDT"
33
},
34
"strategy": "gain",
35
"schedule": "1 */4 * * *",
36
"type": "hedgeGB",
37
"debug": false
38
}
39
}
Copied!
The second job would be a mirror job, with all hedge currencies reversed.
Two important notes:
    keep the hedge pair in your config at all times, prefably with buy/sell disabled to avoid crossover between base/quote.
    set the filter for "type": "variableNotExist", ONLY in the job that will take care of the next hedging action. For example, when you start out with BTC-x pairs only, add this filter to the job that hedges to USDT.

Hedge (for bitRage)

Type name in config: hedge
This job type uses state filters.
Job output: initiates hedging in bitRage.
Pair options:
include: included pairs (processed first), can not be empty. Any active trading pair that matches any of the includes, will be processed. In case you also use the exclude option, the resulting pairs after processing the includes is the starting point for processing excludes, which will remove items from this list of pairs.
Included items do not need to be whole pair names, as long as part of the string matches an actual pair, it will be included. Input as comma separated list, does not accept spaces between items. Can not be empty.
exclude: excluded pairs (processed last). Any active trading pair that matches any of the excludes, won't be processed.
Excluded items do not need to be whole pair names, as long as part of the string matches an actual pair, it will be excluded. Input as comma separated list, does not accept spaces between items. Can be empty.
****
Other obligatory parameters:
hedgeTo (USDT/BTC): defines which currency to start hedging to.
brStrat: defines which strategy is used for bitRage.
****

Config example

The example below shows a job that does the following:
    Scan for a user variable, every minutes
    Once this variable is found, it places filteredBase, filteredQuote and filteredPair blocks as defined in the job, for kucoin (this part is optional)
    Once this variable is found, it makes the following changes in the strategy bitrageStrat, it sets/changes the following parameters so that hedging will start:
1
"AUTOSELL": true,
2
"MAIN_BASE": "USDT",
3
"BR_PANIC_SELL": true,
Copied!
1
{
2
"Hedge_to_USDT": {
3
"pairs": {
4
"exclude": "",
5
"include": "",
6
"exchange": "kucoin",
7
"filteredBase": [
8
"TUSD",
9
"PAX",
10
"KCS",
11
"NUSD",
12
"ETH",
13
"DAI",
14
"USDC",
15
"TRX",
16
"NEO",
17
"BTC"
18
],
19
"filteredQuote": [
20
"GGC"
21
],
22
"filteredPair": [
23
"BTC-GGC",
24
"USDT-GGC",
25
"BTC-KCS",
26
"USDT-KCS",
27
"KCS-XRP",
28
"KCS-EOS",
29
"KCS-LTC",
30
"KCS-NEO",
31
"KCS-MTV",
32
"KCS-GO",
33
"KCS-CS",
34
"ETH-KCS",
35
"NEO-EOS",
36
"DAI-BTC",
37
"DAI-ETH",
38
"DAI-MKR",
39
"DAI-USDT"
40
]
41
},
42
"filters": {
43
"variable": {
44
"type": "variableExact",
45
"readyToHedge": "USDT"
46
}
47
},
48
"setVariable": {
49
"hedgingStarted": true
50
},
51
"schedule": "* * * * *",
52
"type": "hedge",
53
"hedgeTo": "USDT",
54
"brStrat": "bitrageStrat"
55
},
56
}
Copied!

Filtered quote (for bitRage)

Type name in config: filteredQuote
This job type uses ticker filters.
Job output: It adds the quote of each pair passing all filters to the filteredQuote list. Each time the job runs, the list gets completely replaced with the new results.
Pair options:
include: included pairs (processed first). Any pair on the exchange that matches any of the includes, will be processed. In case you also use the exclude option, the resulting pairs after processing the includes is the starting point for processing excludes, which will remove items from this list of pairs.
Included items do not need to be whole pair names, as long as part of the string matches an actual pair, it will be included. Input as comma separated list, does not accept spaces between items. Can not be empty.
exclude: excluded pairs (processed last). Any pair on the exchange that matches any of the excludes, won't be processed.
Excluded items do not need to be whole pair names, as long as part of the string matches an actual pair, it will be excluded. Input as comma separated list, does not accept spaces between items. Can be empty.

Config example

The example below would do the following:
    scan all binance BTC-x pairs
    find pairs with a bid/ask spread higher than 0.7%
    save the quote coins from these pairs in the filteredQuote list.
1
{
2
"filteredQuote": {
3
"pairs": {
4
"include": "BTC-",
5
"exclude": "",
6
"exchange": "binance"
7
},
8
"filters": {
9
"spread": {
10
"type": "minSpreadPct",
11
"min": 0.7
12
},
13
"schedule": "* * * * *",
14
"type": "filteredQuote",
15
"debug": false
16
}
17
}
Copied!
****

Optional parameters

Jobs can be extended with additional parameters, some work in all job types, some are specific to certain job types.

Optional parameters for all job types:

enabled (true/false): When false, the job is disabled and won't be executed.
debug (true/false): When true, the job generates detailed logs in the console for each filter.
brStrat: defines which strategy is used for bitRage. Only needed if you use Autoconfig to automate hedging for bitRage.

Optional parameters for jobs using ticker filters:

resume (true/false): when true, saved ticker snapshots are loaded from file after Gunbot restarts. When false, history needs to be built up again after restarting.
history: defines how many ticker entries should be kept in history storage.
historyInterval: defines the minimum interval in minutes between history entries.
****

Optional parameter for addPairs and manageOverrides

setITB (true/false): When true, each pair matching all filters will get an additional IGNORE_TRADES_BEFORE override, the value being the timestamp for the time the job ran.
delay (time in seconds): When set, the exchange delay gets adjusted to the specified value when at least one pair passes all filters. For manageOverrides only.

Optional parameters for addPairs

overrides: this job type can also add overrides when it adds new pairs. To do so, add a section with overrides to the job, just like you would in a manageOverrides job.
Bitrage filters: when used for Bitrage, you can have an addPairs job replace the contents of the exchange filter settings. To do so, add the filters in the pair section of the job as shown below:
noCrossOver (true/false): needs to be put in the pairs section. When set, Autoconfig will never add two pairs with different Base but the same Quote currency.
1
"pairs": {
2
"exclude": "",
3
"include": "BTC-",
4
"maxPairs": 10,
5
"exchange": "kucoin",
6
"filteredQuote": ["DOGE"],
7
"filteredPair": ["BTC-DOGE"],
8
"filteredBase": ["BTC","ETH","USDS","TUSD","USDC","PAX","XRP","TRX","BUSD","NGN"]
9
},
Copied!

Optional parameters for removePairs

removeBase: can be used to remove all pairs from a specified base currency that use the bitRage strategy specified in brStrat. This is useful to clean out pairs from a specific base after hedging.
notRemoveBefore (in pairs section): value in minutes. Don't remove pairs from config if it's not in the config longer than specified.

Optional parameters for hedge

Bitrage filters: when used for Bitrage, you can have an addPairs job replace the contents of the exchange filter settings. To do so, add the filters in the pair section, as shown above.

Filter options

Ticker filters

For job types: addPairs, removePairs, changeStrategy
Ticker filters use data collected from the exchange tickers, at the moment the job runs.
You can use the following filter types for adding and removing pairs. Please note that not every filter type works on every exchange, due to the fact that some exchanges don't offer the required data. On Huobi AutoConfig uses "last" price instead of bid/ask for all filters that work with prices.
Filters for prices use ask when adding pairs and bid when filtering for removal or changing strategy.
__
Type
Description
Extras
minPrice
Filter returns true when price is higher than set.
n/a
maxPrice
Filter returns true when price is lower than set.
n/a
minPricePctChangeInterval
Filter returns true if the current price is at least x% higher than the average price of all snapshots:
lastSnapshots
maxPricePctChangeInterval
Filter returns true if the current price is at least x% lower than the average price of all snapshots
lastSnapshots
minVolumePctChangeInterval
Filter returns true if the current 24h volume is at least x% higher than the average 24h volume of all snapshots
lastSnapshots
maxVolumePctChangeInterval
Filter returns true if the current 24h volume is at least x% lower than the average 24h volume of all snapshots
lastSnapshots
minVolume24h
Filter returns true if 24h volume is higher than set, volume in base
n/a
maxVolume24h
Filter returns true if 24h volume is lower than set, volume in base
n/a
minVolatilityPct24h
Filter returns true if 24h price percentage change is higher than set
n/a
maxVolatilityPct24h
Filter returns true if 24h price percentage change is lower than set
n/a
minSpreadPct
Filter returns true if percentage difference between bid and ask is higher than set
n/a
maxSpreadPct
Filter returns true if percentage difference between bid and ask is lower than set
n/a
minSlopePctInterval
Filter returns true if the slope for all prices in snapshots is bigger than set.
Slope is expressed as a percentage of the last price. A slope of 1 means that, according to a simple linear regression, the next collected ticker price is likely to be 1% higher than the last one
lastSnapshots
maxSlopePctInterval
Filter returns true if the slope for all prices in snapshots is smaller than set.
Slope is expressed as a percentage of the last price. A slope of 1 means that, according to a simple linear regression, the next collected ticker price is likely to be 1% higher than the last one.
Only executed when max snapshot sample size is reached
lastSnapshots
minStandardDevPctInterval
Filter returns true if the Standard Deviation for all prices in snapshots is bigger than set.
Standard Deviation is expressed as a percentage of the last price.
Only executed when max snapshot sample size is reached
lastSnapshots
maxStandardDevPctInterval
Filter returns true if the Standard Deviation for all prices in snapshots is smaller than set.
Standard Deviation is expressed as a percentage of the last price.
Only executed when max snapshot sample size is reached
lastSnapshots
minVolumeRank
Filter returns true if a pairs 24h volume rank (rankings are specific per base) is higher than set.
This filter is only useful if you want to exclude some of the top ranking volume pairs, for example set it to 5 to only allow pairs that have a volume rank of 6 or higher
n/a
maxVolumeRank
Filter returns true if a pairs 24h volume rank (rankings are specific per base) is lower than set.
Setting it to 10, for example, would only include pairs that have a top10 volume ranking
n/a
bullishStandardDeviationChannel
The filter passes when:
    slopePct is positive
    max snapshot count is reached
    price is within a defined range from the lower band
(it would detect a downwards breakout from an upwards channel)
Range 0 = same price as lower band
Range 100 = same price as upper band
lastSnapshots
bearishStandardDeviationChannel
The filter passes when:
    slopePct is negative
    max snapshot count is reached
    price is within a defined range from the upper band
(it would detect an upwards breakout from a downwards channel)
Range 0 = same price as upper band
Range 100 = same price as lower band
lastSnapshots
linearRegressionChannel
Same as "Linear regression" indicator on TradingView. Standard deviation is hardcoded to 2.
The filter passes when:
    max snapshot count is reached
    price is within a defined range from the lower band
Range 0 = same price as lower band
Range 100 = same price as upper band
lastSnapshots
The extra input called lastSnapshots lets you use only the last x snapshots to calculate the filter.
If for example your job collects 100 snapshots but you want a specific filter to only use the last 10 snapshots to calculate slope, you can do that.
Usage examples:
1
"maxStandardDevPctInterval": {
2
"type": "minVolumePctChangeInterval",
3
"max": 1,
4
"lastSnapshots": 3
5
}
6
7
"hedge": {
8
"type": "allowsHedging",
9
"BTC": "USDT"
10
}
Copied!
Config building blocks for ticker filters:
1
"strat": {
2
"type": "minSpreadPct",
3
"min": 0.5
4
},
5
"volume": {
6
"type": "belowMedianVolume"
7
},
8
"stdev": {
9
"type": "maxStandardDevPctInterval",
10
"max": 0.3
11
},
12
"channel": {
13
"type": "bullishStandardDeviationChannel",
14
"range": -10
15
}
Copied!

Trailing filters

The filter types buyTrailing , volumeTrailing and slopeTrailing are ticker filters that trails down prices or volume very similar to a regular Gunbot strategy with buy trailing, you can use it to add pairs to your config only after they have hit their trailing stop. Useful for trailing massive numbers of pairs without the downsides of long cycling times.
These filter types can only be used in addPairs jobs on exchanges that provide ask prices or volume in tickers, only works when used in the first filter set of a job.
Config example for buy trailing
The example below will:
    Collect up to 60 ticker snapshots, adds a new snapshot every time the job runs (every minute)
    Uses 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 crosses over the trailing stop, while being below buyLevel (which is a percentage below the EMA calculated by this filter)
Volume trailing works exactly as above, the only difference is that base volume is used where prices are used in buy trailing.
Slope trailing works just like buy trailing, the only difference is that the slope percentage of a pair is trailed. Buy level is based on the same EMA as it is for buy trailing.
1
{
2
"trailingExample": {
3
"pairs": {
4
"exclude": "",
5
"include": "BTC-,USDT-",
6
"maxPairs": 10,
7
"exchange": "binance"
8
},
9
"filters": {
10
"trailing": {
11
"type": "buyTrailing",
12
"buyLevel": 0.5,
13
"trailingRange": 1
14
}
15
},
16
"schedule": "* * * * *",
17
"type": "addPairs",
18
"strategy": "instantBuy",
19
"enabled": true,
20
"resume": true,
21
"snapshots": 60
22
},
Copied!
__

Ticker history filters

Most ticker filters are also available as *History variant. These work in the same way as described above, but they use a different data set as input. Available history filters:
    minPriceHistory
    maxPriceHistory
    maxVolumeRankHistory
    minVolumeRankHistory
    minPricePctChangeIntervalHistory
    maxPricePctChangeIntervalHistory
    minVolumePctChangeIntervalHistory
    maxVolumePctChangeIntervalHistory
    minVolume24hHistory
    maxVolume24hHistory
    minVolatilityPct24hHistory
    maxVolatilityPct24hHistory
    minSpreadPctHistory
    maxSpreadPctHistory
    minSlopePctIntervalHistory
    maxSlopePctIntervalHistory
    minStandardDevPctIntervalHistory
    maxStandardDevPctIntervalHistory
    bearishStandardDeviationChannelHistory
    bullishStandardDeviationChannelHistory
History filters take one additional input, defining which history data should be used. the config for a history filter looks like:
1
"filter": {
2
"type": "minPriceHistory",
3
"min": 10,
4
"historySource": 6
5
}
Copied!
The historySource parameter in the example above means that it will use the price of the history entry with number 6. The oldest history entry has number 0.
How the history is built up is defined by the following parameters in the root level:
1
"history": 7,
2
"historyInterval": 15,
Copied!
The example above would collect 7 history entries, with a minimum interval of 15 minutes.
New history entries are saved as follows:
    When there is no history, the oldest ticker snapshot will be added as first history entry.
    When there is at least one history entry, a new one is added when the time difference between the oldest ticker snapshot and the latest history entry is bigger than the time defined in historyInterval. The oldest ticker snapshot will be added as newest history entry. In case the maximum number of history entries is reached, the oldest history entry will get deleted once a new one gets added.
The config example below shows a job that filters for:
    BTC pairs that currently ranks top10 for 24h volume
    The 5 history entries have a slope of at least 1%
    Pair must have ranked top10 24h volume in the oldest history entry
1
If oldest snapshot is > 60 minutes older than newest history entry,
2
it gets moved to history
3
4
Snapshots, 1m interval
5
[s] [s] [s] [s] [s]
6
History entries, 60m interval |
7
[0] [1] [2] [3] [4] |
8
^-----------------------*
9
10
11
"addMoon": {
12
"pairs": {
13
"exclude": "",
14
"include": "BTC-",
15
"maxPairs": 10,
16
"exchange": "binance"
17
},
18
"filters": {
19
"filter1": {
20
"type": "maxVolumeRank",
21
"max": 10
22
},
23
"filter2": {
24
"type": "minSlopePctIntervalHistory",
25