Calculates VWAP (Volume Weighted Average Price) for a symbol.
Uses the last 5 1-minute candles to calculate:
If volume is zero, returns simple average of close prices.
Trading pair symbol (e.g., "BTCUSDT")
Promise resolving to VWAP price
const vwap = await getAveragePrice("BTCUSDT");console.log(vwap); // 50125.43 Copy
const vwap = await getAveragePrice("BTCUSDT");console.log(vwap); // 50125.43
Calculates VWAP (Volume Weighted Average Price) for a symbol.
Uses the last 5 1-minute candles to calculate:
If volume is zero, returns simple average of close prices.