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 disable shorting

    General Discussion
    2
    2
    539
    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.
    • eggachecat
      eggachecat last edited by

      Is there any way to disable shorting (Selling more stock than balance in the account is not allowed) through some configuration or I have to do it manually ?

      There's a set_cash in broker's API, may be a set_stock to specify the initial stock account is useful?

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

        No. But there should be no inherent difficulty in avoiding going short, or is there?

        @eggachecat said in how to disable shorting:

        There's a set_cash in broker's API, may be a set_stock to specify the initial stock account is useful?

        backtrader starts from scratch and not with open positions. Setting the cash is needed to be able to operate long (you can set it to 0).

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