Is it possible to place two opposing orders? For example, if a stock is at 73, and I want to go long at 74 or short at 72, is there a way to place each of those orders and then cancel the ‘second’ order once the ‘first’ fills? Thank you!
Unfortunately, there is not a good solution to this type of trade. What you are looking for is a One-Cancels-Other or OCO order type. However, Alpaca currently only supports this with orders being in the same direction (ie both ‘buy’ or both ‘sell’). It cannot be used to create a long and a short order. Additionally, (you probably also noticed this) one cannot create two separate orders, one being a long stop order and the other being a short stop order, and then manually cancel the one that doesn’t fill. Alpaca doesn’t allow two open orders with opposite ‘sides’ (ie one to go long and the other to go short).
The best solution is to monitor the price in an algo and then place a single order when one of the conditions is met. This gives the most flexibility in opening a position. Using this approach, I would recommend placing the order as a bracket order with take-profit and stop-loss legs. One can always go in and modify the limit and stop prices once the initial order fills.