mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-11-30 02:48:57 +08:00
分钟级别行情更新时添加误差保护
This commit is contained in:
parent
e887383dbf
commit
8e119984ed
@ -162,9 +162,11 @@ static void updateStockMinData(const SpotRecord& spot, KQuery::KType ktype) {
|
||||
sum_volume += k.transCount;
|
||||
}
|
||||
|
||||
price_t amount = spot.amount > sum_amount ? spot.amount - sum_amount : spot.amount;
|
||||
price_t spot_volume = spot.volume * 100; // spot 传过来的是手数
|
||||
price_t volume = spot_volume > sum_volume ? spot_volume - sum_volume : spot_volume;
|
||||
price_t amount =
|
||||
spot.amount > sum_amount ? spot.amount - sum_amount : (sum_amount == 0.0 ? spot.amount : 0.0);
|
||||
price_t spot_volume = spot.volume * 100.; // spot 传过来的是手数
|
||||
price_t volume =
|
||||
spot_volume > sum_volume ? spot_volume - sum_volume : (sum_volume == 0.0 ? spot_volume : 0.0);
|
||||
KRecord krecord(end_minute, spot.open, spot.high, spot.low, spot.close, amount, volume);
|
||||
stk.realtimeUpdate(krecord, ktype);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user