Login Page - Create Account

Support Board


Date/Time: Tue, 07 May 2024 09:48:45 +0000



Post From: Limit order Fills on Replay

[2017-03-06 20:14:37]
User794640 - Posts: 33
I looked at the trade activity area and ran a simulation replay with the simulated bid/ask on and off and if appears that on both sets of conditions the bid/ask is a one tick spread.

Please look at the attached trade example from the trade activity when I had sim bid/ask checked (it looks the exact same when sim bid/ask is unchecked as well). An order to open the trade is filled at 36.90 and a limit sell order is entered at 37.00. The eventual fill is 37.03 which is an example of this price improvement that wouldn't occur in the real market. That 37.00 limit would have stood in the orderbook and got taken out prior to price trading at 37.03.

When I did the bar based backtest I previously mentioned in this thread it fixed the limit price improvement issue and I thought it was because of the use of simulated bid/ask but I'm beginning to think that wasn't the case since I'm not noticing improvement in the issue after checking that option.

What about the attached section from your documentation which says during a bar based backtest that sell limit orders will not be filled at a price greater than the limit order even if the bid/ask is showing higher than the limit order (I'm paraphrasing here). Could this logic be applied to the replay back test to ensure that price improvement on limit orders doesn't occur?

edit: Here's what I found in the documentation about stop orders during a bar based replay. I think having this logic choice for stops as well as limit orders in a replay backtest would greatly help accuracy as well:

" During a bar based back test, a resting Stop order will not fill at a price which is more than 1 tick away from the Stop price if the Bid and Ask prices processed are beyond the Stop order price and the Last trade price has triggered the Stop. So the order will be filled at the Stop order price +/- 1 Tick, which can be different than the processed Bid and Ask prices. This happens in order to simulate smooth price movement in the case where when running a bar based back test, not every price tick is necessarily available."
Date Time Of Last Edit: 2017-03-06 20:53:08
imagesim bid bad indvidual trade.PNG / V - Attached On 2017-03-06 20:02:37 UTC - Size: 14.54 KB - 400 views
imagelimit order issue.PNG / V - Attached On 2017-03-06 20:02:46 UTC - Size: 8.66 KB - 291 views