We are planning to implement limit orders with Alpaca within our moonshot strategy file. We have some working logic already that will place limit orders. The issue we ran into previously was the limit orders would stay open if they were not filled. We are trading on minute candles every minute.
I have considered writing a job that will cancel limit orders every other minute, to avoid accidently closing the limit order I just placed. I was wondering a few things:
- Is there a way to close limit orders within the strategy file besides kicking off a subprocess to execute a bash command? It would be neat if I could set a global within the moonshot class to let it tell blotter to close unfilled orders after so much time.
- Are there any best practices I should be aware of for placing limit orders using moonshot with alpaca?
- Are there any "gotchas" I should be aware of for placing limit orders using moonshot with alpaca?
Thanks!