diff --git a/src/chart/components/chart/candle.functions.ts b/src/chart/components/chart/candle.functions.ts index cb86993..03d6730 100644 --- a/src/chart/components/chart/candle.functions.ts +++ b/src/chart/components/chart/candle.functions.ts @@ -24,6 +24,7 @@ export const prepareCandle = (candle: PartialCandle): Candle | undefined => { const preparedCandleLo = finite(candle.lo, Math.min(candle.open, candle.close), settlementPrice); const preparedCandleOpen = finite(candle.open, candle.lo, settlementPrice); const preparedCandleClose = finite(candle.close, candle.hi, settlementPrice); + const preparedVwap = Number.isNaN(candle.vwap) ? undefined : candle.vwap; return { id: candle.id, hi: preparedCandleHi, @@ -35,6 +36,7 @@ export const prepareCandle = (candle: PartialCandle): Candle | undefined => { expansion: candle.expansion, idx: candle.idx, impVolatility: candle.impVolatility, + vwap: preparedVwap, }; } catch (e) { console.warn(e); @@ -45,6 +47,7 @@ export const prepareCandle = (candle: PartialCandle): Candle | undefined => { /** * Adds index to candles according to their array index. * @param candles + * @param startIdx {number} */ export const reindexCandles = (candles: Array, startIdx: number = 0) => { for (let i = startIdx; i < candles.length; ++i) {