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/

    How to buy-open an order and sell-open an order at same time? I means lock the order in futures

    General Discussion
    3
    4
    483
    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.
    • J
      jeff lee last edited by

      currently, when I buy-open and call sell(), the order will be salt, but i want only sell-open another order. how to do it?

      thanks

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

        Your question is not totally clear, but let me try.

        You want to issue buy order and sell order at the same time for the same data and have position open. Right?

        You can do this only if order sizes are different. Or you use different data feeds for buy and sell orders. Otherwise it will be zero position after both orders processing.

        • If my answer helped, hit reputation up arrow at lower right corner of the post.
        • Python Debugging With Pdb
        • New to python and bt - check this out
        J 1 Reply Last reply Reply Quote 0
        • J
          jeff lee @ab_trader last edited by

          @ab_trader said in How to buy-open an order and sell-open an order at same time? I means lock the order in futures:

          Your question is not totally clear, but let me try.
          You want to issue buy order and sell order at the same time for the same data and gave position open. Right?
          You can do this only if order sizes are different. Or you use different data feeds for buy and sell orders. Otherwise it will be zero position after both orders processing.

          yes, I just want to have both of the two direction orders(long-open, short-open) at the same time.
          I see. thank you

          B 1 Reply Last reply Reply Quote 0
          • B
            backtrader administrators @jeff lee last edited by

            @jeff-lee said in How to buy-open an order and sell-open an order at same time? I means lock the order in futures:

            yes, I just want to have both of the two direction orders(long-open, short-open) at the same time.

            So presented it is an impossibility. Your problem is probably that you have only daily bars and your goal is to simulate an intraday strategy.

            The solution is to have intraday data.

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