Skip to main content

Manage pair lists with 'pairs.removeDisabled' in AutoConfig

· 5 min read

AutoConfig removePairs jobs can also remove pairs that you manually disabled. Set pairs.removeDisabled: true to remove any pair in config.js with "enabled": false, keeping the config clean.

Use the AutoConfig wizard

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 you might disable pairs in config.js, for example:

  • 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.

Those entries stay in config.js unless removed. pairs.removeDisabled automates that cleanup.

How pairs.removeDisabled: true Works

When you include pairs.removeDisabled: true in a removePairs (or removePairs2) job:

  1. Primary filter-based removal: The job evaluates enabled pairs that match pairs.include/pairs.exclude and pairs.notRemoveBefore (if set). Pairs that pass the filters block are removed (or disabled, depending on the removePairs implementation).

  2. Disabled pair scan: Independently of filters, if pairs.removeDisabled: true:

    • The job scans all pairs listed in config.js for the specified pairs.exchange.
    • It identifies any pair that has its top-level "enabled" parameter set to false.
    • These manually disabled pairs are then removed entirely from the config.js file.

Important: The main filters do not apply to removeDisabled. The only criterion 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 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 removePairs job.
  • removeDisabled Logic: Because "removeDisabled": true, this job will also scan all Kraken pairs in config.js (regardless of the include or notRemoveBefore settings 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 from config.js. This happens irrespective of USDT-BTC's age, volume, or profitability.

Benefits of Using pairs.removeDisabled

  1. Automated configuration hygiene: Removes entries for pairs you've stopped trading.
  2. Reduced clutter: Keeps config.js easier to manage and back up.
  3. Prevents accidental reactivation: Disabled pairs are removed, so other jobs are less likely to re-enable them unintentionally.
  4. Complements dynamic removal: Works alongside filter-based removal of enabled pairs.

Important Considerations

  • Irreversible action: Removal deletes entries from config.js for that run. Re-add the pair manually or via addPairs. Keep backups.
  • Scope: Applies to any pair on the target pairs.exchange with "enabled": false, regardless of pairs.include or pairs.notRemoveBefore.
  • Intention: Use when disabled pairs are truly meant to stay inactive.
  • Interaction with addPairs: Aggressive addPairs jobs can re-add removed pairs if they still match criteria.