Skip to main content

AutoConfig Examples

Use the examples on this page to implement common AutoConfig trading automations.

Info

These examples are templates for common AutoConfig use cases. Adjust parameters like YOUR_STRATEGY, exchange names, and filter values to suit your setup. Remember that all jobs for an exchange are stored in autoconfig.json.

Add Top Volume Pairs

This example shows how to automatically add and remove top-volume BTC pairs on Binance, excluding low-satoshi pairs and those with a bid/ask spread higher than 0.4%.

The addPairs job limits active pairs to ten. Pairs that no longer meet the criteria (for example, volume rank drops or spread rises above 0.4%) are removed by the removePairs job after being in the configuration for over an hour. Pairs with a balance worth more than MIN_VOLUME_TO_SELL are not removed because noBag: true.

{
"addPairs": {
"pairs": {
"exclude": "",
"include": "BTC-",
"maxPairs": 10,
"exchange": "binance"
},
"filters": {
"price": {
"type": "minPrice",
"min": 0.000001
},
"volume rank": {
"type": "maxVolumeRank",
"max": 11
},
"spread": {
"type": "maxSpreadPct",
"max": 0.4
}
},
"schedule": "*/5 * * * *",
"type": "addPairs",
"strategy": "YOUR_STRATEGY",
"debug": false,
"resume": true,
"enabled": true
},
"removePairs": {
"pairs": {
"exclude": "",
"noBag": true,
"removeDisabled": true,
"exchange": "binance",
"notRemoveBefore": 60
},
"filters": {
"volume rank": {
"type": "minVolumeRank",
"min": 11
},
"spread": {
"type": "minSpreadPct",
"min": 0.4
}
},
"schedule": "*/15 * * * *",
"type": "removePairs",
"enabled": true,
"resume": true,
"debug": true
}
}

Add Uptrending BTC and USDT Pairs

This example shows automatic management of trending BTC and USDT pairs on Binance, excluding low-satoshi pairs (for BTC) and those with a bid/ask spread higher than 0.6% (as per filter example). It also prevents crossover problems, such as trading both USDT-BTC and BTC-ETH simultaneously, using noCrossover: true.

This example uses ticker data filters to determine recent pair behavior.

Each addPairs job limits its respective pair list (BTC or USDT) to ten active pairs. Pairs that no longer meet the criteria after being in the configuration for over an hour are removed by the "Remove pairs after 1h" job. Pairs with a balance worth more than MIN_VOLUME_TO_SELL are not removed.

{
"Add uptrending BTC pairs": {
"pairs": {
"exclude": "USDT-BTC",
"include": "BTC-",
"maxPairs": 10,
"noCrossover": true,
"exchange": "binance"
},
"filters": {
"filter1": {
"type": "minPrice",
"min": 0.000001
},
"filter2": {
"type": "minVolume24h",
"min": 150
},
"filter3": {
"type": "minVolatilityPct24h",
"min": 2.5
},
"filter4": {
"type": "maxVolatilityPct24h",
"max": 10
},
"filter5": {
"type": "minSlopePctInterval",
"min": 0.0075
},
"filter6": {
"type": "maxSlopePctInterval",
"max": 0.05
},
"filter7": {
"type": "minPricePctChangeInterval",
"min": 0.5
},
"filter8": {
"type": "maxPricePctChangeInterval",
"max": 5
},
"filter9": {
"type": "maxSpreadPct",
"max": 0.6
}
},
"schedule": "1,6,11,16,21,26,31,36,41,46,51,56 * * * *",
"type": "addPairs",
"strategy": "YOUR_BTC_STRATEGY",
"snapshots": 144,
"debug": false,
"setITB": true,
"resume": true,
"enabled": true
},
"Add uptrending USDT pairs": {
"pairs": {
"exclude": "USDT-BTC",
"include": "USDT-",
"maxPairs": 10,
"noCrossover": true,
"exchange": "binance"
},
"filters": {
"filter2": {
"type": "minVolume24h",
"min": 300000
},
"filter3": {
"type": "minVolatilityPct24h",
"min": 2.5
},
"filter4": {
"type": "maxVolatilityPct24h",
"max": 10
},
"filter5": {
"type": "minSlopePctInterval",
"min": 0.0075
},
"filter6": {
"type": "maxSlopePctInterval",
"max": 0.05
},
"filter7": {
"type": "minPricePctChangeInterval",
"min": 0.5
},
"filter8": {
"type": "maxPricePctChangeInterval",
"max": 5
},
"filter9": {
"type": "maxSpreadPct",
"max": 0.6
}
},
"schedule": "3,8,13,18,23,28,33,38,43,48,53,58 * * * *",
"type": "addPairs",
"strategy": "YOUR_USDT_STRATEGY",
"snapshots": 144,
"debug": false,
"setITB": true,
"resume": true,
"enabled": true
},
"Remove pairs after 1h": {
"pairs": {
"exclude": "",
"noBag": true,
"removeDisabled": true,
"exchange": "binance",
"notRemoveBefore": 60
},
"filters": {
"filter10": {
"type": "minPrice",
"min": 0.00000000001
}
},
"schedule": "*/15 * * * *",
"type": "removePairs",
"snapshots": 1,
"enabled": true,
"debug": false
}
}

Dynamic Gain Target

This example dynamically sets the GAIN override to 2 if ema1 is greater than ema2 for a pair, and to 1 if ema1 is less than or equal to ema2. The custom filter always passes. It is included because this job does not require any other filter conditions for pair selection but needs at least one filter to process pairs for override changes.

{
"dynamicGainTarget": {
"pairs": {
"exclude": "",
"include": "-",
"exchange": "binance"
},
"filters": {
"alwaysPasses": {
"type": "custom",
"target": " true"
}
},
"overrides": {
"GAIN": " this.pair.ema1 > this.pair.ema2 ? 2 : 1"
},
"clearOverrides": false,
"schedule": "* * * * *",
"type": "manageOverrides",
"debug": true,
"enabled": true
}
}

Custom Code Example

This example illustrates how custom JavaScript can be used in various parts of an AutoConfig job. Use a JavaScript minifier to convert readable code into the single-line minified code required for AutoConfig JSON string values.

{
"moveBounds": {
"pairs": {
"exclude": "",
"include": "-",
"exchange": "binance"
},
"filters": {
"Sanity checks": {
"type": "custom",
"target": " (function CheckDataExists(data){if(typeof data.pair.whatstrat==='undefined'){return false;} if(typeof data.pair.ABP==='undefined'){return false;} if(typeof data.pair.candlesclose==='undefined'){return false;} if(typeof data.pair.candlesopen==='undefined'){return false;} if(typeof data.pair.Ask==='undefined'){return false;} if(typeof data.pair.Bid==='undefined'){return false;} if(typeof data.pair.quoteBalance==='undefined'){return false;}else{return true;}})(this)"
},
"Price movement": {
"type": "custom",
"target": " (function trackMovement(data){const upperboundThresholdPct=5;const lowerboundThresholdPct=10;if(typeof data.pairVariables==='undefined'){return!0}else if(typeof data.pairVariables.binance==='undefined'){return!0}else if(typeof data.pairVariables.binance[data.pairName]==='undefined'){return!0}else if(typeof data.pairVariables.binance[data.pairName].referencePrice!=='number'){return!0};const upperbound=parseFloat(data.pair?.whatstrat?.UPPER_BOUND);const lowerbound=parseFloat(data.pair?.whatstrat?.LOWER_BOUND);if(data.pair.Bid>upperbound*(1-(upperboundThresholdPct/100))||data.pair.Bid>upperbound){return true} if(data.pair.Bid<lowerbound*(1+(lowerboundThresholdPct/100))||data.pair.Bid<lowerbound){return true}})(this)"
}
},
"setPairVariable": {
"referencePrice": " this.pair.Bid"
},
"overrides": {
"UPPER_BOUND": " this.pair.Bid > this.pairVariables['binance'][this.pairName].referencePrice ? this.pair.Bid * 1.5 : this.pair.Bid * 1.1",
"LOWER_BOUND": " this.pair.Bid > this.pairVariables['binance'][this.pairName].referencePrice ? this.pair.Bid * 0.9 : this.pair.Bid * 0.5"
},
"clearOverrides": false,
"schedule": "*/15 * * * * *",
"type": "manageOverrides",
"debug": true,
"enabled": true
}
}