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/

    Can support long and short position simultaneously?

    General Discussion
    2
    2
    115
    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.
    • Li Mike
      Li Mike last edited by

      Hi, backtraders. In Chinese futures market, for the same contract, you can hold long and short positions simultaneously. and we have four commands to submit an order: open_long, close_long, open_short, close_short.

      I wonder if it's possible to customize bt to support Chinese future market?

      D 1 Reply Last reply Reply Quote 0
      • D
        davidavr @Li Mike last edited by

        @li-mike I don't think BT supports "boxed" positions (simultaneous long and short in the same security) but I would think you could fake it by adding the same feed for the security twice and just treating one of them as the long and the other as the short.

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