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:
Reference | Content |
---|---|
this.config | The complete configuration |
this.pair | All pair data the bot works with, the same as available in JSON state files |
this.pairName | String of the pair currently processing |
this.variables | All AutoConfig variables |
this.pairVariables | All AutoConfig pair variables |
this.tickers | All collected ticker snapshots, in case it's ran in a job type that works with tickers. |
this.userData | User 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