Gunbot's AutoConfig feature allows multiple "filter sets" within a single job. A basic job might use just one set of filters (the filters object), but you can define up to ten sets (filters, filters2, ..., filters10). A pair triggers the job's action if it passes any one of these complete filter sets.
Nearly every option that follows can be set without editing files by hand.
Click the ⋮ (three-dots) menu ➜ AutoConfig, step through the wizard, and press Save; it will write a correct autoconfig.json for you.
The Logic of Multiple Filter Sets
Each filter set is an independent block of conditions.
- Within a single filter set (e.g.,
filters): All rules inside it must be true. This is AND logic. - Between multiple filter sets (e.g.,
filtersORfilters2ORfilters3): If a pair satisfies all conditions in any one set, the pair passes the overall evaluation. This is OR logic at the set level.
How to Define Multiple Filter Sets
Add objects named filters2, filters3, and so on, up to filters10, at the same level as the primary filters object. Each object contains its own filter rules.
{
"dynamicPairAdder": {
"enabled": true,
"type": "addPairs",
"schedule": "*/10 * * * *",
"pairs": {
"exchange": "binance",
"include": "USDT-",
"exclude": ""
},
"strategy": "stepgrid",
"filters": { // First set of conditions (e.g., for high volume breakouts)
"volumeCheck": {
"filterType": "minVolume24h",
"minVolume": 2000000
},
"volatilityCheck": {
"filterType": "minVolatilityPct24h",
"minVolatility": 5
}
},
"filters2": { // Second set of conditions (e.g., for steady low-volatility climbers)
"lowSpread": {
"filterType": "maxSpreadPct",
"maxSpread": 0.2
},
"steadySlope": {
"filterType": "minSlopePctInterval",
"minSlope": 0.5,
"lastSnapshots": 24 // Check slope over last 24 snapshots
},
"moderateVolume": {
"filterType": "minVolume24h",
"minVolume": 500000
}
},
"filters3": { // Third set of conditions (e.g., custom logic)
"myCustomRule": {
"filterType": "custom",
"script": " return this.pairName.startsWith('BTC');" // Example: only add BTC pairs
}
}
// Potentially up to filters10
}
}
In the dynamicPairAdder job above:
- A USDT pair on Binance will be added if it meets:
- ALL conditions in
filters(volume > 2M AND volatility > 5%) - OR ALL conditions in
filters2(spread < 0.2% AND slope > 0.5% AND volume > 500k) - OR ALL conditions in
filters3(passes the custom script logic).
- ALL conditions in
If a pair satisfies the criteria for filters but not filters2 or filters3, it still passes. If it satisfies filters2 but not filters or filters3, it also passes.
Use Cases and Advantages
- Diverse Entry Criteria: Define different market scenarios that warrant adding a pair or applying an override (e.g., bullish conditions, ranging markets, or specific news-driven patterns).
- Strategy Specialization: Multiple filter sets can help categorize pairs before applying strategies or overrides. Note: A single
addPairsjob typically assigns onestrategyand one set ofoverridesto all pairs it adds, regardless of which filter set they passed. To assign different strategies based on conditions, you might need separateaddPairsjobs or a workflow using variables (for example,setPairVariablein one job and another job acting on that variable). - Combining Broad and Specific Rules: Use one filter set for broad criteria and another for strict, high-conviction criteria.
- Testing Different Filter Combinations: Compare variations without creating separate jobs.
- Readability and Organization: Breaking logic into named filter sets can be easier to read than a single, deeply nested
filtersobject.
Important Considerations
- Order of Evaluation: The order of
filters,filters2, etc. does not typically matter because the sets are ORed. A pair is accepted as soon as it passes one full set. - Performance: Many filter sets with complex filters can increase processing time for each AutoConfig run. Monitor performance if you use demanding filter types (such as those needing many historical data lookups or custom scripts).
- Clarity vs. Complexity: Multiple sets can clarify distinct conditions, but too many sets can make logic hard to follow. If conditions diverge sharply, separate AutoConfig jobs may be clearer.
- Output Actions: For job types like
addPairsormanageOverrides, the output action (such as thestrategyoroverrides) is the same for any pair that passes, regardless of which filter set it passed. If you need different outcomes, use separate jobs or a multi-stage process with variables (for example, one job sets a variable based onfilters2, another job acts if that variable is set).
Multiple filter sets add flexibility to AutoConfig. By using AND logic within sets and OR logic between sets, you can design jobs that adapt to different market situations.