I want to place a limit sell $0.50 above the buy price of a stock once that order is filled. What is the best way to do this while accounting for the fact that orders are cancelled at the end of each day? I'll also likely have multiple open positions of the same stock at various prices so that seems to be complicating it a bit.
For example: I buy 50 shares of stock XYZ at $10 and 50 shares again at $9. I would like to place a limit sell at $10.50 and $9.50 that persists overnight or code that checks for open positions and places limit sells $0.50 above the limit buy price.
It feels like I should probably use something like get_open_orders() but haven't been able to figure it out.
Thanks for any help!