When using Gunbot's AutoConfig feature with the addPairs
job type, one of the fundamental configurations is specifying which trading strategy should be assigned to the newly discovered pairs that pass your filters. This is done using the strategy
parameter directly within the addPairs
job definition.
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 Role of the strategy
Parameter in addPairs
โ
The primary purpose of an addPairs
AutoConfig job is to scan an exchange for trading pairs that meet your criteria (defined by filters) and then add these qualifying pairs to your main Gunbot config.js
file, making them active for trading.
For these newly added pairs to be functional, Gunbot needs to know which trading logic to apply to them. The strategy
parameter within the addPairs
job definition serves this exact purpose. It tells AutoConfig: "If a pair passes all filters in this job, add it to config.js
and assign this specific strategy to it."
The value for the strategy
parameter must be a string that exactly matches the name of a strategy already defined in the strategies
section of your main config.js
file (e.g., "spotgrid", "stepgrid", "emotionless", or any custom strategy name you've created).
Configuration Exampleโ
Here's how the strategy
parameter is used within an addPairs
job:
{
"discoverNewAltsJob": {
"enabled": true,
"type": "addPairs", // This job's function is to add pairs
"schedule": "0 */4 * * *", // Runs every 4 hours
"strategy": "stepgrid", // User setting: Assign 'stepgrid' to newly added pairs
"pairs": {
"exchange": "binance",
"include": "USDT-" // Consider USDT-based pairs
},
"filters": {
"minVolume": {
"filterType": "minVolume24h",
"minVolume": 500000
},
"minVolatility": {
"filterType": "minVolatilityPct24h",
"minVolatility": 2.0
}
},
"overrides": { // Optional: assign default overrides too
"STOP_LIMIT": 1.0, // Example: Set a default stop limit
"GAIN": 0.8
},
"maxPairs": 20 // From pairs.maxPairs in expanded list, but often a top-level interpretation for the job
}
}
In the discoverNewAltsJob
example:
"type": "addPairs"
defines its core function."strategy": "stepgrid"
: This is the crucial line. Any pair on Binance that is USDT-based, has a 24-hour volume over 500,000, and volatility over 2.0% will be added toconfig.js
and will have thestepgrid
strategy assigned to it.- The
overrides
object is also often used inaddPairs
jobs to set initial specific parameters for the newly added pairs, which will complement the base settings from the assignedstepgrid
strategy.
If the strategy
parameter were missing, the addPairs
job might successfully identify and list pairs based on filters, but it wouldn't know how to configure them for trading in config.js
, potentially leading to errors or inactive pairs.
Key Considerationsโ
- Strategy Must Exist: The strategy name you provide (e.g., "stepgrid") must correspond to an existing, valid strategy definition in your
config.js
file'sstrategies
section. If the strategy doesn't exist, Gunbot won't be able to assign it, and the newly added pairs may not function correctly. - One Strategy Per
addPairs
Job: A singleaddPairs
job assigns only one strategy (the one specified in itsstrategy
parameter) to all pairs it successfully adds.- If you want to add some pairs with "strategyA" and others with "strategyB" based on different criteria, you would typically create two separate
addPairs
AutoConfig jobs. Each job would have its own set of filters and its own distinctstrategy
parameter.
- If you want to add some pairs with "strategyA" and others with "strategyB" based on different criteria, you would typically create two separate
- Case Sensitivity (Generally Insensitive but Be Precise): While Gunbot and AutoConfig are often case-insensitive with strategy names in filters (
strategyName
), it's best practice to use the exact casing for the strategy name in thestrategy
parameter of anaddPairs
job as it appears in yourconfig.js
strategies
definitions to ensure clarity and avoid potential issues. - Complements
overrides
: Thestrategy
parameter works alongside theoverrides
object within theaddPairs
job. The assigned strategy provides the base set of parameters, and theoverrides
then fine-tune specific settings for the newly added pairs. - Post-Addition Management: Once a pair is added with a default strategy, you can later use other AutoConfig job types like
manageOverrides
orchangeStrategy
to dynamically alter its settings or switch its strategy based on evolving conditions or performance.
The strategy
parameter is a cornerstone of the addPairs
job type in AutoConfig. It bridges the gap between discovering promising trading opportunities and integrating them into your active Gunbot trading setup with a defined operational logic. Always ensure it points to a valid, well-configured strategy in your main Gunbot settings.