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/

    Live Trading and Compression - question

    General Discussion
    2
    8
    175
    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.
    • leecallen
      leecallen last edited by

      I have been using BT for a couple years for backtesting on Forex. Now I am preparing to move into live trading, using Oanda.

      I'm not sure what compression does in terms of live trading. If I say I want 1-minute bars, does Oanda handle that - does it accumulate the data and send it to my system once per minute? Or does Oanda send tick data and BT (or the Oanda API) summarizes it into 1M bars?

      I am planning on running my algo on multiple currency pairs and time-frames, and I want to design this for reasonable performance and minimal traffic.

      And question #2 if I can...

      I see a lot more documentation "out there" for BT with Interactive Brokers than for Oanda. And the Oanda interface uses their V1 API. Should I be concerned that I am using a less used, possibly less tested and maintained platform?

      leecallen 1 Reply Last reply Reply Quote 0
      • leecallen
        leecallen @leecallen last edited by

        @leecallen I am not sure whether I should be asking about compression or the timeframe parameter in the data feed.

        D 1 Reply Last reply Reply Quote 0
        • D
          dasch last edited by

          Check out https://github.com/ftomassetti/backtrader-oandav20 for oanda v20 support. It will provide you tick data, also 1m data. You can resample or replay tick data to 1min data with backtrader.

          1 Reply Last reply Reply Quote 1
          • D
            dasch @leecallen last edited by

            @leecallen the minimal timeframe for historical data is 5S, for live trading you can use Ticks and replay or resample this to your needed timeframe.

            leecallen 1 Reply Last reply Reply Quote 1
            • leecallen
              leecallen @dasch last edited by

              @dasch Thank you. I am now using the oandav20 API. I'm still trying to sort out the resampling.

              So are you saying, with this API, BT gets Ticks no matter what, and oandav20 or BT summarizes them for me?

              D 1 Reply Last reply Reply Quote 0
              • D
                dasch @leecallen last edited by

                @leecallen basically yes. when you stream live data, then you will always get ticks. You can either resample or replay the data to your needed timeframe.

                You can also request candles instead, then streaming will not be used but instead, oanda will be queried every x sec for new data (x depends on timeframe used).

                So if you want to use candles instead, you would provide the candles=True parameter to your feed, when creating.

                leecallen 1 Reply Last reply Reply Quote 0
                • leecallen
                  leecallen @dasch last edited by

                  @dasch That was EXACTLY the bit of information I needed - thank you!

                  Could you tell me where might I have found this information for myself?

                  D 1 Reply Last reply Reply Quote 0
                  • D
                    dasch @leecallen last edited by

                    @leecallen most of this info is commented in the source code of the data feed. you would also need to read some of the source code: https://github.com/ftomassetti/backtrader-oandav20/blob/master/btoandav20/feeds/oandav20feed.py

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