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/

    Quick Questions regarding comissions

    General Code/Help
    2
    4
    517
    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.
    • G
      GuacheSuede last edited by GuacheSuede

      How may I set commissions/transaction costs based of no. of shares ?

      How does backtrader differentiate between a short sell and long that checks how it applies the interest parameter from .setcommission ? (in realation to when i use the self.sell() method, how is it different from a normal sell, does backtrader keep track of previous positions/trades to perform the short operation ?)

      Thanks for your time.

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

        This is all done with CommissionInfo objects (which can be quickly set via the broker or permanently customized with subclasses)

        • Docs - Commissions
        • Docs - Extending Comissions
        • Docs - User Defined Commissions
        • Docs - Commissions - Credit

        @guachesuede said in Quick Questions regarding comissions:

        How may I set commissions/transaction costs based of no. of shares ?

        It is the standard mode. Choose if it is a percentage based commission or an absolute value one.

        @guachesuede said in Quick Questions regarding comissions:

        How does backtrader differentiate between a short sell and long that checks how it applies the interest parameter from .setcommission ?

        See the documentation for Credit above.

        @guachesuede said in Quick Questions regarding comissions:

        in realation to when i use the self.sell() method, how is it different from a normal sell

        There is no special and normal sell. There is only one. The CommissionInfo schemes control what happens.

        @guachesuede said in Quick Questions regarding comissions:

        does backtrader keep track of previous positions/trades to perform the short operation ?

        backtrader keeps track of trades and positions. You are notified via notify_trade and you can always get the current position with getposition

        • Docs - Strategy
        G 1 Reply Last reply Reply Quote 1
        • G
          GuacheSuede @backtrader last edited by

          @backtrader Thanks for the reply. May i ask how do i get a list of buy/sells made ? Or must it be manually managed ?

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

            You are notified of order execution in notify_order. Keep a reference to those that are interesting for you.

            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(); }); }