alpacahq / alpacahq/Alpaca-API

Combining Stop Limit Order With Trailing Stop Order and Allowing OTO

Ouverte
#154 2 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
feature request
Langage dominant
Aucune donnée de langage
Étoiles
174
Forks
17
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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"`
` }`
`}`

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.