hikyuu2/hikyuu_cpp/hikyuu/StrategyContext.h

59 lines
1.3 KiB
C++
Raw Normal View History

2021-02-11 00:47:22 +08:00
/*
* Copyright(C) 2021 hikyuu.org
*
* Create on: 2021-02-10
* Author: fasiondog
*/
#pragma once
#include "DataType.h"
2021-02-19 01:12:50 +08:00
#include "KQuery.h"
2021-02-11 00:47:22 +08:00
namespace hku {
class HKU_API StrategyContext {
public:
2021-02-17 19:43:59 +08:00
StrategyContext() {}
2021-02-11 00:47:22 +08:00
StrategyContext(const StrategyContext&) = default;
2021-03-24 23:20:01 +08:00
explicit StrategyContext(const vector<string>& stockCodeList)
: m_stockCodeList(stockCodeList) {}
explicit StrategyContext(vector<string>&& stockCodeList)
: m_stockCodeList(std::move(stockCodeList)) {}
2021-02-17 19:43:59 +08:00
2021-02-11 00:47:22 +08:00
virtual ~StrategyContext() = default;
2021-02-19 01:12:50 +08:00
bool isAll() const;
2021-02-11 00:47:22 +08:00
Datetime startDatetime() const {
return m_startDatetime;
}
void startDatetime(const Datetime& d) {
m_startDatetime = d;
}
void setStockCodeList(vector<string>&& stockList) {
m_stockCodeList = std::move(stockList);
}
void setStockCodeList(const vector<string>& stockList);
const vector<string>& getStockCodeList() const {
return m_stockCodeList;
}
2021-02-19 01:12:50 +08:00
void setKTypeList(const vector<KQuery::KType>& ktypeList);
const vector<KQuery::KType>& getKTypeList() const {
return m_ktypeList;
}
2021-02-17 16:08:24 +08:00
2021-02-11 00:47:22 +08:00
private:
Datetime m_startDatetime;
vector<string> m_stockCodeList;
2021-02-19 01:12:50 +08:00
vector<KQuery::KType> m_ktypeList;
2021-02-11 00:47:22 +08:00
};
} // namespace hku