Skip to main content

Dynamic jobs with custom code

AutoConfig allows for completely dynamic scenarios for power users by calculating many elements at the time of execution. With AutoConfig's custom code feature, you can use every valid JavaScript expression to create calculated values for overrides, variables, pairVariables, maxPairs, and target in filter type custom. This allows for incredible automation scenarios.

Access internal data in your expressions with the following references:

this.configThe complete configuration
this.pairAll pair data the bot works with, the same as available in JSON state files
this.pairNameString of the pair currently processing
this.variablesAll AutoConfig variables
this.pairVariablesAll AutoConfig pair variables
this.tickersAll collected ticker snapshots, in case it's ran in a job type that works with tickers.
this.userDataUser defined contents in Gunbot root folder.

Unleash the power of automated trading with AutoConfig's custom code feature. Here are some examples of valid expressions:

" this.pair.Bid * this.pair.quoteBalance"
// returns notional bag size

" (this.pair.Bid * this.pair.quoteBalance) > this.pair.whatstrat.MIN_VOLUME_TO_SELL ? true : false"
// returns true when there is a bag to sell

" (function doThings(data) {
if (data.pair.Bid > 0){
return true
else {
return false
})(this)" ---> this example executes a function