-
Notifications
You must be signed in to change notification settings - Fork 97
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
功能与意见反馈 #1
Comments
我想问问,能加一个选股策略是成交量大5日均线和50日均线,当成交量5日均线上穿50均线,说明有大量资金购买此只股票,连续5天成交量大于50日均线,证明后市此只股票有涨价的迹象 |
等于是基于成交量的趋势判断是吧?可以的,如果你感兴趣开发,也欢迎一起 |
是的,就是这个意思,我在看你的代码看看怎么增加一下 |
对的,这是个问题,可以在macd里面加方法,对volume进行计算和判断,也可以策略里面直接加一个macd_volume,后期可能会重构,到时候也许会并到指标计算里面,感兴趣,你也可以尝试,我微信:DeltaF_ |
我想问问strategy模块里面base的calculate_portfolio_return方法,如果某只股票的signal是-1,意思是做空该股票吗? |
|
base.py里的calculate_prof_pct函数应该这样写(按照老师视频里的验证方法,2种写法结果是一样的,但其实如果注释掉一个,分别验证,最后的结果会不一样): |
你也发现了这个bug,我之前发现了,不过一直没看完,今天才看完了,给老师提了pull request,等老师合并。 def calculate_prof_pct(data):
"""
计算单次收益率
修正版
:param data:
:return:
"""
# 筛选信号不为0的并且计算涨跌幅
data['profit_pct'] = data.loc[data['signal'] != 0, 'close'].pct_change()
# 筛选出卖出时的收益率
data = data[data['signal'] == -1]
return data |
已合并,感谢
…________________________________
发件人: Arrowarcher ***@***.***>
发送时间: 2022年6月7日 17:00
收件人: Delta-F/DeltaTrader ***@***.***>
抄送: DeltaTrader ***@***.***>; Author ***@***.***>
主题: Re: [Delta-F/DeltaTrader] 功能与意见反馈 (#1)
你也发现了这个bug,我之前发现了,不过一直没看完,今天才看完了,给老师提了pull request,等老师合并。
我的改动是:
def calculate_prof_pct(data):
"""
计算单次收益率
修正版
:param data:
:return:
"""
# 筛选信号不为0的并且计算涨跌幅
data['profit_pct'] = data.loc[data['signal'] != 0, 'close'].pct_change()
# 筛选出卖出时的收益率
data = data[data['signal'] == -1]
return data
―
Reply to this email directly, view it on GitHub<#1 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AMXTVBG6K4RNHP7T3E4I4I3VN4FRZANCNFSM4ZRNVG2A>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
嗯,你的改法也可以 |
任何有关于功能的优化建议,都欢迎在此提出,也欢迎多多star和fork本项目,并参与构建。
The text was updated successfully, but these errors were encountered: