alpacahq / Alpaca-API

The Alpaca API is a developer interface for trading operations and market data reception through the Alpaca platform.
https://alpaca.markets/
143 stars 13 forks source link

Paper trading is flaky #72

Closed d-e-s-o closed 5 years ago

d-e-s-o commented 5 years ago

(paper trading)

(in a way it's similar to https://github.com/alpacahq/Alpaca-API/issues/64 but not really the same as the web interface has always worked so far)

I had created several orders over some time. Then I tried cancelling them, individually. All requests went through and were acknowledged with 204, yet they all stayed open. I repeated that several times. I then even went to the web interface, hit "Cancel All Open Orders", it showed me the list of orders that had been canceled and...nothing happened. The orders were still there, in the web interface as well as when queried through the API. I repeated that a few times. Nothing changed.

Then, at 6:00 Pacific Time, they were suddenly all gone (this could be coincidence, I am just mentioning it because I checked the time by happenstance).

Are there undocumented times when the API is not expected to work? If so, can those please be clearly documented. Are you guys rolling out updates? Please, can we get some insight into the black box on the other side?

Behavior like this does not provide any confidence in the service. Can you clarify whether live trading is expected to have hiccups of this sort?

Here is one trace:

HTTP request: DELETE to https://paper-api.alpaca.markets/v1/orders/1e7bf00ab4ba4a0e80802fa848449e3b
HTTP status: 204 No Content
HTTP request: GET to https://paper-api.alpaca.markets/v1/orders?limit=50
HTTP status: 200 OK
HTTP body: [{"id":"1e7bf00a-b4ba-4a0e-8080-2fa848449e3b",...}]

Here is the list of orders I am referring to:

1e7bf00a-b4ba-4a0e-8080-2fa848449e3b
37b2f891-4237-40e6-b304-487894d59689
6d0b9796-72e4-47a9-9268-536a82fc94f4
80f88968-4d61-4606-b883-6dd4c754dc28
2ce9558d-5f6e-4e44-9ca9-c86029da9ae4
5d38b1cf-90dc-48cf-94da-255c330cc421
bc13606c-9e7e-4e6c-b9fe-2d90db81bc0c
3c31cf29-b59a-4ad8-86e4-fa6805d8e1b1
b471c396-7819-4e62-8d8d-f80310ea1dc2
7b9ba7e5-b9d0-43e0-92c2-78a9d97b7362
c9949f6a-bb8f-4090-94aa-e6fa84f87a03
e0e31e7d-f366-456d-8ca0-6fc42c3c37c4
d297544d-af12-40da-a9ad-fd4541282d17
f118d205-cd25-44f0-b4f3-1ef3a40c7e28
c2407062-4da5-4adf-ba84-9f4fde55cdc0
bc74ade4-a635-4b54-b422-7471a1520931
bdowling commented 5 years ago

It appears as though you may have been affected by a double-cancel issue that we recently resolved in our paper environment. When multiple cancellations were sent for an order, the order could in certain scenarios be reactivated. We have rolled out updates this week to address this issue and hopefully you do not encounter this again.

Your tif='day' non-executed orders were ultimately canceled at close of the market, 4PM ET.

Thank you for bringing this issue to our attention.