Volume traded for last N seconds (numeric value)

Please advise on how to create such a formula

Use the tradovate custom volum indicator api. Check if the candle is the last one and extract the volum from a given time.

hope this points you in the right direction

How to find the sum of an array of numbers.

or