Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

现在plot不支持显示benchmark曲线了? #76

Closed
sloth2012 opened this issue Mar 30, 2017 · 5 comments
Closed

现在plot不支持显示benchmark曲线了? #76

sloth2012 opened this issue Mar 30, 2017 · 5 comments
Assignees

Comments

@sloth2012
Copy link

sloth2012 commented Mar 30, 2017

image
目前我参考源码,在jupyter notebook中实践了下,最后plot出来的结果只有上图这种,没有像之前https://www.zhihu.com/question/54593434中
image的另一条benchmark线,这个是现在屏蔽了吗?
补充 用的是2.0.2版本

@wh1100717
Copy link
Member

plot 没有屏蔽什么东西... 你能一下你的配置信息 或者启动参数 以及示例策略吗? 好帮助我们查询哪里出了问题。

@sloth2012
Copy link
Author

@wh1100717 源码的mod/rqalpha_mod_sys_analyser/plot.py中第51行, benchmark_portfolios = result_dict.get("benchmark_portfolios"),这个我发现result_dict里面没有传递这个数据,所有的源码遍历搜寻,也没发现几处相关的代码。
之前问题的提问源码如下:

from rqalpha import run
config = {
      "base": {
          "strategy_file": "/Users/lx/Programs/research/rqalpha/rqalpha/examples/buy_and_hold.py",
          "start_date": "2014-05-01",
          "end_date": "2014-12-01",
          "stock_starting_cash": 100000,
          "benchmark": "000300.XSHG",
      },
      "extra": {
          "log_level": "error",
      },
        "mod": {
            "sys_progress": {
                "enabled": False,
            },
            "sys_analyser": {
                "plot": True,
                "plot_save_file":"./plot"
            },
#       'tushare':{
#             "lib": 'rqalpha_mod_tushare',
#             "enabled": True,
#             "priority": 100,
#             }
    }
  }
result = run(config)

@wh1100717
Copy link
Member

@sloth2012 确实如您所说~ 这是个 2.0.0 重构产生的一个regression bug

@wh1100717 wh1100717 added the bug label Mar 31, 2017
@wh1100717
Copy link
Member

@sloth2012 已经修复,会在下一个小版本 release 时同时可用。

@sloth2012
Copy link
Author

@wh1100717 多谢哈、

@wh1100717 wh1100717 self-assigned this Apr 5, 2017
@wh1100717 wh1100717 added the fixed label Apr 5, 2017
shij10 pushed a commit to shij10/rqalpha that referenced this issue Apr 29, 2017
* release 2.0.0-beta

* update README

* disable register event for offline scripts

* add repr

* persist broker if need

* fix portfolio set_state

* update i18n

* add is_st_stock && is_suspended

* update i18n

* release 2.0.0

* fix broker persist

* remove duplicate option in .gitignore

* update setup.py

* add LIVE_TRADING

* do not copy; add LIVE_TRADING

* fix RunInfo

* fix dt

* 修改配置的读取方式,不再从~/.rqalpha/config.yml读取用户配置信息,而是默认从当前命令行读取config.yml,如果没有找到,则会读取系统默认配置信息。

* 1.	config 现在不再进行版本检查
2.	generate_config 现在会生成默认系统配置信息的config.yml文件
3.	不再使用config_template.yml模板

* release 2.0.1

* fix typo

* little refactory

* little fixes

* remove run_id

* use integer value for ACCOUNT_TYPE

* support context_vars with dict input

* remove debug print

* release 2.0.2

* fix mavg and vwap

* include requirements-py2.txt

* bug fixed

* release 2.0.5

* Bug Fixed: ricequant#76

* 解决 get_mod_config_path  返回值不正确的问题

* analyser benchmark bug fixed

* release 0.2.6

* fix typo

* fix de_listed

* fix AnalyserMod

* add tick event source

* implement get_ticks for test

* fix concatenate bug

* use merge sort to merge ticks

* fill open price from snapshot

* add tick price board

* get tick from event

* rename matcher & simulation broker

* remove internal limit up & limit down from bar.py

* let matcher use price board

* enable volume_limit only when frequency is 1d/1m

* update tick model

* filter past time when universe is change

* refactor

* fix limit up / limit down

* fix limit up / limit down typo

* fix typo

* fix bug when missing market data

* fix doc typo

* add match order_book_id filter

* fix before_trading

* python2 unicode compatible

* make better_exceptions unicode str compatible with python 2.7

* print time spend when performance regress

* arg_checker: fix check_are_valid_fields, is_valid_date

* fix for python2

* add count for is_suspended and is_st_stock

* fix

* fix

* fix order_percent; clear comment

* update docs

* release 2.0.7

* update version

* fix before_trading time bug

* update FAQ doc

* remove useless code

* performance tune

* add matching type check

* publish EVENT.POST_UNIVERSE_CHANGED only when universe changes really

* cache get_account_type because it is god damn slow

* update repr of snapshot

* fix before_trading time bug

* auto set default encoding with utf8

* format code

* update sys_stock_realtime readme

* add limit up & limit down

* implement a1 b1

* add data_board

* use order_book_id to be index

* fix realtime stock cause by mod conflict

* refactor event source

* remove StockRealtimePriceBoard

* add intro/optimizing_parameters

* add batch run test code

* add batch run by main.run

* add analyser batch run performance

* fix docs

* use `from rqalpha import run` to run batch

* refactor ptimizing_parameterso

* fix subscribe bug & refactor event source

* bug fixed

* release 2.0.8

* add missing logger in api

* add missing logger in api

* add  mod_sys_analyser README.rst

* update sys_analyser README

* Update README.rst

* 增加 sys_progress Mod 对应的 README.rst 文档

* 增加 sys_risk_mod 对应的README.rst

* add sys_simulation mod README.rst

* update sys_stock_realtime mod README.rst

* update docs

* update

* seems better

* preload carray

* data type matters

* update sys_funcat docs

* add more examples into sys_funcat doc

* add mod requirement

* fix format style

* update rqalpha_mod_sys_analyser docs

* update docs

* update docs

* add optimizing parameters examples in docs

* unify is_suspended/is_st_stock

* add set_pending_cancel

* fix logic bug in order.is_final

* refactor deal_price_decider create

* format test code

* format example code

* fix test_api_base

* refactor test_api

* remove test code

* show progress bar for test_api

* fix typo

* fix test_api_future/test_api_stock

* fix doc

* fix test code

* update simulation broker

* use env.get_instrument instead of data_proxy

* update signal broker

* bug fixed

* update sys analyser mod

* format code

* update history_bars api

* add signal test algo

* disable test_api temporarily

* fix rqalpha cmd error

* format code

* update i18n

* release 2.0.9

* add error message, fix bug in test cases

* fix only export custom user mod config issue

* Update signal_broker.py

81行修改了一处BUG

* format code

* update docs

* Develop (ricequant#89)

* test

* test

* merge 2.0.6

* commit

* commit

* fix no settlement

* delete tags

* add extend_api example

* update docs

* update docs

* release 2.1.0

* release 2.1.0

* update docs

* 提供 `from rqalpha import cli` 方便第三方 Mod 扩展 `rqalpha` command

* add include_now

* fix data_proxy

* Fix ricequant#90

* fix concept testcase

* do not create position until first trade

* add quarter arg checker

* fix include_now in BEFORE_TRADING

* refactor

refactor rqalpha_mod_sys_funcat

* fix bar_count

* refactor get_price

remove useless code

* refactor sys_funcat

* Fix bug issue#94

* release 2.1.2

* add bar count scale

* don't create position

* add stock & future test case

* refactor test.py

* fix travis in 2.7 because ipython==6.0+ is not support python 2

* fix bug when running future

* fix alpha calculate error

* update test pkl

* update i18n

* require six

* only futures has settle price

* use int32/int64

* fix transaction_cost

* fix typo

* add pnl/starting_cash/fronzen_cash

* fix frozen_cash

* add requests lib requirement

* update translation

* fix tiny bug for rqalpha mod install cmd

* fix history_bars

* make price_limit as a warning switcher option for signal model

* fix history_bars when include_now=True

* remove force include_now=False

* fix history_bars

* fix regression

* support config.json as user config file

* bug fixed

* add issue template

* Update issue_template.md

* add comment

* bug fixed

* fix future calc

* fix ricequant#101

* release 2.1.3

* update version

* update pkl

* remove unused typing lib

* add deprecated property for making old version RQA compatible

* fix plot when only backtest with one day

* fix settlement price

* fix history_bars because we misuse ExecutionContext.phase()

* 增加期货账户级别仓位强平 ricequant#108

* pass test case

* update i18n

* release 2.1.4

* bug fixed

* fix frozen_cash cal

* fix clear position
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants