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/

    Strange behavior on PercentSizer

    General Code/Help
    1
    2
    59
    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.
    • A
      aguilera_joao last edited by

      Hey! I'm using the PercentSizer to always buy 12.5% of my cash value per buy trade. When is time to sell, I am closing all.

      The thing is the Backtrader suddenly starts to buy more. 12.5% on the first two times, then 25% and then 50% and I'm out of cash, as you can see on Transactions get_analysis():

      (datetime.datetime(2020, 9, 28, 13, 0),
                    [[2.829878222704097,
                      4.3821,
                      0,
                      'AVAXUSDT',
                      -12.400809359711623]]),
                   (datetime.datetime(2020, 9, 28, 15, 0),
                    [[2.829878222704097,
                      4.3494,
                      0,
                      'AVAXUSDT',
                      -12.308272341829198]]),
                   (datetime.datetime(2020, 9, 28, 23, 0),
                    [[5.659756445408194,
                      4.3608,
                      0,
                      'AVAXUSDT',
                      -24.681065907136052]]),
                   (datetime.datetime(2020, 9, 29, 5, 0),
                    [[11.319512890816387,
                      4.2401,
                      0,
                      'AVAXUSDT',
                      -47.99586660835056]]),
      

      The headers would be "datetime", "size", "price", "IDK", "Asset", "usd size value"

      Why is this happening?

      Thank you all!

      A 1 Reply Last reply Reply Quote 0
      • A
        aguilera_joao @aguilera_joao last edited by

        @aguilera_joao Hey!

        I just decided to create my onw sizer!

        Sorry for the trouble,

        Cheers!

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors