Comments (4)
不知道哪位能帮忙 实现下 Pyalgotrade 的合约大小 (比如 大豆10, 股指期货300) 需要改源代码,小弟贡献100元冷饮费
from pyalgotrade-cn.
哈哈哈,诚意这么足。
这个需求,我觉得完全可以通过直接在回测结果上面乘一个乘数来满足,能说一下具体的使用场景吗?是要在一个策略里面跑多品种吗?
from pyalgotrade-cn.
比如我测试螺纹钢 , 整点价值是10倍, (反正商品期货就是 5 10 ), 如果能实现10 ,其他只要判断哪个商品自动对应整点价值就行了, 我看了源代码,无从下手, 源代码中实时权益的计算好像是根据 现金+close仓位, 每次利润是按照 差价仓位, 现在的问题改变输出的实时权益和获利并没有用, 我举例: 我开仓计算仓位=资金/close/3, 原始资金 100000元, 3000元螺纹钢买多 100000/3000/3=11手, 3300平仓多头, Pyalgotrade 获利3300元,实际获利33000元, 下一次开仓位本金就应该是13,3000元,而不是 10,3300元, 如果没办法实现整点价值, 商品期货如果始终开固定手,计算出来的最大回测也不准确.
from pyalgotrade-cn.
有个变通的方法,如果你这个最终的目的是要计算复利的影响,可以用一个return analyzer,然后做出来的结果乘一下就好了
from pyalgotrade-cn.
Related Issues (20)
- 原作者的commits全部消除掉了 HOT 2
- 0.18版本后,如何获取day数据? HOT 1
- ImportError: No module named cn.csvfeed HOT 1
- Feed import 问题 HOT 1
- _fill_today_bars 中的 bug HOT 1
- tick 级回测 重构fill_strategy ,添加选项使用对手价买卖
- 这个是都好了吗? HOT 2
- 是在这里提问吧? HOT 1
- 建一个wiki HOT 1
- 请教 stratlib目录下的演示doubleMA.py如何设置初始资金 HOT 1
- 找不到CSV文件
- 支持Py3吗?
- 找不到模块
- 关于印花税。。
- 运行 setup.py报错
- 可以回测5分钟的数据吗?? HOT 2
- 可以回测5分钟的数据吗?? HOT 1
- 如何回测多只股票组合?并显示组合的收益曲线 HOT 1
- 如何用当前Bar的价格成交,而不是用下一根Bar? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyalgotrade-cn.