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/

    Generic REST or streaming feed/broker

    General Code/Help
    2
    3
    108
    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.
    • Benoit Dufresne
      Benoit Dufresne last edited by

      Has there been any work done on a datafeed and/or broker that uses a standard format or API where one could provide a URL and boom, everything works?
      Something like...
      Historical data:
      <url>/historical/<instrument>/<granularity>/<compression>/<from>/<to>
      Last bar:
      <url>/live/<instrument>/<granularity>/<compression>
      Send an order:
      <url>/order/<instrument><side>/<price>/<size>
      Get executions to date for order:
      <url>/executions/<orderid>
      Get current position for instrument:
      <url>/position/<instrument>

      Then all someone would have to do it implement providing data and/or execution API and that would work out-of-the-box or so to speak with their custom external feed/execution server. The same could be done with streaming sockets as long as a transmission format came with the feed/broker classes.

      Anyone know of anything I could use or start off from?

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

        @Benoit-Dufresne said in Generic REST or streaming feed/broker:

        Generic REST

        That doesn't exist

        @Benoit-Dufresne said in Generic REST or streaming feed/broker:

        Historical data:
        <url>/historical/<instrument>/<granularity>/<compression>/<from>/<to>
        Last bar:
        <url>/live/<instrument>/<granularity>/<compression>
        Send an order:
        <url>/order/<instrument><side>/<price>/<size>
        Get executions to date for order:
        <url>/executions/<orderid>
        Get current position for instrument:
        <url>/position/<instrument>

        That's a "specific" implementation you have made up (or seen somewhere). It's not generic. There is no such thing.

        @Benoit-Dufresne said in Generic REST or streaming feed/broker:

        and that would work out-of-the-box

        That doesn't exist either.

        Your best bet is to have a look of the Oanda store sources, which uses REST and work your way up to the specific implementation you are looking for.

        1 Reply Last reply Reply Quote 1
        • Benoit Dufresne
          Benoit Dufresne last edited by

          What I meant to ask is if anyone worked on a REST store/broker/feed with a clear specification of the API you'd need to implement to make it work.

          I guess the complete answer is (for the next random person looking for a way in):

          Yes, Oanda has exactly that right here.
          The oandapy package is basically just what you're looking for and is just a bunch of requests and links to documentation.
          All that's missing is a constructor where you provide your own URLs and voilà

          I've seen my question asked under several forms here and there and the answer is always "look at Oanda". I think most people asking this (most definitely) are just missing out on the fact that the oandapy source code is super simple. They've looked at oandastore.py and haven't understood what they needed to do to adapt it to their needs.

          Another possible answer I've found is

          Look up Dave Vallance's repo and implement your own exchange in ccxt

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