Available market and position data
Custom strategies can leverage all available pair data through unique property names. The list below contains pre-calculated indicators based on your strategy's settings. While some indicators use standard inputs without configurable parameters, others offer customization options.
Easily create custom trading strategies for Gunbot with this Visual Studio Code extension. There are pre-built snippets for all supported data points.
Property | Returns | Extra info |
---|---|---|
gb.data.config | object | Gunbot config.js contents |
gb.data.pairLedger | object | Contains the complete pair ledger. Can also be used to store and access your own persistent variables. Make sure to not overwrite existing properties. This has the same data as you see in the pair JSON files. Most items below come from the ledger too, they are renamed for consistency and already parsed as floating point numbers. |
gb.data.pairName | string | Current pair name, like USDT-BTC |
gb.data.exchangeName | string | Current exchange name, like binance |
gb.data.balances | object | Object with all balances on same exchange |
gb.data.quoteBalance | float | Pair quote balance, like BTC balance on an USDT-BTC pair Specific to spot trading |
gb.data.baseBalance | float | Base balance, like USDT balance on an USDT-BTC pair |
gb.data.onOrdersBalance | float | Quote balance value of open orders for current pair |
gb.data.openOrders | array | Open orders for current pair |
gb.data.orders | array | History of filled orders for current pair |
gb.data.orderbook | object | First 10 bid and ask entries in orderbook, price and volume |
gb.data.breakEven | float | Break even price for current spot holdings. Includes trading fees as defined in Gunbot exchange settings |
gb.data.gotBag | boolean | Indicates if value of quoteBalance for spot trading (including on orders volume) exceeds min volume to sell as defined in Gunbot strategy |
gb.data.leverage | float | Leverage of current futures position |
gb.data.walletBalance | float | Wallet balance. Specific to futures |
gb.data.availableMargin | float | Available margin balance. Specific to futures |
gb.data.maintenanceMargin | float | Maintenance margin requirement for futures account |
gb.data.maxNotionalValue | float | Max notional value for futures position at current leverage |
gb.data.totalPositionInitialMargin | float | Total initial position margin requirement for all current futures positions |
gb.data.totalOpenOrderInitialMargin | float | Total initial margin requirement for open futures orders |
gb.data.currentQty | float | Futures position size |
gb.data.currentSide | string | Indicates current futures position side |
gb.data.liquidationPrice | float | Futures position liquidation price |
gb.data.period | float | Candle size as set in Gunbot strategy PERIOD setting. This period is used for all pre calculated indicator values |
gb.data.bid | float | Highest bid price |
gb.data.ask | float | Lowest ask price |
gb.data.ema1 | float | Latest indicator value |
gb.data.ema2 | float | Latest indicator value |
gb.data.ema3 | float | Latest indicator value |
gb.data.BTCUSDprice | float | Latest BTC/USD price on same exchange (or equivalent spot pair, depending on availability) |
gb.data.mfi | float | Latest indicator value |
gb.data.rsi | float | Latest indicator value |
gb.data.lowBB | float | Latest indicator value |
gb.data.highBB | float | Latest indicator value |
gb.data.tenkan | float | Latest indicator value |
gb.data.chikou | float | Latest indicator value |
gb.data.kijun | float | Latest indicator value |
gb.data.senkouSpanA | float | Latest indicator value |
gb.data.senkouSpanB | float | Latest indicator value |
gb.data.fastSma | float | Latest indicator value |
gb.data.slowSma | float | Latest indicator value |
gb.data.R1 | float | Latest indicator value |
gb.data.S1 | float | Latest indicator value |
gb.data.R2 | float | Latest indicator value |
gb.data.S2 | float | Latest indicator value |
gb.data.macd | float | Latest indicator value |
gb.data.macdSignal | float | Latest indicator value |
gb.data.macdHistogram | float | Latest indicator value |
gb.data.stochK | float | Latest indicator value |
gb.data.stochD | float | Latest indicator value |
gb.data.stochRsi | float | Latest indicator value |
gb.data.atr | float | Latest indicator value |
gb.data.fib | object | Object with high and low Fibonacci retracement levels |
gb.data.vwma | float | Latest indicator value |
gb.data.diPlus | float | Latest indicator value |
gb.data.diMinus | float | Latest indicator value |
gb.data.adx | float | Latest indicator value |
gb.data.candlesOpen | array | Array of open values for OHLCV Sorted old to new (newest last) |
gb.data.candlesHigh | array | Array of high values for OHLCV Sorted old to new (newest last) |
gb.data.candlesLow | array | Array of low values for OHLCV Sorted old to new (newest last) |
gb.data.candlesClose | array | Array of close values for OHLCV Sorted old to new (newest last) |
gb.data.candlesVolume | array | Array of volume values for OHLCV Sorted old to new (newest last) |
gb.data.candlesTimestamp | array | Array of timestamp values for OHLCV Sorted old to new (newest last) |
gb.data.candles | object | Combined object with OHLCV data |