Skip to main content

AutoConfig examples

To get started quickly with AutoConfig, use the examples on this page to see how to do simple automations.

Marketplace

The community marketplace has many more AutoConfig examples.

Add top volume pairs

This example automatically manages the addition and removal of top volume BTC pairs on Binance, while excluding low sat pairs and those with a bid/ask spread higher than 0.4%.

The addPairs function will limit the number of active pairs to ten. Pairs that no longer meet the criteria after being in the configuration for over an hour are removed automatically. Pairs with a balance worth more than 'min volume to sell' are not removed.

{
"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",
"max": 0.4
}
},
"schedule": "*/15 * * * *",
"type": "removePairs",
"enabled": true,
"resume": true,
"debug": true
}
}

Add uptrending BTC and USDT pairs

This example automatically manages the addition and removal of trending BTC and USD pairs on Binance, while excluding low sat pairs and those with a bid/ask spread higher than 0.4%. It prevents crossover problems, like trading both USDT-BTC and BTC-ETH.

This example makes extensive use of ticker data filters to determine the pairs recent behavior.

The addPairs function will limit the number of active pairs to ten. Pairs that no longer meet the criteria after being in the configuration for over an hour are removed automatically. 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",
"min": 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",
"min": 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 sets the gain target to 2 when EMA 1 is higher than EMA 2, and to 1 when EMA 1 is below EMA 2. The custom filter always passes, it's there because this job does not require any filter conditions.

{
"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 shows how you can use custom code on various places in the job. Use a javascript minifier to convert your readable code into minified code required for AutoConfig.

{
"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
}
}