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

WARN [abandon] stock_position.bought_value 已经不再有效 #114

Closed
myz8110 opened this issue May 2, 2017 · 9 comments
Closed

WARN [abandon] stock_position.bought_value 已经不再有效 #114

myz8110 opened this issue May 2, 2017 · 9 comments
Assignees

Comments

@myz8110
Copy link

myz8110 commented May 2, 2017

1. RQAlpha2.1.4

2. Python3.6.0

3. Windows

4. 2.0.9更新至2.1.4后,原先正常运行的代码出现了问题.

5. cmd一直出现以下信息:

2015-07-14 WARN [abandon] stock_position.bought_value 已经不再有效
2015-07-14 WARN [abandon] stock_position.bought_value 已经不再有效
2015-07-14 WARN [abandon] stock_position.bought_value 已经不再有效
2015-07-14 WARN [abandon] stock_position.bought_value 已经不再有效
2015-07-14 WARN [abandon] stock_position.bought_value 已经不再有效
2015-07-15 WARN [abandon] stock_position.bought_value 已经不再有效
2015-07-15 WARN [abandon] stock_position.bought_value 已经不再有效
2015-07-15 WARN [abandon] stock_position.bought_value 已经不再有效
2015-07-15 WARN [abandon] stock_position.bought_value 已经不再有效
2015-07-15 WARN [abandon] stock_position.bought_value 已经不再有效
2015-07-15 WARN [abandon] stock_position.bought_value 已经不再有效
2015-07-16 WARN [abandon] stock_position.bought_value 已经不再有效
2015-07-16 WARN [abandon] stock_position.bought_value 已经不再有效

怎么清除这些不想显示的信息?或者有什么方法可以回退到2.0.9?

@wh1100717
Copy link
Member

@myz8110 这个问题已经修复 下一个版本发布会解决。

您可以稍等一下 这两天就会发布。

如果要回退的话,可以指定版本安装 pip install rqalpha==2.0.9

@wh1100717 wh1100717 added the bug label May 3, 2017
@wh1100717 wh1100717 self-assigned this May 3, 2017
@wh1100717 wh1100717 added the fixed label May 3, 2017
@wh1100717
Copy link
Member

2.2.0 已解决该问题

@myz8110
Copy link
Author

myz8110 commented May 5, 2017

今天更新到2.2.1,发现问题并没有解决啊!

@wh1100717
Copy link
Member

@myz8110 你能贴一下具体的会出现这个问题的策略和配置信息吗?

@wh1100717 wh1100717 reopened this May 5, 2017
@myz8110
Copy link
Author

myz8110 commented May 7, 2017

你好,已找到问题所在,我原先的策略仍然使用已弃用的pnl和bought_value,改过之后已经没有报错.顺便问下,我在handle_bar(context, bar_dict)中使用is_suspended函数,好像没能过滤掉停牌股,是不是我用错了is_suspended(stock)==False?能不能帮我看下错在哪里?
我的代码如下:其中的 stocks是一个list, 我以filter_paused_stock(stocks)的返回值作为股票池.
def filter_paused_stock(stocks):
return [stock for stock in stocks if is_suspended(stock)==False]

@wh1100717
Copy link
Member

这个麻烦 @hzliu @handsomu 帮忙看一下~~

@handsomu
Copy link
Contributor

handsomu commented May 8, 2017

是否可以给出股票代码呢?
我这边用 万科 测试is_suspended,表现正常。20160701是True,20160704是False

@myz8110
Copy link
Author

myz8110 commented May 8, 2017

@handsomu @wh1100717 已找出原因,是我在卖出时停牌,不是买入时,能不能在"WARN 300472.XSHE 在 2016-09-19 15:00:00 时停牌"增加提示我是在卖出还是买入时遭遇停牌,因为买入卖出的次数多了,"WARN 300472.XSHE 在 2016-09-19 15:00:00 时停牌"我并不知道是卖出还是买入时遭遇停牌,如果这个warn是在买卖停牌股发生时提示,是不是也可以增加判断它是买入还是卖出的提示?比如变成"WARN 300472.XSHE 在 2016-09-19 15:00:00(卖出) 时停牌"

@wh1100717
Copy link
Member

@myz8110 这个是事前风控 进行检测的,主要是基于下单的order_book_id 来检查是否交易 是否停牌等内容。他检测的是你在使用的 这个 order_book_id 是否有效,与是否开仓/平仓 其实无关。

我觉得目前来说,没有太大必要细化到提示买入 还是 卖出 这个粒度。

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

3 participants