Login Page - Create Account

Support Board


Date/Time: Tue, 30 Apr 2024 07:17:48 +0000



Backtest Market and Limit order fill price difference

View Count: 983

[2016-06-28 09:11:44]
wat - Posts: 67
Hello,

we are running backtest over years using StopLimit and Stop orders and receiving statistically noticeable differences: StopLimit gives us better price while Stop gives us worse price most of the time. The order price was 1233,1.

Limit:
[Sim]GC-201608-NYMEX  Long  2016-04-07 10:54:37  2016-04-07 10:54:37  1232.1  1234.6  1  1  1  245.38  1252.28  260.00  0.00  260.00  0.00  100.00%  96.15%  96.15%  4.62

vs

Market:
[Sim]GC-201608-NYMEX  Long  2016-04-07 10:54:37  2016-04-07 10:54:37  1233.2  1234.6  1  1  1  135.38  762.28  150.00  -10.00  150.00  -10.00  93.75%  93.75%  87.50%  4.62


Both of these situations are not close to reality where we usually get requested price. Would it be possible to add option to get requested price and not rely on ask/bid prices as they are far from realtime trading experiences?

We run backtest using same strategy where only difference on order type. As you can see in attachments the price difference is quite big and it makes harder for us to evaluate the result statistics.

Thank you.
image2016-04-07 limit.png / V - Attached On 2016-06-27 15:07:15 UTC - Size: 5.09 KB - 257 views
image2016-04-07 market.png / V - Attached On 2016-06-27 15:07:18 UTC - Size: 6.44 KB - 249 views
[2016-06-29 05:39:14]
Sierra Chart Engineering - Posts: 104368
None of the information you provided us allows us to answer this question.

We must see the Fill line in the Trade Activity Log for the order fill. Here are instructions:
https://www.sierrachart.com/index.php?page=doc/doc_TradeActivityLog.php#TradeActivityLogToSupport

We checked the code and we do see the condition where if the bid and ask prices are away from the last trade price, that the fill price for a Stop market order will be one tick worse than the last trade price, but not more.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2016-06-29 06:44:14
[2016-06-29 15:47:53]
wat - Posts: 67
Hello,

I had to run another backtest and got a bit different prices but the problem is same. We get noticeably better price by limit (10 ticks) which makes strategy looks better than it should:

Limit:
ActivityType  DateTime  Symbol  OrderActionSource  InternalOrderID  ServiceOrderID  OrderType  Quantity  BuySell  Price  Price2  OrderStatus  FillPrice  FilledQuantity  TradeAccount  OpenClose  ParentInternalOrderID  PositionQuantity  FillExecutionServiceID
Order  2016-04-07 10:54:37.301  [Sim]GC-201608-NYMEX  Simulated order canceled  94967  94967  Stop  1  Sell  1233.7    Canceled      Sim1  Close  94965    
Order  2016-04-07 10:54:37.300  [Sim]GC-201608-NYMEX  Canceling order due to sibling fill  94967  94967  Stop  1  Sell  1233.7    Pending Cancel      Sim1  Close  94965    
Fill  2016-04-07 10:54:37.299  [Sim]GC-201608-NYMEX  Trade simulation fill. Bid: 1237.2 Ask: 1237.3 Last: 1237.2  94966  94966  Limit  1  Sell  1235.7    Filled  1237.2  1  Sim1  Close      94966.6
Order  2016-04-07 10:54:37.298  [Sim]GC-201608-NYMEX  Trade simulation fill. Bid: 1237.2 Ask: 1237.3 Last: 1237.2  94966  94966  Limit  1  Sell  1235.7    Filled  1237.2  1  Sim1  Close  94965  1  
Order  2016-04-07 10:54:37.125  [Sim]GC-201608-NYMEX  Simulated order accepted  94967  94967  Stop  1  Sell  1233.7    Open      Sim1  Close  94965  1  
Order  2016-04-07 10:54:37.124  [Sim]GC-201608-NYMEX  Simulated order accepted  94966  94966  Limit  1  Sell  1235.7    Open      Sim1  Close  94965  1  
Order  2016-04-07 10:54:37.123  [Sim]GC-201608-NYMEX  Auto-sent child from parent fill  94967    Stop  1  Sell  1233.7    Order Sent      Sim1  Close  94965  1  
Order  2016-04-07 10:54:37.122  [Sim]GC-201608-NYMEX  Auto-sent child from parent fill  94966    Limit  1  Sell  1235.7    Order Sent      Sim1  Close  94965  1  
Order  2016-04-07 10:54:37.121  [Sim]GC-201608-NYMEX  Order modified internally  94967    Stop    Sell  1233.7    Pending Child-Client      Sim1  Close  94965  1  
Order  2016-04-07 10:54:37.120  [Sim]GC-201608-NYMEX  Modifying Attached Order from parent modification/fill. Parent ref. price: 1234.7. Requested Price: 1233.7. Requested Quantity: 0  94967    Stop    Sell  1234.7    Pending Modify      Sim1  Close  94965  1  
Order  2016-04-07 10:54:37.119  [Sim]GC-201608-NYMEX  Order modified internally  94966    Limit    Sell  1235.7    Pending Child-Client      Sim1  Close  94965  1  
Order  2016-04-07 10:54:37.118  [Sim]GC-201608-NYMEX  Modifying Attached Order from parent modification/fill. Parent ref. price: 1234.7. Requested Price: 1235.7. Requested Quantity: 0  94966    Limit    Sell  1236.7    Pending Modify      Sim1  Close  94965  1  
Fill  2016-04-07 10:54:37.117  [Sim]GC-201608-NYMEX  Trade simulation fill. Bid: 1234.6 Ask: 1234.7 Last: 1235.7  94965  94965  Stop Limit  1  Buy  1235.7  1235.7  Filled  1234.7  1  Sim1  Open    1  94965.5
Order  2016-04-07 10:54:37.116  [Sim]GC-201608-NYMEX  Trade simulation fill. Bid: 1234.6 Ask: 1234.7 Last: 1235.7  94965  94965  Stop Limit  1  Buy  1235.7  1235.7  Filled  1234.7  1  Sim1  Open      
Order  2016-04-07 10:52:45.006  [Sim]GC-201608-NYMEX  Simulated order accepted  94965  94965  Stop Limit  1  Buy  1235.7  1235.7  Open      Sim1  Open      
Order  2016-04-07 10:52:45.005  [Sim]GC-201608-NYMEX  Auto-trade: Replay 300.0X: GC-201608-NYMEX [CB] [M] 5 Min #1 | Denzel 0.9.2 | BuyEntry | Bar start Date-Time: 2016-04-07 10:50:00.000 | Last: 1233.4  94965    Stop Limit  1  Buy  1235.7  1235.7  Order Sent      Sim1  Open      
Order  2016-04-07 10:52:45.004  [Sim]GC-201608-NYMEX  Auto-trade: Replay 300.0X: GC-201608-NYMEX [CB] [M] 5 Min #1 | Denzel 0.9.2 | BuyEntry | Bar start Date-Time: 2016-04-07 10:50:00.000 | Last: 1233.4. Attached Order. Server side OCO order  94967    Stop    Sell  1234.7    Pending Child-Client      Sim1  Close  94965    
Order  2016-04-07 10:52:45.003  [Sim]GC-201608-NYMEX  Auto-trade: Replay 300.0X: GC-201608-NYMEX [CB] [M] 5 Min #1 | Denzel 0.9.2 | BuyEntry | Bar start Date-Time: 2016-04-07 10:50:00.000 | Last: 1233.4. Attached Order. Server side OCO order  94966    Limit    Sell  1236.7    Pending Child-Client      Sim1  Close  94965    

Market:

ActivityType  DateTime  Symbol  OrderActionSource  InternalOrderID  ServiceOrderID  OrderType  Quantity  BuySell  Price  Price2  OrderStatus  FillPrice  FilledQuantity  TradeAccount  OpenClose  ParentInternalOrderID  PositionQuantity  FillExecutionServiceID
Order  2016-04-07 10:54:37.301  [Sim]GC-201608-NYMEX  Simulated order canceled  95126  95126  Stop  1  Sell  1234.8    Canceled      Sim1  Close  95124    
Order  2016-04-07 10:54:37.300  [Sim]GC-201608-NYMEX  Canceling order due to sibling fill  95126  95126  Stop  1  Sell  1234.8    Pending Cancel      Sim1  Close  95124    
Fill  2016-04-07 10:54:37.299  [Sim]GC-201608-NYMEX  Trade simulation fill. Bid: 1237.2 Ask: 1237.3 Last: 1237.2  95125  95125  Limit  1  Sell  1236.8    Filled  1237.2  1  Sim1  Close      95125.16
Order  2016-04-07 10:54:37.298  [Sim]GC-201608-NYMEX  Trade simulation fill. Bid: 1237.2 Ask: 1237.3 Last: 1237.2  95125  95125  Limit  1  Sell  1236.8    Filled  1237.2  1  Sim1  Close  95124  1  
Order  2016-04-07 10:54:37.125  [Sim]GC-201608-NYMEX  Simulated order accepted  95126  95126  Stop  1  Sell  1234.8    Open      Sim1  Close  95124  1  
Order  2016-04-07 10:54:37.124  [Sim]GC-201608-NYMEX  Simulated order accepted  95125  95125  Limit  1  Sell  1236.8    Open      Sim1  Close  95124  1  
Order  2016-04-07 10:54:37.123  [Sim]GC-201608-NYMEX  Auto-sent child from parent fill  95126    Stop  1  Sell  1234.8    Order Sent      Sim1  Close  95124  1  
Order  2016-04-07 10:54:37.122  [Sim]GC-201608-NYMEX  Auto-sent child from parent fill  95125    Limit  1  Sell  1236.8    Order Sent      Sim1  Close  95124  1  
Order  2016-04-07 10:54:37.121  [Sim]GC-201608-NYMEX  Order modified internally  95126    Stop    Sell  1234.8    Pending Child-Client      Sim1  Close  95124  1  
Order  2016-04-07 10:54:37.120  [Sim]GC-201608-NYMEX  Modifying Attached Order from parent modification/fill. Parent ref. price: 1235.8. Requested Price: 1234.8. Requested Quantity: 0  95126    Stop    Sell  1234.7    Pending Modify      Sim1  Close  95124  1  
Order  2016-04-07 10:54:37.119  [Sim]GC-201608-NYMEX  Order modified internally  95125    Limit    Sell  1236.8    Pending Child-Client      Sim1  Close  95124  1  
Order  2016-04-07 10:54:37.118  [Sim]GC-201608-NYMEX  Modifying Attached Order from parent modification/fill. Parent ref. price: 1235.8. Requested Price: 1236.8. Requested Quantity: 0  95125    Limit    Sell  1236.7    Pending Modify      Sim1  Close  95124  1  
Fill  2016-04-07 10:54:37.117  [Sim]GC-201608-NYMEX  Trade simulation fill. Bid: 1234.6 Ask: 1234.7 Last: 1235.7  95124  95124  Stop  1  Buy  1235.7    Filled  1235.8  1  Sim1  Open    1  95124.15
Order  2016-04-07 10:54:37.116  [Sim]GC-201608-NYMEX  Trade simulation fill. Bid: 1234.6 Ask: 1234.7 Last: 1235.7  95124  95124  Stop  1  Buy  1235.7    Filled  1235.8  1  Sim1  Open      
Order  2016-04-07 10:54:00.036  [Sim]GC-201608-NYMEX  Simulated order accepted  95124  95124  Stop  1  Buy  1235.7    Open      Sim1  Open      
Order  2016-04-07 10:54:00.035  [Sim]GC-201608-NYMEX  Auto-trade: Replay 300.0X: GC-201608-NYMEX [CB] [M] 5 Min #1 | Denzel 0.9.2 | BuyEntry | Bar start Date-Time: 2016-04-07 10:50:00.000 | Last: 1234.7  95124    Stop  1  Buy  1235.7    Order Sent      Sim1  Open      
Order  2016-04-07 10:54:00.034  [Sim]GC-201608-NYMEX  Auto-trade: Replay 300.0X: GC-201608-NYMEX [CB] [M] 5 Min #1 | Denzel 0.9.2 | BuyEntry | Bar start Date-Time: 2016-04-07 10:50:00.000 | Last: 1234.7. Attached Order. Server side OCO order  95126    Stop    Sell  1234.7    Pending Child-Client      Sim1  Close  95124    
Order  2016-04-07 10:54:00.033  [Sim]GC-201608-NYMEX  Auto-trade: Replay 300.0X: GC-201608-NYMEX [CB] [M] 5 Min #1 | Denzel 0.9.2 | BuyEntry | Bar start Date-Time: 2016-04-07 10:50:00.000 | Last: 1234.7. Attached Order. Server side OCO order  95125    Limit    Sell  1236.7    Pending Child-Client      Sim1  Close  95124    

Is it possible to get backtest mode where the filled price is same as order price?

We would appreciate that because then the backtest would be closer to realtime trading than it is now. We did a lot of comparison and the best conclusion we came up with is that we get requested price most of the time.
imagelimit.png / V - Attached On 2016-06-29 15:34:57 UTC - Size: 4.5 KB - 230 views
imagemarket.png / V - Attached On 2016-06-29 15:34:59 UTC - Size: 4.92 KB - 252 views
attachmenttradeActivityLog.txt - Attached On 2016-06-29 15:35:01 UTC - Size: 7.12 KB - 258 views
[2016-06-30 22:56:29]
Sierra Chart Engineering - Posts: 104368
The only issue we see is this particular fill:
Fill 2016-04-07 10:54:37.117 [Sim]GC-201608-NYMEX Trade simulation fill. Bid: 1234.6 Ask: 1234.7 Last: 1235.7 94965 94965 Stop Limit 1 Buy 1235.7 1235.7 Filled 1234.7 1 Sim1 Open 1 94965.5


Also, we just asked for one single Trade Activity Log line. We did not need all this excess information. It is unnecessary and burdensome. Please do not provide anything we do not ask for.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2016-07-01 09:34:13
[2016-07-01 09:08:33]
User287992 - Posts: 51
Sure, I just wanted to make sure you have all the information.

Anyway this concerns A LOT of situations, I could post quite a few of these.

Is there any solution possible, for example such as I suggested above? This makes BT quite unreliable.

Thank you.
[2016-07-01 10:06:34]
Sierra Chart Engineering - Posts: 104368
We forgot to say that a solution to this has been done and will be out in the next release.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2016-07-01 10:06:54

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

Login

Login Page - Create Account