• Ask a question
  • Spaces
    • TT® Platform
    • Autospreader®
    • Autotrader™
    • Charting & Analytics
    • Options
    • ADL®
      • ADL Samples
    • RTD
    • APIs
      • TT .NET SDK
      • TT API & XT API
      • TT REST API
    • Cryptocurrencies
    • Topics
    • Questions
    • Articles
    • Ideas
    • Badges
  • Sign in
  • Home /
  • APIs /
  • TT REST API /
avatar image
0
Question by peterdavies · Feb 26, 2020 at 08:36 AM · TT REST API

Can't get fills by accountId

Hi

I am testing in the UAT environment for a couple of changes we need for next release. I am trying to get fills for an account.

For Positions, this works fine:

https://apigateway.trade.tt/monitor/ext_uat_cert/position?requestId=daytradr-JigsawTrading--a40d85d5-32c5-4b4a-a12e-dbe094b84b7e& accountId=G1112345

For Fills, this works fine

https ://apigateway.trade.tt/ledger/ext_uat_cert/fills?minTimestamp=1580199670504650200&requestId=daytradr-JigsawTrading--bf7364cf-2c80-44f3-a542-f7d58d327fd0

But when I try to get fills for account, I get a 500 server error:
https ://apigateway.trade.tt/ledger/ext_uat_cert/fills?minTimestamp=1580199809519138200&requestId=daytradr-JigsawTrading--c5efba77-d0a3-479d-943b-bd643fe46e6e& accountId=G1112345

I put in a space in after the "https" and "&" above so it doesn't display oddly. Obviously, I don't have that space in the actual code.

How do I request fills for an account? Documentation seems to say it's possible.

Let me know

Pete


Comment
Add comment
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by trishmessina · Feb 26, 2020 at 03:09 PM

@peterdavies It looks like you are specifying the account name G1112345 rather than the account id (a number). The positions query might be 'working' by ignoring the parameter and giving you all your positions. The fill query is rejecting it. You can get the account id via the /accounts request.

Comment
Add comment · Share
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by peterdavies · Feb 26, 2020 at 04:55 PM

Thanks for that @trishmessina- I'm almost there.

In order to ensure proper synching of fills & positions we are doing this:

1 - Get positions for account a
2 - Get fills for account a
3 - Get positions for account a again
4 - Gets fills for account a again

That way if the lists 1&3 match and the lists 2 & 4 match, we know there was no fill that came in while we were processing.

The problem we are having is that step 3 fails with:

Error : ProtocolError Error Message :System.Net.WebException: The remote server returned an error: (500) Internal Server Error.

You'll need to download the image - but you can see here - two yellow highlighted requests for positions that are ok and one blue highlighted request for position that's not OK and fails after almost 30 seconds.

Any ideas


Any ideas?

Let me know

Peter


requestfail.png (193.0 kB)
Comment
Add comment Show 1 · Share
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image trishmessina · Feb 26, 2020 at 06:31 PM 0
Share

@peterdavies It looks like that request timed out. I would suggest doing a retry on the 500 error a couple times, perhaps with a slight delay, before failing your processing. This then would account for any idiosyncrasies happening on the back end server.

To make sure your data is synced, you need to loop your four steps until your sync conditions are true. Have you considered using the .Net SDK for your app? It will synchronize the order book/positions and send you all the fills for the current session. In addition, it will send the position updates and modifcations (when SOKs are created for example) and fills in real time. You can use the REST API in an SDK app if need be as well.

Be aware, the REST API does have request limits (so many a second and so many a day) so make sure to code around those possible 429 responses.

avatar image
0

Answer by AndrewR · Feb 27, 2020 at 02:18 PM

@peterdavies - We are aware of some timeout issues that are occurring only in the UAT environment. We are actively working on a fix. Apologies for the inconvenience.

Comment
Add comment · Share
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Community

Ask questions and share ideas about the TT® and X_TRADER® platforms.

First time here? See our Getting Started Guide and FAQs.

Follow

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

TT Rest API 2 Answers

TTREST - No Support -is it ready for Prime Time? 1 Answer

TT Rest API 1 Answer

Fills, which fields are mandatory? i.e. if we wanted to query all fills, do we simply leave them all blank? or do we need to query by account product etc.? 1 Answer

How far back does data available to TT REST API go?,How far back does data go for trade and position histories when using the TT REST API? 2 Answers

Trading Technologies Home - Legal - Privacy - Contact

© 2017 Trading Technologies International, Inc. All rights reserved.

Powered by AnswerHub

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • TT® Platform
  • Autospreader®
  • Autotrader™
  • Charting & Analytics
  • Options
  • ADL®
    • ADL Samples
  • RTD
  • APIs
    • TT .NET SDK
    • TT API & XT API
    • TT REST API
  • Cryptocurrencies
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges