GithubHelp home page GithubHelp logo

Comments (4)

gaorufeng avatar gaorufeng commented on May 28, 2024

不知道哪位能帮忙 实现下 Pyalgotrade 的合约大小 (比如 大豆10, 股指期货300) 需要改源代码,小弟贡献100元冷饮费

from pyalgotrade-cn.

chopchopjames avatar chopchopjames commented on May 28, 2024

哈哈哈,诚意这么足。

这个需求,我觉得完全可以通过直接在回测结果上面乘一个乘数来满足,能说一下具体的使用场景吗?是要在一个策略里面跑多品种吗?

from pyalgotrade-cn.

gaorufeng avatar gaorufeng commented on May 28, 2024

比如我测试螺纹钢 , 整点价值是10倍, (反正商品期货就是 5 10 ), 如果能实现10 ,其他只要判断哪个商品自动对应整点价值就行了, 我看了源代码,无从下手, 源代码中实时权益的计算好像是根据 现金+close仓位, 每次利润是按照 差价仓位, 现在的问题改变输出的实时权益和获利并没有用, 我举例: 我开仓计算仓位=资金/close/3, 原始资金 100000元, 3000元螺纹钢买多 100000/3000/3=11手, 3300平仓多头, Pyalgotrade 获利3300元,实际获利33000元, 下一次开仓位本金就应该是13,3000元,而不是 10,3300元, 如果没办法实现整点价值, 商品期货如果始终开固定手,计算出来的最大回测也不准确.

from pyalgotrade-cn.

chopchopjames avatar chopchopjames commented on May 28, 2024

有个变通的方法,如果你这个最终的目的是要计算复利的影响,可以用一个return analyzer,然后做出来的结果乘一下就好了

from pyalgotrade-cn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.