Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. ericbaranowski
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 1
    • Best 0
    • Groups 0

    ericbaranowski

    @ericbaranowski

    0
    Reputation
    1
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Location Cleveland, OH Age 34

    ericbaranowski Unfollow Follow

    Latest posts made by ericbaranowski

    • RE: perpetual futures equivalent on backtrader

      I know this is over a year old, but I’m currently working on this problem and will try to make a post on how to backtest futures once I’m done figuring it out.

      As for the comment about orders getting rejected, this is usually caused by a price difference when the order is submitted and when the order actually tries to execute, like this:

      Buy Submitted on 2022-07-27 - Price $55.50, Value $1,000.00, Size 18.02
      Buy Completed on 2022-07-27 - Price $55.43, Value $998.74, Size 18.02
      

      You can see there if the price is higher when it’s executed you won’t have enough cash available so the order will be rejected. As far as I know, the easiest way to fix this is to change the order target percentage from 1.0 to something like 0.99 so that there will be enough cash available for any slight price changes.

      posted in General Code/Help
      ericbaranowski
      ericbaranowski