saveNumberOfOpenTrades = async (logger, symbols) => {
  const openTradesSymbols = await mongo.aggregate(
    logger,
    'trailing-trade-symbols',
    [
      {
        $match: {
          key: {
            $regex: `(${symbols.join('|')})-last-buy-price`
          }
        }
      },
      {
        $project: {
          _id: 0,
          key: 1
        }
      }
    ]
  );

  const openTrades = _.map(openTradesSymbols, trade =>
    trade.key.replace('-last-buy-price', '')
  );

  await cache.hset(
    'trailing-trade-common',
    'open-trades-symbols',
    JSON.stringify(openTrades)
  );

  await cache.hset(
    'trailing-trade-common',
    'number-of-open-trades',
    openTrades.length
  );
}
Save number of active orders and list of symbols with active orders

@param {*} logger
@param {*} symbols