How to assign a market order execution price different than open
I know that might be weird for most traders, but my idea is to backtest a daily execution scheme where @ day "d" a signal is generated to buy/sell a quantity "x" for some asset, which will be sent as a VWAP or TWAP order to my broker @ the next pre-open day ("d+1") .
Thus, since my actual broker (not backtrader's) has his own algorithm to execute the order throughout the day, it will be executed close enough to the realized TWAP/VWAP price. Finally, this is why I want to simulate a market order at some pre-set price (yeah I know I'm looking ahead for that, but this is intentional!).
Thank you guys!
Market order is executed by the price available in the market, it can not be specified. Use
limitorder if want the order to be executed at certain price or better.
Thanks for your reply @ab_trader but I want the order to be executed at the TWAP/VWAP price, however if I set a limit order, it will be executed at the best price (i.e. the open price, if my limit price is the next day's TWAP price).
StopLimitorder with the small difference between
Limitprices will help.
@ab_trader great call, dude! I didn't know about this StopLimit order
Thank you very much!