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/

    Accurate commissions for IB and Oanda

    General Code/Help
    oanda interactive brokers commission slippage
    2
    3
    2292
    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.
    • H
      holicst last edited by

      Hi Everybody,

      I plan to do Forex and stock trading. Most likely I'll use Oanda for Forex and IB for stocks, or maybe IB for both. Can you please help me with setting commissions, slippage and other trade-related costs accurately to exactly match the costs that will occur in real trading?

      I made my first backtests with this code, but now I want to polish it to perfection.

      cerebro.broker.setcommission(commission=0.00003, margin= None, mult=1.0, commtype=None, percabs=True, stocklike=True, leverage=4.0)
      
      cerebro.broker.set_slippage_perc(0.001, slip_open=True, slip_limit=True, slip_match=True, slip_out=False)
      
      

      How would this look like with Oanda and IB (Forex and stocks)? What are the commissions of these brokers? Are there any further costs related to trading in real life?

      Many thanks in advance!

      Cheers,
      Tamás

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

        The only commission known over here is for EuroStoxx50 futures.

        For intraday trading the margin requirements are low, so you can apply

        setcommission(commission=2.0,
                      mult=10.0,
                      commtype=bt.CommInfo.COMM_FIXED,
                      stocklike=False,
                      automargin=0.25)
        

        For overnight operations the margin requirements approximate the price.

        setcommission(commission=2.0,
                      mult=10.0,
                      commtype=bt.CommInfo.COMM_FIXED,
                      stocklike=False,
                      automargin=1.00)
        
        1 Reply Last reply Reply Quote 0
        • H
          holicst last edited by

          Thanks for the info. I forgot to mention that I plan to do intraday trading.

          Cheers,
          Tamás

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