Skip to content

Commit ac932ae

Browse files
committed
Fixed a bug related to transaction volume.
Signed-off-by: TIANHE <TIANHE@GMAIL.COM>
1 parent 63f0b11 commit ac932ae

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

quantdinger_vue/src/views/indicator-analysis/components/KlineChart.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,7 +1830,7 @@ registerOverlay({
18301830
// - high: 取最大值(时间段内的最高价)
18311831
// - low: 取最小值(时间段内的最低价)
18321832
// - close: 更新为最新价格(当前价格)
1833-
// - volume: 累加(时间段内的总成交量
1833+
// - volume: 使用API返回的最新值(API返回的已是该周期的总成交量,无需累加
18341834
const existingLast = existingData[existingData.length - 1]
18351835
const newLast = newData[newData.length - 1]
18361836
@@ -1840,7 +1840,7 @@ registerOverlay({
18401840
high: Math.max(existingLast.high, newLast.high), // 最高价取最大值
18411841
low: Math.min(existingLast.low, newLast.low), // 最低价取最小值
18421842
close: newLast.close, // 收盘价更新为最新价格
1843-
volume: existingLast.volume + newLast.volume // 成交量累加
1843+
volume: newLast.volume // 成交量使用API返回的最新值(已是该周期的总成交量)
18441844
}
18451845
klineData.value = existingData
18461846

0 commit comments

Comments
 (0)