Skip to content

Commit

Permalink
fix doc error
Browse files Browse the repository at this point in the history
  • Loading branch information
EricWang committed Feb 15, 2017
1 parent 1b0ff01 commit edc3ab0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/source/intro/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ RQAlpha 安装
运行如下命令::

$ cd examples
$ rqalpha run -f multi_rsi.py -s 2014-01-01 -e 2016-01-01 -o result.pkl --plot --progress -stock-starting-cash 100000
$ rqalpha run -f rsi.py -s 2014-01-01 -e 2016-01-01 -o result.pkl --plot --progress --stock-starting-cash 100000

等待回测结束后,将显示您的收益率和Risk。

Expand Down
6 changes: 3 additions & 3 deletions rqalpha/examples/buy_and_hold.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# 在这个方法中编写任何的初始化逻辑。context对象将会在你的算法策略的任何方法之间做传递。
def init(context):
print("init")
logger.info("init")
context.s1 = "000001.XSHE"
update_universe(context.s1)
# 是否已发送了order
Expand All @@ -10,14 +10,14 @@ def init(context):


def before_trading(context, bar_dict):
print("Before Trading", context.cnt)
logger.info("Before Trading", context.cnt)
context.cnt += 1


# 你选择的证券的数据更新将会触发此段逻辑,例如日或分钟历史数据切片或者是实时数据切片更新
def handle_bar(context, bar_dict):
context.cnt += 1
print("handle_bar", context.cnt)
logger.info("handle_bar", context.cnt)
# 开始编写你的主要的算法逻辑

# bar_dict[order_book_id] 可以拿到某个证券的bar信息
Expand Down

0 comments on commit edc3ab0

Please sign in to comment.