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/

    Open position but no resting order

    General Code/Help
    2
    2
    25
    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.
    • Andre Frade
      Andre Frade last edited by

      Hi,

      I am new to backtrader and I have been stuck on a problem for a while.

      In my strategy, I am placing buy and sell orders simultaneously. At each cycle, my function next is designed to first check whether a position is open or closed. If open, I would like to look at details of the order that is still resting.

      I thought that if a position is open, it is because one of my orders was executed and the other one is still to be. However, my code breaks because although it finds an open position, it does not find any resting order.

      Any ideas of what might be going on ? Perhaps this has to do with my little understanding of the process, but I could not yet find a good walk through.

      Thank you very much in advance.

      Andre

      1 Reply Last reply Reply Quote 0
      • A
        ab_trader last edited by

        @Andre-Frade said in Open position but no resting order:

        Any ideas of what might be going on ?

        • No resting order is issued
        • Resting order is executed before you search for it
        • The way you are looking for the resting order is incorrect
        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
        $(document).ready(function () { app.coldLoad(); }); }