diff --git a/libs/hikyuu/trade_manage/TradeManager.cpp b/libs/hikyuu/trade_manage/TradeManager.cpp index fa63fcc3..35e97b4f 100644 --- a/libs/hikyuu/trade_manage/TradeManager.cpp +++ b/libs/hikyuu/trade_manage/TradeManager.cpp @@ -1777,6 +1777,9 @@ PriceList TradeManager ::getProfitCurve(const DatetimeList& dates, KQuery::KType ktype) { size_t total = dates.size(); PriceList result(total); + if (total == 0) + return result; + size_t i = 0; while (dates[i] < m_init_datetime && i < total) { result[i] = 0;