Backtrader Community

    • 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/

    "Translating" from quantopian to backtrader

    General Code/Help
    1
    2
    167
    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.
    • C
      chewbacca last edited by

      Hey guys, I'm trying to "translate" an algorithm from quantopian to backtrader, however, I get vastly different results.
      I think this has something to do with some of these:
      set_slippage(slippage.VolumeShareSlippage(volume_limit=0.3, price_impact=0.1))
      set_commission(commission.PerShare(cost=0.0115, min_trade_cost=1.0))

      I've tried using the following functions in bt to account for them:
      cerebro.broker.setcommission(commission=0.0115)
      cerebro.broker.set_slippage_perc(perc=0.3, slip_out=False)

      However, I still get totally different outcome on the algorithm. Does backtrader have VolumeShareSlippage and commission.PerShare ? Am I using the BT functions correctly on this?

      Let me know..

      Regards,
      C

      1 Reply Last reply Reply Quote 0
      • C
        chewbacca last edited by

        So I just tested quantopian's "PerShare" stocks commission model and comparing to BTs model - well.. for the same amount of shares BT shows 40k $ commissions, Q shows 211.0 $ commissions.

        So, again.. does BT have a PerShare commissions model where we can set the minimum amount - 1$, and 0.0115$ per share ?

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