I'm playing around with some ideas using R and IBrokers with a paper trading account. I'm looking at making orders through R, but was wondering if there's an easy way to make these orders at the mid price, since I'm not expecting to always buy and sell at the bid and ask.
I believe what I'm looking for is a Pegged-to-Midpoint order (https://www.interactivebrokers.com/en/index.php?f=1058). I didn't see this as an order type in the R documentation for the IBrokers package. Does anyone know if this is doable?
According to the API documentation pegged midpoint the order type should be "PEG MID".
Note: I have not tested this because it at the moment I have a live session going on.