Login Page - Create Account

Support Board


Date/Time: Sun, 05 May 2024 12:08:52 +0000



In backtesting, Limit Orders fill at wrong price

View Count: 92

[2024-04-21 22:31:52]
User656492 - Posts: 133
Why is it that while backtesting Spreadsheet Trading limit fills are posted at prices other than their limit price?

It varies depending upon time interval, which I would expect for market orders.

I would expect that this same interval variance would apply to market orders, but why limit orders?

Either it fills at limit or it does not. Why would the system choose some other value?
[2024-04-22 15:06:00]
John - SC Support - Posts: 31362
Which Backtesting option are you using?
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-04-22 15:08:37]
User656492 - Posts: 133
Actually, as it turns out, it's not a backtesting issue. It happened in live trading.

This morning, I see a limit price to sell in the spreadsheet of 17231 in column M. I see an actual fill at 17224.

J71 = "L" (no quotation markets in the cell)

Am I missing a setting somewhere?
[2024-04-22 15:34:50]
User656492 - Posts: 133
An update - Trade Activity says it was a limit order, at 17224, however the spreadsheet does show 17231.

Why would the submitted limit order be different from the value shown in the spreadsheet?
[2024-04-22 16:17:37]
John - SC Support - Posts: 31362
Columns K, L, M, and N only set whether the action is to be performed (Buy Entry, Buy Exit, Sell Entry, Sell Exit respectively). The value in the cell does not have any impact on where the order is placed.

For a Limit (or Stop) order as defined in Cells J71-J74, the values in cells J22 through J25 are going to set the price at which the order will be placed. Refer to the following:
Spreadsheet Systems, Alerts and Automated Trading: Limit or Stop Prices [J22, J23, J24, J25]
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-04-22 16:21:21]
User656492 - Posts: 133
Thanks, John. I neglected to include this in my original post:


in J22: =K3
in J24: =M3

M3 still shows the 17231 value
[2024-04-22 16:25:31]
John - SC Support - Posts: 31362
In that case, what you have to keep in mind is that the current value of that field may not be what it was when the order was placed. You would need to run a replay and perhaps step trade-by-trade to view the actual value of the cell at the time the order was placed. It should be 17224 at that time.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-04-22 16:29:22]
User656492 - Posts: 133
That value is midpoint of the prior bar, which of course should never change upon that bar closing.
Further, midpoint of the prior bar is not the price at which the trade fired.

Is there another setting/condition that might be prevailing here?
[2024-04-22 16:33:46]
John - SC Support - Posts: 31362
We do not know enough of your setup to be able to comment. You need to look at the value of J24 at the time the order was placed. The Limit order should be set at that price. Work through the replay to verify what you are seeing.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-04-22 17:10:15]
User656492 - Posts: 133
That was the clue I needed. THANKS!

For others

Two things observed:

1.) the reference chart rolled to a new bar period an instant before the trading chart. (I don't see why this should happen, but will leave that aside for now.)

2.) I attempted to use a bar earlier as provider of entry price, but that produced wrong price (as it should, really.)

3.) using current bar AND prior bar as reference price and not yet canceling exiting order, with settings that say no new orders while an open order exists, SEEMS to have addressed this issue.

Will come back to this thread if I still have issues.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account