mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-12-02 11:58:21 +08:00
补充注释说明
This commit is contained in:
parent
d8731c94a0
commit
2008640875
@ -3,7 +3,7 @@
|
||||
# cp936
|
||||
|
||||
from hikyuu import Strategy, Query, Datetime, TimeDelta, Seconds, Minutes
|
||||
from hikyuu import StockManager
|
||||
from hikyuu import sm
|
||||
|
||||
|
||||
def on_change(stk, spot):
|
||||
@ -16,11 +16,11 @@ def on_spot(rev_time):
|
||||
|
||||
def my_func():
|
||||
print("calculate:", Datetime.now())
|
||||
sm = StockManager.instance()
|
||||
for s in sm:
|
||||
print(s)
|
||||
|
||||
|
||||
# 注意:每一个Strategy 只能作为独立进程执行,即 python xxx.py 的方式执行!
|
||||
# 以 Strategy 方式运行示例
|
||||
if __name__ == '__main__':
|
||||
s = Strategy(['sh600000', 'sz000001'], [Query.MIN, Query.DAY])
|
||||
|
@ -86,8 +86,6 @@ public:
|
||||
void runDailyAt(std::function<void()>&& func, const TimeDelta& delta,
|
||||
bool ignoreHoliday = true);
|
||||
|
||||
void start();
|
||||
|
||||
/**
|
||||
* 正确数据发生变化调用,即接收到相应行情数据变更
|
||||
* @note 通常用于调试
|
||||
@ -102,6 +100,11 @@ public:
|
||||
*/
|
||||
void onReceivedSpot(std::function<void(const Datetime&)>&& recievedFucn);
|
||||
|
||||
/**
|
||||
* 启动策略执行,必须在已注册相关处理函数后执行
|
||||
*/
|
||||
void start();
|
||||
|
||||
private:
|
||||
string m_name;
|
||||
string m_config_file;
|
||||
|
Loading…
Reference in New Issue
Block a user