alpacahq / alpacahq/Alpaca-API

qty required on notional orders

Abierto
#191 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Sin datos de lenguaje
Estrellas
173
Forks
17
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

**Describe the bug**
It appears that despite the docs [stating](https://github.com/alpacahq/user-docs/blob/c14e3a349cbfbcefb5a87d9078f1cf704c74a825/data/webapi/entities/order-v2.yaml#L41) that setting `notional` on a new order implicitly sets `qty` to `null`, that is not actually what happens:
```yaml
- name: notional
type: string
desc: Ordered notional amount. If entered, `qty` will be null. Can take up to 9 decimal points.
```

What we see:
```sh
curl -X POST -H "APCA-API-KEY-ID: $APCA_API_KEY_ID" -H "APCA-API-SECRET-KEY: $APCA_API_SECRET_KEY" -H "Content-Type: application/json" https://paper-api.alpaca.markets/v2/orders --data '{"symbol":"SPY","notional":"3333333.33333333","side":"buy","order_class":"simple","type":"market","time_in_force":"day","limit_price":null,"stop_price":null,"trail_price":null,"trail_percent":null,"take_profit":null,"stop_loss":null,"extended_hours":false,"client_order_id":null}'
{"code":40010001,"message":"qty is required"}
```
Interestingly, I couldn't even get it working with `qty` being `null`. Has anybody actually tested the `notional` stuff?

**To Reproduce**
Steps to reproduce the behavior:
```sh
curl -X POST -H "APCA-API-KEY-ID: $APCA_API_KEY_ID" -H "APCA-API-SECRET-KEY: $APCA_API_SECRET_KEY" -H "Content-Type: application/json" https://paper-api.alpaca.markets/v2/orders --data '{"symbol":"SPY","notional":"3333333.33333333","side":"buy","order_class":"simple","type":"market","time_in_force":"day","limit_price":null,"stop_price":null,"trail_price":null,"trail_percent":null,"take_profit":null,"stop_loss":null,"extended_hours":false,"client_order_id":null}'
```

**Expected behavior**
The order should go through.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.