alpacahq / alpacahq/Alpaca-API

Combining Stop Limit Order With Trailing Stop Order and Allowing OTO

オープン
#154 コメント 2 件 リアクション 2 件 担当者 0 名 GitHub で見る
feature request
主要言語
言語のデータがありません
スター
174
フォーク
17
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。