Hello,
I have created a system to send trades to tradovate but from list of around 300 trades there were one that was ‘rejected’ and still the system returns only ‘orderID’ : ‘XXXXXXX’. I am wondering is it possible for you to add the feature when returning orderID to have also ‘fill’: ‘filled’ or fill: ‘rejected’ (or something similar) that way it will be more convinient to check and retry in case it is rejected.
Regards,
Nikolay
Hello @Nikolay_Georgiev,
Using the orderId
field from the returned object, you can call the fill/deps
API endpoint to get the fills related to that order. You can read about it here.
I hope that I am not disturbing you but I tried sending get request to https://demo.tradovateapi.com/v1/fill/deps?orderId=XXXXXXXX but it returns string(0)
And I am not really sure about my logic but why would I need to call a second request to check if my order is filled or rejcted since the response can give me that informtion
Try using masterid
as the query parameter instead of orderId
- use the orderId
value but make the request ?masterid=XXXXXXXXX
Ok and the response is string(232) “[{“id”:XXXXXXXX,“orderId”:XXXXXXXX,“contractId”:XXXXXXXX,“timestamp”:“2021-08-29T22:55:52.949Z”,“tradeDate”:{“year”:2021,“month”:8,“day”:30},“action”:“Buy”,“qty”:1,“price”:4507.5,“active”:true,“finallyPaired”:0,“external”:false}]”
How do I know if it is filled or rejected ?
Instead you can use the order/item
endpoint (docs here) and check the status
field. Use the same orderId
from the original response as the id
query parameter.