Gunbot's AutoConfig removePairs job type is primarily used to automatically delist pairs based on dynamic filter conditions like low profit or volume. However, it also offers an auxiliary function through the pairs.removeDisabled option. When enabled, this allows the removePairs job to also identify and remove pairs from your config.js that have been manually set to "enabled": false. This helps keep your configuration tidy and free of inactive, forgotten pairs.
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.
Keeping config.js Tidyโ
Over time, as you trade with Gunbot, you might manually disable pairs in your config.js for various reasons:
- A pair is underperforming, and you want to stop trading it temporarily.
- An exchange announces delisting or maintenance for a pair.
- You're testing a new strategy and disable pairs running older ones.
While these pairs are no longer actively trading, their configuration entries remain in config.js. If many such pairs accumulate, your configuration file can become lengthy and harder to manage. The pairs.removeDisabled option in a removePairs AutoConfig job provides an automated way to prune these inactive entries.
How pairs.removeDisabled: true Worksโ
When you include pairs.removeDisabled: true in the pairs object of an AutoConfig job with type: "removePairs" (or "removePairs2"):
Primary Filter-Based Removal: The job first executes its standard logic. It evaluates all enabled pairs (that match
pairs.include/pairs.excludeand are older thanpairs.notRemoveBeforeif set) against its mainfiltersblock. Enabled pairs passing these filters are removed (or have theirBUY_ENABLED/SELL_ENABLEDset tofalse, depending on Gunbot's specificremovePairsimplementation).Disabled Pair Scan: Additionally and independently, if
pairs.removeDisabled: true:- The job scans all pairs listed in
config.jsfor the specifiedpairs.exchange. - It identifies any pair that has its top-level
"enabled"parameter set tofalse. - These manually disabled pairs are then removed entirely from the
config.jsfile.
- The job scans all pairs listed in
Important Distinction: The main filters of the removePairs job (e.g., checking for low profit, low volume) are not applied to pairs being considered for removal by the removeDisabled: true logic. The only criterion for this specific cleanup action is "enabled": false.
Configuration Exampleโ
Here's how you would configure a removePairs job to also clean up disabled pairs:
{
"configJanitorJob": {
"enabled": true,
"type": "removePairs",
"schedule": "0 5 * * 1", // Runs weekly, early Monday morning
"pairs": {
"exchange": "kraken",
"include": "-EUR,-USD", // Consider all EUR and USD pairs on Kraken
"notRemoveBefore": 20160, // Only apply main filters to pairs older than 2 weeks (14 days)
"removeDisabled": true, // User setting: Also remove any manually disabled pairs
"noBag": false // For main filter removal, remove even if bag exists (example)
},
"filters": { // These filters apply to *enabled* pairs older than 'notRemoveBefore'
"veryLowWeeklyTrades": {
"filterType": "custom",
"script": " return (this.pairVariables[this.exchangeName]?.[this.pairName]?.tradesThisWeek || 0) < 2;"
}
}
}
}
In the configJanitorJob:
- It targets EUR and USD pairs on Kraken.
- Main Filter Logic: For enabled pairs older than 2 weeks, if they had fewer than 2 trades this week (checked by the custom filter), they would be removed by the primary action of the
removePairsjob. removeDisabledLogic: Because"removeDisabled": true, this job will also scan all Kraken pairs inconfig.js(regardless of theincludeornotRemoveBeforesettings for this specific part of the logic). If it finds any pair like"USDT-BTC": { "enabled": false, ... }(assuming USDT-BTC was a Kraken pair in this context), it will remove the entire "USDT-BTC" entry fromconfig.js. This happens irrespective of USDT-BTC's age, volume, or profitability.
Benefits of Using pairs.removeDisabledโ
- Automated Configuration Hygiene: Keeps your
config.jslean by automatically removing entries for pairs you've decided to stop trading. - Reduced Clutter: Makes your
config.jseasier to read, manage, and back up. - Prevents Accidental Reactivation: Ensures that pairs you've intentionally disabled don't get inadvertently re-enabled by other broad AutoConfig jobs if you're not careful with those jobs'
includepatterns. - Complements Dynamic Removal: Works alongside the filter-based removal of enabled pairs, providing a two-pronged approach to pair list management.
Important Considerationsโ
- Irreversible Action: Removing a pair's configuration (whether it's an enabled pair via filters or a disabled pair via
removeDisabled) is a permanent deletion fromconfig.jsfor that run. If you want to trade that pair again, it will need to be re-added (manually or by anaddPairsjob). Always have backups of yourconfig.js. - Scope:
removeDisabled: trueapplies to any pair on the job's targetpairs.exchangethat has"enabled": false. It's not restricted by thepairs.includeorpairs.notRemoveBeforesettings when performing this specific cleanup. - Intention: Use this option when you are sure that disabled pairs are genuinely ones you no longer wish to keep configured, even in an inactive state. If you disable pairs very temporarily for quick tests, you might not want this option active in a frequently run
removePairsjob. - Interaction with
addPairs: If you have an aggressiveaddPairsjob, it might re-add a pair that was just removed byremoveDisabled: trueif that pair still meets theaddPairscriteria. Your overall AutoConfig logic should be cohesive.
The pairs.removeDisabled: true option is a helpful utility for maintaining a clean and current config.js file by automating the removal of pairs you've already decided to deactivate. It acts as a janitorial function within your removePairs AutoConfig jobs.