Skip to content

Commit fd5468a

Browse files
author
BrillliantZ
committed
change on_quote to on_bar
1 parent 760994a commit fd5468a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎samples/calendar_spread.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def init_from_config(self, props):
5757
```
5858

5959
##### 3. 策略实现
60-
策略的主体部分在on_quote()函数中实现。因为我们选择每日调仓,所以会在每天调用on_quote()函数。
60+
策略的主体部分在on_bar()函数中实现。因为我们选择每日调仓,所以会在每天调用on_bar()函数。
6161
首先将两个合约的quote放入self.quote1和self.quote2中,并计算当天的spread
6262
```python
6363
q1 = quote_dic.get(self.s1)

‎samples/dual_thrust.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def initialize(self):
9797
self.low_list[-1] = df.low
9898
```
9999

100-
策略的主体部分在on_quote()函数中实现。因为我们选择分钟级回测,所以会在每分钟调用on_quote()函数。
100+
策略的主体部分在on_bar()函数中实现。因为我们选择分钟级回测,所以会在每分钟调用on_bar()函数。
101101

102102
首先取到当日的quote,并计算过去$N$天的HH,HC,LC和LL,并据此计算Range和上下限Upper,Lower
103103
```python

0 commit comments

Comments
 (0)