getLongShortRatioPeriodic method

void getLongShortRatioPeriodic({
  1. required String symbol,
  2. required String interval,
  3. int? limit,
  4. required Duration period,
})

Gets the Bybit user accounts' long-short ratio periodically

period must be one of the followin strings : '5min', '15min', '30min', '1h', '4h', '1d' https://bybit-exchange.github.io/docs/inverse/#t-marketopeninterest

Implementation

void getLongShortRatioPeriodic(
    {required String symbol,
    required String interval,
    int? limit,
    required Duration period}) {
  log.d('ByBitRest.getLongShortRatioPeriodic');
  streamGroup!.add(Stream.periodic(period, (_) {
    return getLongShortRatio(
        symbol: symbol, interval: interval, limit: limit);
  }).asyncMap((event) async => await event));
}