How I can calculate the trade volume of a time range from streaming data?

From this query
How I can calculate the trade volume of a time range from streaming data?

You do not need streaming API for that. A regular dextrade will do, the below query is an example for hourly trades, you can set the same for a different timeInterval

{
  ethereum(network: bsc) {
    dexTrades(
      options: {limit: 24, desc: "timeInterval.hour"}
      date: {since: "2023-01-03"}
      exchangeName: {is: "Pancake v2"}
      baseCurrency: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}
      quoteCurrency:{is:"0x55d398326f99059ff775485246999027b3197955"},
    ) {
      count
      tradeAmount(in: USD)
      timeInterval {
        hour(count: 1)
      }
      }
  }
}

This feature will be in the next reeease of streaming graphql