Execute Market order on average price on BT
-
My data has average price along with OHLC.
Is it possible to execute on the average price of the next day instead of the opening price of the next day?
This will simulate an execution by the VWAP, since the VWAP is very close to the average price.
I know I could feed the average price in place of the opening price, but this would mess indicators, for example ATR. -
@André-Tavares said in Execute Market order on average price on BT:
average price of the next day
I'm not sure I'm following you. Do you want to execute your order on the average price of the current bar and previous?
-
Next bar.
What is the current behavior on a daily basis.
Analyze on the current close price and send order. Order is executed on the open price of the following day.I want to:
Analyze on the current close price and send order. Order is executed on the avarage price of the following day. -
That's going to be a bit tricky, since you can't calculate the average price until after close.
-
I have the average price. I will include it with OHLC.
-
@André-Tavares said in Execute Market order on average price on BT:
Is it possible to execute on the average price of the next day instead of the opening price of the next day?
Everything is possible in the backtests. You may want to use
stoplimit
order and specify your average price forprice
andplimit
.Just wondering how are you going to make this in real life? Final VWAP price us not available till the end of the session. It seems for me as a future lookahead bias.
-
In Real life I will use the broker order type that is VWAP. It executes during the day piece by piece. The final average price is close to the average price.
I think this is closer to reality than trading at open price. What do you think? -
@André-Tavares I see, in this case it may work. But the accuracy of the backtest will depend on how average price is close to VWAP.