取消接收行情数据时的开闭市时间限制,有行情推送端自行控制

This commit is contained in:
fasiondog 2024-08-28 12:55:45 +08:00
parent ac67dd3b03
commit 3097c2b454

View File

@ -38,7 +38,7 @@ static string getSpotMarketCode(const SpotRecord& spot) {
static void updateStockDayData(const SpotRecord& spot) {
Stock stk = StockManager::instance().getStock(getSpotMarketCode(spot));
HKU_IF_RETURN(stk.isNull(), void());
HKU_IF_RETURN(!stk.isTransactionTime(spot.datetime), void());
// HKU_IF_RETURN(!stk.isTransactionTime(spot.datetime), void());
KRecord krecord(Datetime(spot.datetime.year(), spot.datetime.month(), spot.datetime.day()),
spot.open, spot.high, spot.low, spot.close, spot.amount, spot.volume);
stk.realtimeUpdate(krecord, KQuery::DAY);
@ -47,7 +47,7 @@ static void updateStockDayData(const SpotRecord& spot) {
static void updateStockDayUpData(const SpotRecord& spot, KQuery::KType ktype) {
Stock stk = StockManager::instance().getStock(getSpotMarketCode(spot));
HKU_IF_RETURN(stk.isNull(), void());
HKU_IF_RETURN(!stk.isTransactionTime(spot.datetime), void());
// HKU_IF_RETURN(!stk.isTransactionTime(spot.datetime), void());
std::function<Datetime(Datetime*)> endOfPhase;
std::function<Datetime(Datetime*)> startOfPhase;
@ -87,6 +87,8 @@ static void updateStockDayUpData(const SpotRecord& spot, KQuery::KType ktype) {
}
KRecord last_record = stk.getKRecord(total - 1, ktype);
HKU_IF_RETURN(!last_record.isValid(), void());
if (spot_end_of_phase > last_record.datetime) {
// 如果当前的日期大于最后记录的日期,则为新增数据,直接更新并返回
stk.realtimeUpdate(KRecord(spot_end_of_phase, spot.open, spot.high, spot.low, spot.close,
@ -119,7 +121,7 @@ static void updateStockDayUpData(const SpotRecord& spot, KQuery::KType ktype) {
static void updateStockMinData(const SpotRecord& spot, KQuery::KType ktype) {
Stock stk = StockManager::instance().getStock(getSpotMarketCode(spot));
HKU_IF_RETURN(stk.isNull(), void());
HKU_IF_RETURN(!stk.isTransactionTime(spot.datetime), void());
// HKU_IF_RETURN(!stk.isTransactionTime(spot.datetime), void());
TimeDelta gap;
if (KQuery::MIN == ktype) {