Tucsky / aggr

Cryptocurrency trades aggregator
https://charts.aggr.trade/
GNU General Public License v3.0
836 stars 241 forks source link

Candles not filling gaps anymore #203

Closed airborse closed 2 years ago

airborse commented 2 years ago

Came back from holidays, this doesn't work anymore on time &tick charts,

image

thanks a lot as always

I'm also using this as my price, if it matter

candlestick((BYBIT:BTCUSDT.open+BYBIT:BTCUSD.open+BITMEX:XBTUSD.open+OKEX:BTC-USDT-SWAP.open+BINANCE_FUTURES:btcusdt.open+ FTX:BTC-PERP.open)/6,

(BYBIT:BTCUSDT.high+BYBIT:BTCUSD.high+BITMEX:XBTUSD.high+OKEX:BTC-USDT-SWAP.high+BINANCE_FUTURES:btcusdt.high+ FTX:BTC-PERP.high)/6,

(BYBIT:BTCUSDT['low']+BYBIT:BTCUSD['low']+BITMEX:XBTUSD['low']+OKEX:BTC-USDT-SWAP['low']+BINANCE_FUTURES:btcusdt['low']+ FTX:BTC-PERP['low'])/6,

(BYBIT:BTCUSDT.close+BYBIT:BTCUSD.close+BITMEX:XBTUSD.close+OKEX:BTC-USDT-SWAP.close+BINANCE_FUTURES:btcusdt.close+ FTX:BTC-PERP.close)/6)

Tucsky commented 2 years ago

do you have any example on a chart? these market don't product much data gaps, all combined you have at least a trade every sec anyway if i set tf to like 100ms I do see them what timeframe did you use and expected to see data gap also tick chart don't have any, by design

airborse commented 2 years ago

sent u the template by email like I said I'm sure it was not on my end since It happened without me making any changes.

thanks a lot

Tucsky commented 2 years ago

You are talking about price gap, not time gap? That option image Only fill time gaps

This script

candlestick((BYBIT:BTCUSDT.open+BYBIT:BTCUSD.open+BITMEX:XBTUSD.open+OKEX:BTC-USDT-SWAP.open+BINANCE_FUTURES:btcusdt.open+ FTX:BTC-PERP.open)/6,

(BYBIT:BTCUSDT.high+BYBIT:BTCUSD.high+BITMEX:XBTUSD.high+OKEX:BTC-USDT-SWAP.high+BINANCE_FUTURES:btcusdt.high+ FTX:BTC-PERP.high)/6,

(BYBIT:BTCUSDT['low']+BYBIT:BTCUSD['low']+BITMEX:XBTUSD['low']+OKEX:BTC-USDT-SWAP['low']+BINANCE_FUTURES:btcusdt['low']+ FTX:BTC-PERP['low'])/6,

(BYBIT:BTCUSDT.close+BYBIT:BTCUSD.close+BITMEX:XBTUSD.close+OKEX:BTC-USDT-SWAP.close+BINANCE_FUTURES:btcusdt.close+ FTX:BTC-PERP.close)/6)

recalculate the open every candle, so price gaps WILL occur you should use avg_ohlc function which use last close for next open, will print a chart easier to look at but also considerer wrong (it's not the real open)


candlestick(avg_ohlc({
  localTimestamp: time,
  sources: {
  'BYBIT:BTCUSDT': BYBIT:BTCUSDT,
  'BYBIT:BTCUSD': BYBIT:BTCUSD,
  'BITMEX:XBTUSD': BITMEX:XBTUSD,
  'OKEX:BTC-USDT-SWAP': OKEX:BTC-USDT-SWAP,
  'BINANCE_FUTURES:btcusdt': BINANCE_FUTURES:btcusdt,
  'FTX:BTC-PERP': FTX:BTC-PERP
  }
}))
airborse commented 2 years ago

You are talking about price gap, not time gap? That option image Only fill time gaps

This script

candlestick((BYBIT:BTCUSDT.open+BYBIT:BTCUSD.open+BITMEX:XBTUSD.open+OKEX:BTC-USDT-SWAP.open+BINANCE_FUTURES:btcusdt.open+ FTX:BTC-PERP.open)/6,

(BYBIT:BTCUSDT.high+BYBIT:BTCUSD.high+BITMEX:XBTUSD.high+OKEX:BTC-USDT-SWAP.high+BINANCE_FUTURES:btcusdt.high+ FTX:BTC-PERP.high)/6,

(BYBIT:BTCUSDT['low']+BYBIT:BTCUSD['low']+BITMEX:XBTUSD['low']+OKEX:BTC-USDT-SWAP['low']+BINANCE_FUTURES:btcusdt['low']+ FTX:BTC-PERP['low'])/6,

(BYBIT:BTCUSDT.close+BYBIT:BTCUSD.close+BITMEX:XBTUSD.close+OKEX:BTC-USDT-SWAP.close+BINANCE_FUTURES:btcusdt.close+ FTX:BTC-PERP.close)/6)

recalculate the open every candle, so price gaps WILL occur you should use avg_ohlc function which use last close for next open, will print a chart easier to look at but also considerer wrong (it's not the real open)


candlestick(avg_ohlc({
  localTimestamp: time,
  sources: {
  'BYBIT:BTCUSDT': BYBIT:BTCUSDT,
  'BYBIT:BTCUSD': BYBIT:BTCUSD,
  'BITMEX:XBTUSD': BITMEX:XBTUSD,
  'OKEX:BTC-USDT-SWAP': OKEX:BTC-USDT-SWAP,
  'BINANCE_FUTURES:btcusdt': BINANCE_FUTURES:btcusdt,
  'FTX:BTC-PERP': FTX:BTC-PERP
  }
}))

Cool, thanks a lot :).