mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-11-30 10:59:43 +08:00
Merge pull request #246 from fasiondog/feature/strategey
fixed strategy 加载权息失败
This commit is contained in:
commit
c7150847bf
@ -106,14 +106,14 @@ StockWeightList MySQLBaseInfoDriver::getStockWeightList(const string &market, co
|
||||
HKU_CHECK(con, "Failed fetch connect!");
|
||||
|
||||
vector<StockWeightTable> table;
|
||||
Datetime new_start = start.isNull() ? Datetime::min() : start;
|
||||
Datetime new_end = end.isNull() ? Datetime::max() : end;
|
||||
con->batchLoad(
|
||||
table,
|
||||
format(
|
||||
"stockid=(select stockid from stock where marketid=(select marketid from "
|
||||
"market where market='{}') and code='{}') and date>={} and date<{} order by date asc",
|
||||
market, code, start.year() * 10000 + start.month() * 100 + start.day(),
|
||||
new_end.year() * 10000 + new_end.month() * 100 + new_end.day()));
|
||||
market, code, new_start.ymd(), new_end.ymd()));
|
||||
|
||||
for (auto &w : table) {
|
||||
try {
|
||||
|
@ -127,14 +127,14 @@ StockWeightList SQLiteBaseInfoDriver::getStockWeightList(const string& market, c
|
||||
HKU_CHECK(con, "Failed fetch connect!");
|
||||
|
||||
vector<StockWeightTable> table;
|
||||
Datetime new_start = start.isNull() ? Datetime::min() : start;
|
||||
Datetime new_end = end.isNull() ? Datetime::max() : end;
|
||||
con->batchLoad(
|
||||
table,
|
||||
format(
|
||||
"stockid=(select stockid from stock where marketid=(select marketid from "
|
||||
"market where market='{}') and code='{}') and date>={} and date<{} order by date asc",
|
||||
market, code, start.year() * 10000 + start.month() * 100 + start.day(),
|
||||
new_end.year() * 10000 + new_end.month() * 100 + new_end.day()));
|
||||
market, code, new_start.ymd(), new_end.ymd()));
|
||||
|
||||
for (auto& w : table) {
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user