While the pairs.include
parameter in Gunbot's AutoConfig defines the initial watchlist for a job, the pairs.exclude
parameter provides a way to further refine this list by blacklisting specific pairs or patterns. Pairs matching an exclude
pattern are removed from consideration, even if they initially matched an include
pattern. This allows for precise control over which pairs an AutoConfig job will ultimately process.
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.
Refining Scope with pairs.exclude
โ
The pairs.exclude
parameter works as a secondary filter after pairs.include
has established an initial list of candidate pairs. Its purpose is to explicitly remove certain pairs or types of pairs from being processed further by the AutoConfig job.
The process is:
- AutoConfig fetches all relevant tickers or configured pairs for the job's specified
pairs.exchange
. - It filters this full list using the patterns in
pairs.include
. Only pairs matching at least oneinclude
pattern remain. - From this included list, AutoConfig then removes any pairs that match at least one pattern in
pairs.exclude
. - The final, refined list of pairs is then passed to the job's main
filters
(e.g., volume, volatility, custom filters).
The value for pairs.exclude
is a string, allowing multiple patterns or exact pair names separated by commas.
Configuration and Pattern Matching Examplesโ
The exclude
parameter is located within the pairs
object of an AutoConfig job definition:
{
"stablecoinPairFocusJob": {
"enabled": true,
"type": "addPairs",
"schedule": "0 */6 * * *", // Runs every 6 hours
"strategy": "spotgrid",
"pairs": {
"exchange": "binance",
"include": "USDT-", // Initially include all USDT quoted pairs
"exclude": "USDT-BTC,USDT-ETH"
// User setting: Example of excluding specific USDT pairs like USDT-BTC and USDT-ETH.
// You could also exclude patterns like "-UNWANTEDPROJECT"
},
"filters": {
// ... filters for volume, volatility, etc. ...
}
}
}
In stablecoinPairFocusJob
:
"include": "-USDT"
: The job first considers all pairs on Binance that are quoted in USDT (e.g.,USDT-BTC
,USDT-ETH
,USDT-ADA
)."exclude": "USDT-BTC,USDT-ETH"
: From the list of USDT pairs, this rule explicitly removesUSDT-BTC
andUSDT-ETH
. IfUSDT-ADA
was also in the included set, it would remain.
The pattern matching for exclude
is substring-based, similar to include
:
"USDT-BTC"
: Excludes only the exact pairUSDT-BTC
."UNWANTED-"
: Excludes all pairs starting withUNWANTED-
(e.g.,UNWANTED-USDT
,UNWANTED-BTC
if they were in the included set).- Patterns like
"UP-"
,"DOWN-"
can be used to exclude common leveraged token prefixes if they were broadly included. "STABLECOINX-"
: If you have a category of stablecoins you wish to avoid trading as base assets (and they were part of theinclude
set).
Key Use Cases for pairs.exclude
โ
- Blacklisting Problematic Pairs: If you find certain pairs are consistently unprofitable with your strategies or exhibit erratic behavior, you can add them to
exclude
(e.g.,"exclude": "USDT-BTC"
if USDT-BTC is problematic). - Avoiding Specific Asset Types (Example): If certain types of assets (e.g., hypothetical leveraged tokens if they were part of a broader include like
"include": "-"
) are not desired, their patterns can be excluded. For example, ifUPUSDT-BTC
andDOWNUSDT-BTC
were leveraged versions ofUSDT-BTC
, you might use"exclude": "UPUSDT-,DOWNUSDT-"
. (Note: This is illustrative as exact leveraged token naming varies). - Filtering Out Specific Base/Quote Combinations: If your
include
is broad (e.g.,"-"
), you might useexclude
to remove specific combinations likeUSDT-ETH
if you only want to trade BTC against USDT from your allowed list, i.e.,include: "USDT-", exclude: "USDT-ETH,BTC-ETH"
. - Excluding Newly Listed/Unstable Coins: If a broad
include
pattern might pick up very new listings, you could temporarily add specific new pairs likeNEWCOIN-USDT
(if it were an allowed pair format) toexclude
until they stabilize. - Refining Category Selections: If
include
defines a category (e.g., by a common prefix like"USDT-"
),exclude
can remove specific members likeUSDT-ETH
if you only wantUSDT-BTC
from that category.
Best Practicesโ
- Start with
include
: Always define your primary scope withpairs.include
first.exclude
is for refining that initial list, not for defining the main scope itself. - Be Specific When Needed: While wildcard-like patterns are useful, for blacklisting individual known problematic pairs, use their full, exact names in
exclude
for clarity. - Regular Review: If you use
exclude
to manage lists of unwanted coins, periodically review and update this list as new tokens are listed or old ones become irrelevant. - Test Your Patterns: The combination of
include
andexclude
can sometimes have unintended consequences if patterns are too broad or overlap confusingly. If in doubt, test with adebug: true
setting in your AutoConfig job and observe the "filtered pair list" messages in the logs to ensure it's behaving as expected. - Consider
acUserData.json
for Dynamic Blacklists: For very long or frequently changing blacklists, managing them inpairs.exclude
withinautoconfig.json
can become cumbersome. An alternative is to maintain your blacklist inacUserData.json
and use acustom
filter in AutoConfig to checkthis.userData.myBlacklistedPairs.includes(this.pairName)
.
The pairs.exclude
parameter provides an essential layer of control, allowing you to create precise and robust pair selection logic in AutoConfig. By effectively blacklisting unwanted pairs, you can better protect your capital, avoid problematic assets, and keep your automated trading focused on the most suitable opportunities.