I have the same intraday strategy on 2 different moonshot files; one for ibkr and one for alpaca orders. It's always a 3 piece order with initial MKT, child STP, and child MOC for the same Sid. TotalQuantity is just different dollar amounts in paper accounts. I'm not glued to either approach if there is a better way.
Ultimate Goal
Only submit MOC order at both brokers if STP did not trigger intraday.
IBKR Orders
Alpaca Orders
Background reading I've done:
I read the ibkr parent-child order docs here. My question in this case is about the second child order for MOC and if this order is only executed if the first child order has not triggered, or if a more advanced order is needed for this if/else condition. I don't believe a bracket order can capture the MOC element.
For the alpaca orders I've simply changed OrderType and Tif to MKT and CLS as defined in the docs but believe alpaca does not recognize the ParentId Column and currently will submit the CLS order regardless.