alpacahq / Alpaca-API

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

Paper Trading - Market Buy Order - Limit Error #80

Closed rsgabriel closed 5 years ago

rsgabriel commented 5 years ago

I submitted

{{"symbol":"AAPL","qty":100,"side":"buy","type":"market","time_in_force":"gtc","limit_price":0.0,"stop_price":0.0,"client_order_id":"11","extended_hours":false}}

response:

  | ReasonPhrase | "Unprocessable Entity" | string   | StatusCode | 422 | System.Net.HttpStatusCode

error:

  | Code | 40010001 | int   | Message | "limit price must be > 0" | string

Adding a value other than 0:

RestClientErrorException: 'market orders require no stop or limit price'

I am not sure how to proceed.

rsgabriel commented 5 years ago

I have resolved this issue by using null instead of 0 for the limit/stop price