Merge branch 'master' of https://github.com/fasiondog/hikyuu into release

This commit is contained in:
fasiondog 2024-09-24 12:11:30 +08:00
commit e91439b9b5
9 changed files with 97 additions and 93 deletions

View File

@ -50,4 +50,4 @@ jobs:
- name: build
run: |
xmake -bvD core
xmake -b core

View File

@ -177,14 +177,14 @@ std::pair<double, SYSPtr> HKU_API findOptimalSystemMulti(const SystemList& sys_l
});
if (0 == sort_mode) {
for (auto& v : all_result) {
for (const auto& v : all_result) {
if (v.first > result.first) {
result.first = v.first;
result.second = v.second;
}
}
} else {
for (auto& v : all_result) {
for (const auto& v : all_result) {
if (v.first < result.first) {
result.first = v.first;
result.second = v.second;

View File

@ -94,48 +94,48 @@ public:
* @param stock
* @return true | false
*/
virtual bool haveShort(const Stock& stock) const {
virtual bool haveShort(const Stock& stock) const override {
HKU_WARN("The subclass does not implement this method");
return false;
}
/** 当前持有的证券种类数量 */
virtual size_t getStockNumber() const {
virtual size_t getStockNumber() const override {
return m_position.size();
}
/** 当前空头持有的证券种类数量 */
virtual size_t getShortStockNumber() const {
virtual size_t getShortStockNumber() const override {
HKU_WARN("The subclass does not implement this method");
return 0;
}
/** 获取指定时刻的某证券持有数量 */
virtual double getHoldNumber(const Datetime& datetime, const Stock& stock) {
virtual double getHoldNumber(const Datetime& datetime, const Stock& stock) override {
HKU_WARN("The subclass does not implement this method");
return 0.0;
}
/** 获取指定时刻的空头某证券持有数量 */
virtual double getShortHoldNumber(const Datetime& datetime, const Stock& stock) {
virtual double getShortHoldNumber(const Datetime& datetime, const Stock& stock) override {
HKU_WARN("The subclass does not implement this method");
return 0.0;
}
/** 获取指定时刻已借入的股票数量 */
virtual double getDebtNumber(const Datetime& datetime, const Stock& stock) {
virtual double getDebtNumber(const Datetime& datetime, const Stock& stock) override {
HKU_WARN("The subclass does not implement this method");
return 0.0;
}
/** 获取指定时刻已借入的现金额 */
virtual price_t getDebtCash(const Datetime& datetime) {
virtual price_t getDebtCash(const Datetime& datetime) override {
HKU_WARN("The subclass does not implement this method");
return 0.0;
}
/** 获取全部交易记录 */
virtual TradeRecordList getTradeList() const {
virtual TradeRecordList getTradeList() const override {
HKU_WARN("The subclass does not implement this method");
return TradeRecordList();
}
@ -146,7 +146,8 @@ public:
* @param end
* @return
*/
virtual TradeRecordList getTradeList(const Datetime& start, const Datetime& end) const {
virtual TradeRecordList getTradeList(const Datetime& start,
const Datetime& end) const override {
HKU_WARN("The subclass does not implement this method");
return TradeRecordList();
}
@ -155,19 +156,19 @@ public:
virtual PositionRecordList getPositionList() const override;
/** 获取全部历史持仓记录,即已平仓记录 */
virtual PositionRecordList getHistoryPositionList() const {
virtual PositionRecordList getHistoryPositionList() const override {
HKU_WARN("The subclass does not implement this method");
return PositionRecordList();
}
/** 获取当前全部空头仓位记录 */
virtual PositionRecordList getShortPositionList() const {
virtual PositionRecordList getShortPositionList() const override {
HKU_WARN("The subclass does not implement this method");
return PositionRecordList();
}
/** 获取全部空头历史仓位记录 */
virtual PositionRecordList getShortHistoryPositionList() const {
virtual PositionRecordList getShortHistoryPositionList() const override {
HKU_WARN("The subclass does not implement this method");
return PositionRecordList();
}
@ -183,13 +184,13 @@ public:
*
* @param stock
*/
virtual PositionRecord getShortPosition(const Stock& stock) const {
virtual PositionRecord getShortPosition(const Stock& stock) const override {
HKU_WARN("The subclass does not implement this method");
return PositionRecord();
}
/** 获取当前借入的股票列表 */
virtual BorrowRecordList getBorrowStockList() const {
virtual BorrowRecordList getBorrowStockList() const override {
HKU_WARN("The subclass does not implement this method");
return BorrowRecordList();
}
@ -222,7 +223,7 @@ public:
* @return true | false
*/
virtual bool checkinStock(const Datetime& datetime, const Stock& stock, price_t price,
double number) {
double number) override {
HKU_WARN("The subclass does not implement this method");
return false;
}
@ -237,7 +238,7 @@ public:
* @note
*/
virtual bool checkoutStock(const Datetime& datetime, const Stock& stock, price_t price,
double number) {
double number) override {
HKU_WARN("The subclass does not implement this method");
return false;
}
@ -289,7 +290,8 @@ public:
*/
virtual TradeRecord sellShort(const Datetime& datetime, const Stock& stock, price_t realPrice,
double number, price_t stoploss = 0.0, price_t goalPrice = 0.0,
price_t planPrice = 0.0, SystemPart from = PART_INVALID) {
price_t planPrice = 0.0,
SystemPart from = PART_INVALID) override {
HKU_WARN("The subclass does not implement this method");
return TradeRecord();
}
@ -309,7 +311,7 @@ public:
virtual TradeRecord buyShort(const Datetime& datetime, const Stock& stock, price_t realPrice,
double number = MAX_DOUBLE, price_t stoploss = 0.0,
price_t goalPrice = 0.0, price_t planPrice = 0.0,
SystemPart from = PART_INVALID) {
SystemPart from = PART_INVALID) override {
HKU_WARN("The subclass does not implement this method");
return TradeRecord();
}
@ -320,7 +322,7 @@ public:
* @param cash
* @return true | false
*/
virtual bool borrowCash(const Datetime& datetime, price_t cash) {
virtual bool borrowCash(const Datetime& datetime, price_t cash) override {
HKU_WARN("The subclass does not implement this method");
return false;
}
@ -331,7 +333,7 @@ public:
* @param cash
* @return true | false
*/
virtual bool returnCash(const Datetime& datetime, price_t cash) {
virtual bool returnCash(const Datetime& datetime, price_t cash) override {
HKU_WARN("The subclass does not implement this method");
return false;
}
@ -345,7 +347,7 @@ public:
* @return true | false
*/
virtual bool borrowStock(const Datetime& datetime, const Stock& stock, price_t price,
double number) {
double number) override {
HKU_WARN("The subclass does not implement this method");
return false;
}
@ -359,7 +361,7 @@ public:
* @return true | false
*/
virtual bool returnStock(const Datetime& datetime, const Stock& stock, price_t price,
double number) {
double number) override {
HKU_WARN("The subclass does not implement this method");
return false;
}
@ -387,7 +389,7 @@ public:
* @param tr
* @return bool true | false
*/
virtual bool addTradeRecord(const TradeRecord& tr) {
virtual bool addTradeRecord(const TradeRecord& tr) override {
HKU_WARN("The subclass does not implement this method");
return false;
}
@ -398,7 +400,7 @@ public:
* @return true
* @return false
*/
virtual bool addPosition(const PositionRecord& pr) {
virtual bool addPosition(const PositionRecord& pr) override {
HKU_WARN("The subclass does not implement this method");
return false;
}
@ -410,7 +412,7 @@ public:
* csv格式输出交易记录线
* @param path
*/
virtual void tocsv(const string& path) {
virtual void tocsv(const string& path) override {
HKU_WARN("The subclass does not implement this method");
}

View File

@ -197,7 +197,7 @@ public:
* @param ktype K线类型KQuery::DAY
* @return
*/
FundsList getFundsList(const DatetimeList& dates, KQuery::KType ktype = KQuery::DAY) {
FundsList getFundsList(const DatetimeList& dates, const KQuery::KType& ktype = KQuery::DAY) {
size_t total = dates.size();
FundsList result(total);
HKU_IF_RETURN(total == 0, result);
@ -213,7 +213,7 @@ public:
* @param ktype K线类型KQuery::DAY
* @return
*/
PriceList getFundsCurve(const DatetimeList& dates, KQuery::KType ktype = KQuery::DAY) {
PriceList getFundsCurve(const DatetimeList& dates, const KQuery::KType& ktype = KQuery::DAY) {
FundsList funds_list = getFundsList(dates, ktype);
PriceList ret(funds_list.size());
int precision = getParam<int>("precision");
@ -229,7 +229,7 @@ public:
* @param ktype K线类型KQuery::DAY
* @return 线
*/
PriceList getProfitCurve(const DatetimeList& dates, KQuery::KType ktype = KQuery::DAY) {
PriceList getProfitCurve(const DatetimeList& dates, const KQuery::KType& ktype = KQuery::DAY) {
FundsList funds_list = getFundsList(dates, ktype);
PriceList ret(funds_list.size());
int precision = getParam<int>("precision");
@ -246,7 +246,7 @@ public:
* @return 线
*/
PriceList getProfitCumChangeCurve(const DatetimeList& dates,
KQuery::KType ktype = KQuery::DAY) {
const KQuery::KType& ktype = KQuery::DAY) {
FundsList funds_list = getFundsList(dates, ktype);
PriceList ret(funds_list.size());
for (size_t i = 0, total = funds_list.size(); i < total; i++) {
@ -261,7 +261,8 @@ public:
* @param ktype K线类型KQuery::DAY
* @return 线
*/
PriceList getBaseAssetsCurve(const DatetimeList& dates, KQuery::KType ktype = KQuery::DAY) {
PriceList getBaseAssetsCurve(const DatetimeList& dates,
const KQuery::KType& ktype = KQuery::DAY) {
FundsList funds_list = getFundsList(dates, ktype);
PriceList ret(funds_list.size());
for (size_t i = 0, total = funds_list.size(); i < total; i++) {

View File

@ -180,10 +180,10 @@ typedef shared_ptr<ConditionBase> CNPtr;
#define CONDITION_IMP(classname) \
public: \
virtual ConditionPtr _clone() { \
virtual ConditionPtr _clone() override { \
return std::make_shared<classname>(); \
} \
virtual void _calculate();
virtual void _calculate() override;
HKU_API std::ostream& operator<<(std::ostream&, const ConditionPtr&);
HKU_API std::ostream& operator<<(std::ostream&, const ConditionBase&);

View File

@ -151,12 +151,12 @@ private: \
typedef shared_ptr<EnvironmentBase> EnvironmentPtr;
typedef shared_ptr<EnvironmentBase> EVPtr;
#define ENVIRONMENT_IMP(classname) \
public: \
virtual EnvironmentPtr _clone() { \
return std::make_shared<classname>(); \
} \
virtual void _calculate();
#define ENVIRONMENT_IMP(classname) \
public: \
virtual EnvironmentPtr _clone() override { \
return std::make_shared<classname>(); \
} \
virtual void _calculate() override;
/**
* Environment信息Environment(name, params[...])

View File

@ -122,7 +122,7 @@ void Portfolio::_readyForRun() {
#pragma GCC diagnostic ignored "-Wunused-variable"
#endif
try {
OptimalSelectorBase* _ = dynamic_cast<OptimalSelectorBase*>(m_se.get());
OptimalSelectorBase const* _ = dynamic_cast<OptimalSelectorBase*>(m_se.get());
HKU_THROW("Can't use is OptimalSelectorBase type m_se in PF!");
} catch (...) {
// do nothing

View File

@ -52,7 +52,7 @@ WalkForwardSystem::WalkForwardSystem(const SystemList& candidate_sys_list, const
#pragma GCC diagnostic ignored "-Wunused-variable"
#endif
try {
OptimalSelectorBase* _ = dynamic_cast<OptimalSelectorBase*>(se.get());
OptimalSelectorBase const* _ = dynamic_cast<OptimalSelectorBase*>(se.get());
} catch (...) {
CLS_THROW("Only the OptimalSelectorBase type is accepted!");
}
@ -192,7 +192,7 @@ void WalkForwardSystem::run(const KData& kdata, bool reset, bool resetAll) {
readyForRun();
OptimalSelectorBase* se_ptr = dynamic_cast<OptimalSelectorBase*>(m_se.get());
const auto& m_run_ranges = se_ptr->getRunRanges();
m_run_ranges = se_ptr->getRunRanges();
size_t run_ranges_len = m_run_ranges.size();
HKU_IF_RETURN(run_ranges_len == 0, void());
@ -200,8 +200,6 @@ void WalkForwardSystem::run(const KData& kdata, bool reset, bool resetAll) {
const Stock& stock = kdata.getStock();
for (size_t i = 0; i < run_ranges_len; i++) {
KQuery range_query = KQueryByDate(m_run_ranges[i].run_start, m_run_ranges[i].end,
query.kType(), query.recoverType());
m_train_kdata_list.emplace_back(stock.getKData(KQueryByDate(
m_run_ranges[i].start, m_run_ranges[i].end, query.kType(), query.recoverType())));
}
@ -267,7 +265,7 @@ TradeRecord WalkForwardSystem::runMoment(const Datetime& datetime) {
auto sw_list = m_se->getSelected(datetime);
HKU_IF_RETURN(sw_list.empty(), ret);
auto& sys = sw_list.front().sys;
const auto& sys = sw_list.front().sys;
if (sys && sys != m_cur_sys) {
m_cur_kdata++;
if (m_cur_kdata < m_train_kdata_list.size()) {

View File

@ -26,11 +26,11 @@ public:
virtual ~WalkForwardTradeManager() {}
virtual void _reset() {
virtual void _reset() override {
m_tm->_reset();
}
virtual shared_ptr<TradeManagerBase> _clone() {
virtual shared_ptr<TradeManagerBase> _clone() override {
WalkForwardTradeManager* p = new WalkForwardTradeManager();
p->m_tm = m_tm->clone();
p->m_run_start = m_run_start;
@ -42,7 +42,7 @@ public:
* @note
* @param datetime
*/
virtual void updateWithWeight(const Datetime& datetime) {
virtual void updateWithWeight(const Datetime& datetime) override {
m_tm->updateWithWeight(datetime);
}
@ -51,27 +51,27 @@ public:
* @param datetime
* @param stock
*/
virtual double getMarginRate(const Datetime& datetime, const Stock& stock) {
virtual double getMarginRate(const Datetime& datetime, const Stock& stock) override {
return (datetime >= m_run_start) ? m_tm->getMarginRate(datetime, stock) : 0.0;
}
/** 初始资金 */
virtual price_t initCash() const {
virtual price_t initCash() const override {
return m_tm->initCash();
}
/** 账户建立日期 */
virtual Datetime initDatetime() const {
virtual Datetime initDatetime() const override {
return m_tm->initDatetime();
}
/** 第一笔买入交易发生日期如未发生交易返回Null<Datetime>() */
virtual Datetime firstDatetime() const {
virtual Datetime firstDatetime() const override {
return m_tm->firstDatetime();
}
/** 最后一笔交易日期,注意和交易类型无关,如未发生交易返回账户建立日期 */
virtual Datetime lastDatetime() const {
virtual Datetime lastDatetime() const override {
return m_tm->lastDatetime();
}
@ -79,7 +79,7 @@ public:
*
* @note
*/
virtual price_t currentCash() const {
virtual price_t currentCash() const override {
return m_tm->currentCash();
}
@ -87,7 +87,7 @@ public:
*
* @note
*/
virtual price_t cash(const Datetime& datetime, KQuery::KType ktype = KQuery::DAY) {
virtual price_t cash(const Datetime& datetime, KQuery::KType ktype = KQuery::DAY) override {
return m_tm->cash(datetime, ktype);
}
@ -97,7 +97,7 @@ public:
* @param stock
* @return true | false
*/
virtual bool have(const Stock& stock) const {
virtual bool have(const Stock& stock) const override {
return m_tm->have(stock);
}
@ -107,42 +107,42 @@ public:
* @param stock
* @return true | false
*/
virtual bool haveShort(const Stock& stock) const {
virtual bool haveShort(const Stock& stock) const override {
return m_tm->haveShort(stock);
}
/** 当前持有的证券种类数量 */
virtual size_t getStockNumber() const {
virtual size_t getStockNumber() const override {
return m_tm->getStockNumber();
}
/** 当前空头持有的证券种类数量 */
virtual size_t getShortStockNumber() const {
virtual size_t getShortStockNumber() const override {
return m_tm->getShortStockNumber();
}
/** 获取指定时刻的某证券持有数量 */
virtual double getHoldNumber(const Datetime& datetime, const Stock& stock) {
virtual double getHoldNumber(const Datetime& datetime, const Stock& stock) override {
return m_tm->getHoldNumber(datetime, stock);
}
/** 获取指定时刻的空头某证券持有数量 */
virtual double getShortHoldNumber(const Datetime& datetime, const Stock& stock) {
virtual double getShortHoldNumber(const Datetime& datetime, const Stock& stock) override {
return m_tm->getShortHoldNumber(datetime, stock);
}
/** 获取指定时刻已借入的股票数量 */
virtual double getDebtNumber(const Datetime& datetime, const Stock& stock) {
virtual double getDebtNumber(const Datetime& datetime, const Stock& stock) override {
return m_tm->getDebtNumber(datetime, stock);
}
/** 获取指定时刻已借入的现金额 */
virtual price_t getDebtCash(const Datetime& datetime) {
virtual price_t getDebtCash(const Datetime& datetime) override {
return m_tm->getDebtCash(datetime);
}
/** 获取全部交易记录 */
virtual TradeRecordList getTradeList() const {
virtual TradeRecordList getTradeList() const override {
return m_tm->getTradeList();
}
@ -152,27 +152,28 @@ public:
* @param end
* @return
*/
virtual TradeRecordList getTradeList(const Datetime& start, const Datetime& end) const {
virtual TradeRecordList getTradeList(const Datetime& start,
const Datetime& end) const override {
return m_tm->getTradeList(start, end);
}
/** 获取当前全部持仓记录 */
virtual PositionRecordList getPositionList() const {
virtual PositionRecordList getPositionList() const override {
return m_tm->getPositionList();
}
/** 获取全部历史持仓记录,即已平仓记录 */
virtual PositionRecordList getHistoryPositionList() const {
virtual PositionRecordList getHistoryPositionList() const override {
return m_tm->getHistoryPositionList();
}
/** 获取当前全部空头仓位记录 */
virtual PositionRecordList getShortPositionList() const {
virtual PositionRecordList getShortPositionList() const override {
return m_tm->getShortPositionList();
}
/** 获取全部空头历史仓位记录 */
virtual PositionRecordList getShortHistoryPositionList() const {
virtual PositionRecordList getShortHistoryPositionList() const override {
return m_tm->getShortHistoryPositionList();
}
@ -181,7 +182,7 @@ public:
* @param date
* @param stock
*/
virtual PositionRecord getPosition(const Datetime& date, const Stock& stock) {
virtual PositionRecord getPosition(const Datetime& date, const Stock& stock) override {
return m_tm->getPosition(date, stock);
}
@ -189,12 +190,12 @@ public:
*
* @param stock
*/
virtual PositionRecord getShortPosition(const Stock& stock) const {
virtual PositionRecord getShortPosition(const Stock& stock) const override {
return m_tm->getShortPosition(stock);
}
/** 获取当前借入的股票列表 */
virtual BorrowRecordList getBorrowStockList() const {
virtual BorrowRecordList getBorrowStockList() const override {
return m_tm->getBorrowStockList();
}
@ -204,7 +205,7 @@ public:
* @param cash
* @return true | false
*/
virtual bool checkin(const Datetime& datetime, price_t cash) {
virtual bool checkin(const Datetime& datetime, price_t cash) override {
return (datetime >= m_run_start) ? m_tm->checkin(datetime, cash) : false;
}
@ -214,7 +215,7 @@ public:
* @param cash
* @return true | false
*/
virtual bool checkout(const Datetime& datetime, price_t cash) {
virtual bool checkout(const Datetime& datetime, price_t cash) override {
return (datetime >= m_run_start) ? m_tm->checkout(datetime, cash) : false;
}
@ -227,7 +228,7 @@ public:
* @return true | false
*/
virtual bool checkinStock(const Datetime& datetime, const Stock& stock, price_t price,
double number) {
double number) override {
return (datetime >= m_run_start) ? m_tm->checkinStock(datetime, stock, price, number)
: false;
}
@ -242,7 +243,7 @@ public:
* @note
*/
virtual bool checkoutStock(const Datetime& datetime, const Stock& stock, price_t price,
double number) {
double number) override {
return (datetime >= m_run_start) ? m_tm->checkoutStock(datetime, stock, price, number)
: false;
}
@ -261,7 +262,7 @@ public:
*/
virtual TradeRecord buy(const Datetime& datetime, const Stock& stock, price_t realPrice,
double number, price_t stoploss = 0.0, price_t goalPrice = 0.0,
price_t planPrice = 0.0, SystemPart from = PART_INVALID) {
price_t planPrice = 0.0, SystemPart from = PART_INVALID) override {
return (datetime >= m_run_start) ? m_tm->buy(datetime, stock, realPrice, number, stoploss,
goalPrice, planPrice, from)
: TradeRecord();
@ -282,7 +283,7 @@ public:
virtual TradeRecord sell(const Datetime& datetime, const Stock& stock, price_t realPrice,
double number = MAX_DOUBLE, price_t stoploss = 0.0,
price_t goalPrice = 0.0, price_t planPrice = 0.0,
SystemPart from = PART_INVALID) {
SystemPart from = PART_INVALID) override {
return (datetime >= m_run_start) ? m_tm->sell(datetime, stock, realPrice, number, stoploss,
goalPrice, planPrice, from)
: TradeRecord();
@ -302,7 +303,8 @@ public:
*/
virtual TradeRecord sellShort(const Datetime& datetime, const Stock& stock, price_t realPrice,
double number, price_t stoploss = 0.0, price_t goalPrice = 0.0,
price_t planPrice = 0.0, SystemPart from = PART_INVALID) {
price_t planPrice = 0.0,
SystemPart from = PART_INVALID) override {
return (datetime >= m_run_start) ? m_tm->sellShort(datetime, stock, realPrice, number,
stoploss, goalPrice, planPrice, from)
: TradeRecord();
@ -323,7 +325,7 @@ public:
virtual TradeRecord buyShort(const Datetime& datetime, const Stock& stock, price_t realPrice,
double number = MAX_DOUBLE, price_t stoploss = 0.0,
price_t goalPrice = 0.0, price_t planPrice = 0.0,
SystemPart from = PART_INVALID) {
SystemPart from = PART_INVALID) override {
return (datetime >= m_run_start) ? m_tm->buyShort(datetime, stock, realPrice, number,
stoploss, goalPrice, planPrice, from)
: TradeRecord();
@ -335,7 +337,7 @@ public:
* @param cash
* @return true | false
*/
virtual bool borrowCash(const Datetime& datetime, price_t cash) {
virtual bool borrowCash(const Datetime& datetime, price_t cash) override {
return (datetime >= m_run_start) ? m_tm->borrowCash(datetime, cash) : false;
}
@ -345,7 +347,7 @@ public:
* @param cash
* @return true | false
*/
virtual bool returnCash(const Datetime& datetime, price_t cash) {
virtual bool returnCash(const Datetime& datetime, price_t cash) override {
return (datetime >= m_run_start) ? m_tm->returnCash(datetime, cash) : false;
}
@ -358,7 +360,7 @@ public:
* @return true | false
*/
virtual bool borrowStock(const Datetime& datetime, const Stock& stock, price_t price,
double number) {
double number) override {
return (datetime >= m_run_start) ? m_tm->borrowStock(datetime, stock, price, number)
: false;
}
@ -372,7 +374,7 @@ public:
* @return true | false
*/
virtual bool returnStock(const Datetime& datetime, const Stock& stock, price_t price,
double number) {
double number) override {
return (datetime >= m_run_start) ? m_tm->returnStock(datetime, stock, price, number)
: false;
}
@ -382,7 +384,7 @@ public:
* @param ktype
* @return
*/
virtual FundsRecord getFunds(KQuery::KType ktype = KQuery::DAY) const {
virtual FundsRecord getFunds(KQuery::KType ktype = KQuery::DAY) const override {
return m_tm->getFunds(ktype);
}
@ -393,7 +395,8 @@ public:
* @return
* @note datetime等于Null<Datetime>()getFunds(KType)
*/
virtual FundsRecord getFunds(const Datetime& datetime, KQuery::KType ktype = KQuery::DAY) {
virtual FundsRecord getFunds(const Datetime& datetime,
KQuery::KType ktype = KQuery::DAY) override {
return m_tm->getFunds(datetime, ktype);
}
@ -403,7 +406,7 @@ public:
* @param tr
* @return bool true | false
*/
virtual bool addTradeRecord(const TradeRecord& tr) {
virtual bool addTradeRecord(const TradeRecord& tr) override {
return (tr.datetime >= m_run_start) ? m_tm->addTradeRecord(tr) : false;
}
@ -413,12 +416,12 @@ public:
* @return true
* @return false
*/
virtual bool addPosition(const PositionRecord& pr) {
virtual bool addPosition(const PositionRecord& pr) override {
return m_tm->addPosition(pr);
}
/** 字符串输出 */
virtual string str() const {
virtual string str() const override {
return m_tm->str();
}
@ -426,7 +429,7 @@ public:
* csv格式输出交易记录线
* @param path
*/
virtual void tocsv(const string& path) {
virtual void tocsv(const string& path) override {
m_tm->tocsv(path);
}
@ -434,7 +437,7 @@ public:
*
* @param broker
*/
virtual void fetchAssetInfoFromBroker(const OrderBrokerPtr& broker) {
virtual void fetchAssetInfoFromBroker(const OrderBrokerPtr& broker) override {
m_tm->fetchAssetInfoFromBroker(broker);
}