Login Page - Create Account

Support Board


Date/Time: Fri, 17 May 2024 19:48:18 +0000



Post From: Backtest Market and Limit order fill price difference

[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 - 231 views
imagemarket.png / V - Attached On 2016-06-29 15:34:59 UTC - Size: 4.92 KB - 254 views
attachmenttradeActivityLog.txt - Attached On 2016-06-29 15:35:01 UTC - Size: 7.12 KB - 259 views