Skip to content

Commit

Permalink
fixed update from sina
Browse files Browse the repository at this point in the history
  • Loading branch information
fasiondog committed Nov 4, 2020
1 parent 01e745f commit 8e3bd9e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
5 changes: 4 additions & 1 deletion hikyuu/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,10 @@ def UpdateOneRealtimeRecord_from_sina(tmpstr):
transamount = float(a[9])
transcount = float(a[8])
d = Datetime(a[-3] + " 00")
try:
d = Datetime(a[-3])
except:
d = Datetime(a[-4])
temp = (open, high, low, close)
if 0 in temp:
return
Expand Down
14 changes: 0 additions & 14 deletions hikyuu_cpp/hikyuu/Stock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,20 +525,6 @@ bool Stock::_getIndexRangeByDateFromBuffer(const KQuery& query, size_t& out_star
return true;
}

void Stock::_loadNewKRecordToBuffer(const KQuery& query) {
if (!m_data || m_data->pKData.find(query.kType()) == m_data->pKData.end()) {
return;
}

KQuery::KType ktype = query.kType();
KRecordList& buffer = *(m_data->pKData[ktype]);
if (buffer.empty()) {
return;
}

// auto& lastRecord = buffer.back();
}

KRecord Stock::getKRecord(size_t pos, KQuery::KType kType) const {
if (!m_data)
return Null<KRecord>();
Expand Down
2 changes: 0 additions & 2 deletions hikyuu_cpp/hikyuu/Stock.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,6 @@ class HKU_API Stock {
bool _getIndexRangeByIndex(const KQuery&, size_t& out_start, size_t& out_end) const;
bool _getIndexRangeByDateFromBuffer(const KQuery&, size_t&, size_t&) const;

void _loadNewKRecordToBuffer(const KQuery&);

private:
struct HKU_API Data;
shared_ptr<Data> m_data;
Expand Down

0 comments on commit 8e3bd9e

Please sign in to comment.