AutoConfig lets you set or change pair-specific strategy parameters through the overrides object. This is most commonly used in manageOverrides (update existing pairs) and addPairs (set initial parameters for new 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.
The Purpose of the overrides Object
Each pair uses a base strategy (for example, spotgrid) with default parameters. Overrides replace those defaults for a single pair without changing the base strategy itself.
manageOverrides: If a pair passes the job filters, the override parameters are written to that pair inconfig.js.addPairs: When a new pair is added, the job’s basestrategyis set and the overrides are applied immediately.
Configuring the overrides Object
The overrides object is a key-value map. Keys must match valid strategy parameters (case-sensitive), and values must be the correct type for that parameter.
Example with manageOverrides:
{
"adaptiveRiskManager": {
"enabled": true,
"type": "manageOverrides2",
"schedule": "*/15 * * * *",
"pairs": {
"exchange": "binance",
"include": "USDT-"
},
"filters": {
"highVolatilityDetected": { // Some filter to detect high volatility
"filterType": "minVolatilityPct24h",
"minVolatility": 5.0
}
},
"overrides": { // User setting: Apply these if volatility is high
"STOP_LIMIT": 2, // Example: Set a stop limit
"BUY_ENABLED": false, // Temporarily disable new buys
"SELL_ENABLED": true // Example: Ensure selling is enabled
},
"clearOverrides": false // Optional: if true, would wipe existing overrides first
}
}
In adaptiveRiskManager, pairs with 24-hour volatility above 5.0% get the listed overrides written to their override section in config.js.
Example with addPairs:
{
"cautiousPairAdder": {
"enabled": true,
"type": "addPairs",
"schedule": "0 0 * * *",
"strategy": "stepgrid", // Base strategy for new pairs
"pairs": { /* ... */ },
"filters": { /* ... */ },
"overrides": { // User setting: Initial overrides for newly added pairs
"STOP_LIMIT": 0.25, // Example: Start with a specific stop limit
"GAIN": 1.0,
"BUY_ENABLED": true // Example: Ensure buying is enabled
}
}
}
In cautiousPairAdder, newly added pairs get the stepgrid strategy and the listed overrides.
Dynamic Override Values with JavaScript
Override values can be evaluated as JavaScript at runtime. To enable evaluation, the string must start with a space. You can reference context variables like this.pair, this.variables, and this.tickers.
"overrides": {
"GAIN": " this.variables.globalRiskFactor * 1.5 " // Example: Set GAIN based on a global variable
}
" this.variables.globalRiskFactor * 1.5 ": SetsGAINfrom a global variable.
Key Considerations
- Parameter names: Use valid, case-sensitive parameter names.
clearOverrides(inmanageOverrides):false(default): Merge new values with existing overrides.true: Remove all existing overrides before applying the new ones.
- Data types: Match the expected type (number, boolean, string). For evaluated JavaScript, ensure the result type matches the parameter.
- Base strategy: Overrides change values; they do not replace the assigned strategy.
- Debugging: If overrides do not apply, check logs and enable
debug: truefor filter details.