anyone has experience using restful api trading?

Discussion in 'Automated Trading' started by trend2009, May 13, 2020.

  1. qlai

    qlai

    Well, language agnostic APIs are always preferred (like FIX). Secondly, sometimes you just don't have a choice and the "modern" APIs are web based.
     
    #11     May 13, 2020
  2. 2rosy

    2rosy

    only advantage I see is you have a bulk load of orders you want to place, cancel, get position data. it's simple
     
    #12     May 13, 2020
  3. Girija

    Girija

    REst is platform agnostic as communication is http. Caller can be in any language as long as input conforms to the spec.
     
    #13     May 13, 2020
    lovethetrade likes this.
  4. Yes, you can submit orders at once or in batches. For tracking you need to periodically check again which orders are filled. If api supports web sockets then you well be informed of the fill automatically.
     
    #14     May 14, 2020
    lovethetrade likes this.
  5. so do i need to check 200 orders by 200 calls to the server using rest protocol? or I can check 200 orders by one call to the server?
     
    Last edited: May 14, 2020
    #15     May 14, 2020
  6. Sorry, to be perfectly correct in my previous comment, whether we are able to place multiple orders at once or check fill of multiple orders at once is not dependent upon REST technology but dependent upon the brokers API.
     
    #16     May 14, 2020
  7. neke

    neke

    TD Ameritrade supports REST APIs (see https://developer.tdameritrade.com/apis ) via OAuth 2.0 -- JSON response.
    You need to register. Yes, a single call can get all your current balances, positions and orders -- Up to your calling program to parse and store.
     
    #17     May 15, 2020
    lovethetrade likes this.
  8. if I have 10000 orders outstanding on the broker server, can one call get all the information? I guess the message is too large given you have to poll every seconds and poll those orders never filled.
     
    #18     May 15, 2020
  9. neke

    neke

    Yes, it polls every order. I think there is an option to specify the particular order ID - not sure. But every second is certainly too frequent.
     
    #19     May 15, 2020
  10. temnik

    temnik

    A few years back I actually wrote to a rest api in Python no less. Fully automated market maker program on futures calendar spreads.

    It was "meh" - it worked, slowly but fast enough not to get caught (most of the time). Bulk of the latency was actually in network, not in my code.
     
    #20     May 20, 2020
    trend2009 likes this.