alpacahq / alpacahq/Alpaca-API

Combining Stop Limit Order With Trailing Stop Order and Allowing OTO

Abierto
#154 2 comentarios 2 reacciones 0 asignados Ver en GitHub
feature request
Lenguaje dominante
Sin datos de lenguaje
Estrellas
174
Forks
17
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Traders should be allowed to initialize `stop_price` in a trailing stop order. This would effectively prevent trailing orders from experiencing price slippage due to latency and the like. For instance, say a trader would like to buy ABC stock at a price of or below $2.10. ABC currently trades for $2.00, so the trader submits a trailing order with a `trailing_price` of $0.10. However, by the time the order got to execute, the price had spiked to $2.20. Now, the `stop_price` is $2.30 rather than the $2.10. By allowing the trader place a trigger price, this problem can be avoided. The trader can set a trigger price at $2.00 to ensure that the order is intended for that price, and the `stop_price` can now be set at a maximum of ($2.00 + $0.10).

Furthermore, Alpaca should allow OTO with trailing orders, given that the rules above are set in place. If that were the case, a trader can now set a `stop_loss` along with their buy order. Even better, the `stop_loss` leg can be a trailing order in of itself. So whatever final price the stock was purchased for, the trader can place, say, a $0.05 threshold from that final purchase price to sell the stock.

With this new feature, the trader can get the combined benefit of a Stop Limit Order and a Trailing Stop Order.

### Here is how I envision a request implemented from the example above:

`{`
` "side": "buy",`
` "symbol": "ABC",`
` "type": "trailing_stop",`
` "qty": "100",`
` "time_in_force": "day",`
` "trail_price": "0.10",`
` "stop_price": "2.00",`
` "order_class": "oto",`
` "stop_loss": {`
` "trail_price": "0.05"`
` }`
`}`

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.