alpacahq / alpacahq/alpaca-py

Handle Error From Calling `close_position`

Offen
#136 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Broker API enhancement Trading API
Vorherrschende Sprache
Python
Sterne
1.5k
Forks
397
Ø Merge
1 T. 16 Std.
Gemergte PRs (30 T.)
6

Beschreibung

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Is your feature request related to a problem? Please describe.

Currently, the API will throw an error if we try to close a position that is does not exist. The SDK does not handle this error, meaning if the user calls `close_position` on a non-existing position, their code will throw an APIError.

### Describe the solution you'd like.

Instead, the SDK should handle this error and return a `FailedClosePositionDetails` object,

### Describe an alternate solution.

_No response_

### Anything else? (Additional Context)

_No response_

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.