Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    Fractional Sizes not working from sample code

    General Code/Help
    1
    2
    22
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      Gleetche last edited by

      hi,

      I copy-pasted the sample code from:
      https://www.backtrader.com/blog/posts/2019-08-29-fractional-sizes/fractional-sizes/#trading-cryptocurrencies-fractions

      From the blog itself, the log should be :
      cb1cf9e2-cc61-4224-a32b-38092f79dd26-image.png

      But mine is:
      22b0c9a4-c73d-4b68-9942-78daa752b796-image.png

      As you can see, the sample log's size is -16.4574...
      mine does not have any decimals.

      Am I doing anything wrong or am I missing something?

      1 Reply Last reply Reply Quote 0
      • G
        Gleetche last edited by

        Ah i just need to remove

        if args.fractional:
        cerebro.broker.addcommissioninfo(CommInfoFractional())

        1 Reply Last reply Reply Quote 1
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
        $(document).ready(function () { app.coldLoad(); }); }