cancelActiveOrderPeriodic method

void cancelActiveOrderPeriodic({
  1. required String symbol,
  2. String? orderId,
  3. String? orderLinkId,
  4. required Duration period,
})

Cancel active order periodically. Note that either orderId or orderLinkId are required https://bybit-exchange.github.io/docs/inverse/#t-cancelactive

Implementation

void cancelActiveOrderPeriodic(
    {required String symbol,
    String? orderId,
    String? orderLinkId,
    required Duration period}) {
  log.d('ByBitRest.cancelActiveOrderPeriodic');
  streamGroup!.add(Stream.periodic(period, (_) {
    return cancelActiveOrder(
        symbol: symbol, orderId: orderId, orderLinkId: orderLinkId);
  }).asyncMap((event) async => await event));
}