Support Board
Date/Time: Wed, 27 Nov 2024 03:31:28 +0000
Sierra Chart sim trading exiting positions at impossible prices
View Count: 846
[2023-09-22 14:09:49] |
User222959 - Posts: 15 |
Hello, I am currently testing execution of overnight positions. I have attached a couple of screenshots of the strange real-time sim trading behavior where trades execute at prices the candles haven't been (all of the trades referred to here are traded in real time, not replay, and in sim). I have adjusted number of stored time and sales records from 4000 to 5000 based on previous help articles I have read on this, but don't think this is the problem. In the first screenshot attached I am trading IQFEED Brent EBZ23 in real time (not replay) and waiting till EOD/overnight while the trade plays out. In this case I left on a trade ~32 lots, and a limit order for around 30 lots for exiting the trade. In this case I chose most of the trades as EOD, rather than GTC, meaning most will cancel at the end of the day. However, the bulk of the exit has occurred at a price that the market hasn't traded. The second screenshot is of another couple of examples of this behavior with a strange EOD and entry price. This isn't just a visual problem, as it also goes into the PnL and trade stats. What does this mean for live trading in this situation? I assume it would have just executed at the market rate rather than what SC gives here. I like the functionality SC has for auditing trading performance and trades so the record being inaccurate is a problem. Any help appreciated, thanks. Date Time Of Last Edit: 2023-09-22 14:14:05
|
Sierra Charts Exit 1.PNG / V - Attached On 2023-09-22 14:00:57 UTC - Size: 39.59 KB - 89 views Sierra Charts Exit 2.PNG / V - Attached On 2023-09-22 14:01:05 UTC - Size: 35.23 KB - 88 views |
[2023-09-22 21:02:44] |
sgne - Posts: 105 |
My experience with SC on this issue is that they don't care that sc.SIM fills are at times wildly inaccurate, or even impossible. They're not going to change their algorithm. For example, when the market trades THRU an order price, sc.SIM will not necessarily generate a fill. Also, when a market order goes out, sc.SIM will sometimes generate impossible fill prices. I have tested this with 1-tick data. And I have verified it with a live-order fill which the accurate replay does NOT fill. Date Time Of Last Edit: 2023-09-22 21:41:13
|
[2023-09-23 07:59:31] |
User61168 - Posts: 403 |
I have experienced such behavior but randomly and only during market replay at speeds of 500+ with "Calculate Same as Real Time" option. Are you able to consistently reproduce this error? Even on a brand new sim account with no order fills? Also curious if you are using simple alerts or spreadsheets or ascil. For me, whenever I see something sporadic with market replays, it's likely related to past order fills from previous market replays and when I select "Clear trade data from start date/time" option. sgne-It's extremely time consuming endeavor for SC to troubleshoot as it could be related to trading strategy so I can understand why they would not want to waste their time. We just have to work around it knowing that backward and forward testing is only good to design/develop/test the strategy. |
[2023-09-23 12:54:00] |
sgne - Posts: 105 |
I use spreadsheets for trading. It was at least 1 month ago that I noticed a real, live fill did not fill with the same spreadsheet controlling things in replay/accurate mode, all on tick data, not 1-second data. And when I say impossible fills, here's a recent example of what I mean. I have an NQ short position with a protective buy stop exit order. But the market moves down rapidly in 1 second, 40 points or more, so fast that the spreadsheet, which normally cancels the buy stop exit order and then issues a buy limit exit order, only is able to cancel the stop order and does not place a limit order before a new bar begins. When this happens, then cell J29 issues a buy market order to flatten. The market order fills on sc.SIM 30 points higher than the high of the new bar. Impossible, but that's the way it works with sc.SIM. |
[2023-09-23 18:02:07] |
Sierra_Chart Engineering - Posts: 17190 |
They're not going to change their algorithm. There is no algorithm involved.For example, when the market trades THRU an order price, sc.SIM will not necessarily generate a fill. This could not be the case and there must be some explanation in your case why this would happen.Also, when a market order goes out, sc.SIM will sometimes generate impossible fill prices. This is not true either. Sierra Chart does not generate fill prices. A market order will be filled according to the current bid and ask prices. You have to look at what those were at the time.There is an explanation for everything in your case. It is impossible for us to say what happened in the cases you describe. We do not have the information to answer the questions. Only you do. 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, use the Teton service: Sierra Chart Teton Futures Order Routing Date Time Of Last Edit: 2023-09-23 18:29:53
|
[2023-09-23 18:28:15] |
Sierra_Chart Engineering - Posts: 17190 |
However, the bulk of the exit has occurred at a price that the market hasn't traded. Why? We do not know.You are able to answer this question. We cannot. There are many variables involved that we do not know at all. From our perspective we do not know what happened in your particular case. You are also using IQ Feed data which is not our data. Here is the relevant documentation: Trade Simulation: How Orders are Filled We also added this new section: Time Stamping for Order Fills Which is very very relevant. We will reemphasize in the documentation that orders will not be filled when Sierra Chart is not running and when Sierra Chart is started, the fill price and time will be inaccurate. Sierra Chart trade simulation absolutely works properly and it is very simple and straightforward. Whatever issues there are, have an explanation. And the user is going to be best able to answer the question based upon the documentation. Not us. 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, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2023-09-23 18:32:36] |
Sierra_Chart Engineering - Posts: 17190 |
The market order fills on sc.SIM 30 points higher than the high of the new bar. Impossible, but that's the way it works with sc.SIM. Why? How are we supposed to know? We cannot. Provide an answer. There is nothing wrong with trade simulation. You need to provide an answer. You know what happened. You have the data that you can examine in the Intraday data file. Tell us what happened. We certainly do not know. There could not be anything wrong in Sierra Chart trade simulation and you are making statements which are completely false by faulting Sierra Chart for something that it could not do wrong at all. If you do not like what we say, then do not jump into some other users thread, and claim that Sierra Chart trade simulation works in a way in which it could not. Sierra Chart cannot assign a price to a fill, which does not actually exist. This price must have come from somewhere. Either the last trade price or the bid or ask price. There could be bid and ask price updates which are not captured in the Intraday file. So you may not be able to determine at this point what went wrong. But hopefully you have enough information to get more of an idea about the issue.
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, use the Teton service: Sierra Chart Teton Futures Order Routing Date Time Of Last Edit: 2023-09-23 18:43:01
|
[2023-09-23 19:04:19] |
Sierra_Chart Engineering - Posts: 17190 |
Regarding post #7, to examine the Intraday recorded data here is the relevant documentation: Intraday Data Editor In regards to post #1, there definitely is a problem with a seemingly invalid price that Sierra Chart was referencing. It would have been a last trade price or a bid or ask price. Was the market open at the time of the fill? Was this during a replay? Was Sierra Chart running at the time that the order should have filled at? You would need to be looking at the last trade price and bid and ask prices at the time of the fill. Check the File >> Open Time and Sales Window, Window >> Current Quote Window. And also examine the Intraday data at the time of the fill: Intraday Data Editor The invalid price is coming from somewhere. Obviously there is a data issue. Not with Sierra Chart trade simulation mode. That would be impossible. 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, use the Teton service: Sierra Chart Teton Futures Order Routing Date Time Of Last Edit: 2023-09-24 08:39:44
|
[2023-09-23 20:01:40] |
User61168 - Posts: 403 |
Thank you SC Engineering for the link to documentation. My Time and sales stored records was set to 100 instead of 10000. Could you please advice whether "Maximum of Time and Sales Depth levels" setting has any significance in simulated orders? Mine is currently set to 0. We will reemphasize in the documentation that orders will not be filled when Sierra Chart is not running and when Sierra Chart is started, the fill price and time will be inaccurate.
|
[2023-09-23 20:16:03] |
Sierra_Chart Engineering - Posts: 17190 |
Could you please advice whether "Maximum of Time and Sales Depth levels" setting has any significance in simulated orders? No it does not. That setting has little relevancy now with changes with how the Bid and Ask Depth Bars works, which uses the stored market depth data.
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, use the Teton service: Sierra Chart Teton Futures Order Routing Date Time Of Last Edit: 2023-09-23 20:16:20
|
[2023-09-24 13:02:51] |
sgne - Posts: 105 |
sc.Engr, I will show you what I mean. NQZ23, Wednesday, 20-09-2023, 1p CT, 2p ET, Fed announcement. Short position. Market moves down at 14:00:01.002, when there's a large sweeping sell order. Here's an image showing a position of -1, and then a flatten and cancel order once the new range bar begins, at much higher than the high of the bar. The spreadsheet issued the market F&C order at the beginning of the new bar, which opened at 15336.50, not during the previous bar. And prices continued to flash down to 15319.50, 4 milliseconds later, before rebounding, see below. https://www.sierrachart.com/image.php?Image=1695503744422.png To reflect reality, the Sim1 market buy fill should be no higher than 15339, which is the high of the range bar when the F&C order was issued. So if SCID Bid/Ask values come from the exchange and can't be changed, then SC's fill methodology could be adjusted by having different Sim Bid/Ask values. Here are 3 lines of the Sim1 trade activity log: Buy 1 Sim1 Market Order Sent 2:00:01 PM [Sim]NQZ23_FUT_CME Auto-trade: Replay 1.00X: NQZ23_FUT_CME [CB][M] 49.75 Range #1 | nqSpread | Source: Flatten & Cancel cell | Bar start date-time: 2023-09-20 14:00:01.002. Flatten&Cancel | Last: 15336.5. Current Position quantity: -1 | AO=0 Buy 1 Sim1 Market Open 2:00:01 PM [Sim]NQZ23_FUT_CME Simulated order accepted Buy 1 15371.25 1 Sim1 Market Filled 2:00:01 PM [Sim]NQZ23_FUT_CME Trade simulation fill. Bid: 15368.25 Ask: 15371.25 Last: 15336.50 The last line specifies the problem, which is the Bid and Ask values in the SCID file. Bid and Ask prices stayed high at Bid: 15368.25 Ask: 15371.25, even though the close of the bar was 32 points below the bid, and trade prices went lower by 17 more points in the next 4 milliseconds. Only when the milliseconds changed from 002 to 006 did the Bid and Ask change in the SCID file. Here's a snapshot of trade prices, from the SCID file, with many intermediate trade prices deleted: NQZ23 ===== 20230920 140000.005 15368.25 20230920 140000.152 15368.25 20230920 140000.371 15368.25 20230920 140000.469 15371.00 20230920 140000.843 15371.25 * prices drop continuously at this millisecond * 20230920 140001.002 15368.25 ———— 20230920 140001.002 15337.00 * new range bar begins * 20230920 140001.002 15336.50 ———— 20230920 140001.002 15331.25 * new millisecond * 20230920 140001.006 15331.75 ———— 20230920 140001.006 15319.25 * end of fast price drop * Here's some more extracted SCID data with Trade, Ask, Bid prices, in that order: 1 20230920 140000.843 15371.25 15371.25 15368.25 2 20230920 140001.002 15368.25 15371.25 15368.25 3 20230920 140001.002 15368.25 15371.25 15368.25 4 20230920 140001.002 15368.25 15371.25 15368.25 5 20230920 140001.002 15368.25 15371.25 15368.25 6 20230920 140001.002 15368.25 15371.25 15368.25 7 20230920 140001.002 15368.0 15371.25 15368.25 8 20230920 140001.002 15368.0 15371.25 15368.25 9 20230920 140001.002 15368.0 15371.25 15368.25 10 20230920 140001.002 15367.75 15371.25 15368.25 Ask and Bid are fine up to line 6. But for line 7, there really wasn't any bid at 15368.25. Theoretically, the Bid was 15368. And since the line 8 trade was no higher than the line 7 trade, the Ask on line 7 could be taken to be the price of the previous higher trade, on line 6. And so forth. (And I have had real, live fills, but which later in a simulation did not fill, even though trades went off through and beyond limit order prices; I have mentioned this before; this is because of artificial SCID Bid/Ask values.) Date Time Of Last Edit: 2023-09-24 13:04:37
|
[2023-09-24 14:32:24] |
User431178 - Posts: 543 |
NOT SC Engineering, but... The last line specifies the problem, which is the Bid and Ask values in the SCID file.
Bid and Ask prices stayed high at Bid: 15368.25 Ask: 15371.25, even though the close of the bar was 32 points below the bid, and trade prices went lower by 17 more points in the next 4 milliseconds. Only when the milliseconds changed from 002 to 006 did the Bid and Ask change in the SCID file. this is because of artificial SCID Bid/Ask values
The values in the SCID file are not artifical, they are the last values sent by the exchange, your assumptions are wrong. When you have a large sweep order and/or a cascade of buy/sell stop orders triggered, as in your example, there is no bid/ask update pushed out until all those orders are filled. Ask and Bid are fine up to line 6. But for line 7, there really wasn't any bid at 15368.25. Theoretically, the Bid was 15368. And since the line 8 trade was no higher than the line 7 trade, the Ask on line 7 could be taken to be the price of the previous higher trade, on line 6. And so forth.
There isn't any 'theoretical' bid... (definitely don't want artifical values in the SCID file do we...) The best bid (and best ask) is not known until the the order sequence completes, nor would you be able to participate in the sequence unless your order was already in prior to it beginning. Anyway.... There is a specific option to help with exactly this situation during chart replay. Chart Settings: Always Simulate Bid and Ask Prices During Replay (Chart >> Chart Settings >> Trading menu) Maybe try using that? |
[2023-09-24 15:01:22] |
sgne - Posts: 105 |
Well, that's the setting to use. Thanks. That there is such a setting suggests that something is not quite right at times with the CME's bid/ask values. The CME has decided not to update bid/ask under these conditions. That's an institutional policy, but they could implement a different bid/ask value scheme under such conditions. Clearly, their current policy does generate unreal bid/ask values under certain conditions, like this one. Date Time Of Last Edit: 2023-09-24 15:43:46
|
[2023-09-24 15:03:35] |
sgne - Posts: 105 |
The best bid (and best ask) is not known until the the order sequence completes, nor would you be able to participate in the sequence unless your order was already in prior to it beginning
Well, at least it's known that the best bid is no longer what it was when it's taken out and a lower bid is hit.
|
[2023-09-24 15:46:53] |
User431178 - Posts: 543 |
The CME has decided not to update bid/ask under these conditions. That's an institutional policy, but they could implement a different bid/ask value scheme under such conditions. Clearly, their current policy does generate unreal bid/ask values under certain conditions, like this one.
They could, but what would be the point, the 'unreal' value doesn't affect how orders are filled/executed in real conditions. If your order is in before the sequence starts, you get filled at your limit (if you're in the LOB) or you get filled at the first available price (based on queue) if stop. If not, then the next time you can participate, the new best bid/ask will have been pushed out. |
[2023-09-25 12:10:20] |
User222959 - Posts: 15 |
Was the market open at the time of the fill? Was this during a replay? Was Sierra Chart running at the time that the order should have filled at?
I've attached further information from activity log and using tick charts. As I said before, all these trades have been taken in real time with no chart replay used, and computer/SC was running in each of these cases. Activity log shows the trade exited 30 lots on the limit order. At some point the data feed had the market with a tradeable bid/offer at 94.08 at 23:00:00.199 UK. Possibly a closing market dynamic as the Brent market hours are 1AM - 11PM UK on a Thursday- but it is dollars away from the last traded price, 92.24. In these situations I would rather the simulated orders were linked to the last traded price, not the implied bid/offer prices available, when the market hasn't traded any volume in this area and could be down to data feed error. Anything that would allow the trades to carry on into the next day without hinderance would be a positive. |
SC Trade Activity 21-09-223.PNG / V - Attached On 2023-09-25 11:01:54 UTC - Size: 108.49 KB - 66 views SC Trade Activity 1 Volume Bar Trade Data 21-09-23.PNG / V - Attached On 2023-09-25 11:03:02 UTC - Size: 28.97 KB - 66 views SC Trade Activity 1 Volume Bar Chart w Bid and Ask Price 21-.png / V - Attached On 2023-09-25 11:04:43 UTC - Size: 27.89 KB - 78 views |
[2023-09-25 17:29:28] |
User61168 - Posts: 403 |
Fascinating topic. Perhaps we could move this to User Discussion section. I apologize in advance for asking a clarifying question. From day 1, my understanding about sim and replays was to never rely on bid/ask. Even an experienced trader back in 2018 told me not to use bid/ask in sim/backtesting/forwardtesting. So, In order to bring my backtest results closest to live results, I have always used the "last" registered price in all my algos. All my entries and exits are triggered using the last price i.e. "C" of the OHLC. To compensate for the slippage etc, I just add a 6-8 ticks to my daily max profit target to compensate for any slippage or spread widening etc. I am curious of your opinion if this is the good (or better) approach compared to relying on bid and ask values. I am not a scalper so it suits my style but I also want to use the correct approach used by professional algo traders. |
[2023-09-25 18:35:48] |
sgne - Posts: 105 |
So, I selected: AlwaysSimulateBidAndAskPricesDuringReplay, and that gave a realistic Flatten & Cancel market order fill under fast market conditions. However, today that option simulated a sell stop fill 1 tick below the low of a bar. Impossible. I actually had a real sell stop order live on the exchange at that very price and it didn't fill. Yet sc.Sim registered a fill. So I know that even this option is defective. In short, I have to use replay mode to debug the order logic of the spreadsheet, but fills need to be simulated on tick data with a separate trading code program. I use AHK for that, since I know it well. Date Time Of Last Edit: 2023-09-26 11:31:28
|
[2023-09-25 18:52:13] |
sgne - Posts: 105 |
From day 1, my understanding about sim and replays was to never rely on bid/ask. Even an experienced trader back in 2018 told me not to use bid/ask in sim/backtesting/forwardtesting.
Yes, you'll want to use tick data, and ignore the exchange bid/ask values.
|
[2023-09-25 19:18:39] |
User61168 - Posts: 403 |
Yes. I am always using tick data to generate price charts (range, Renko etc). One thing I have consistently noticed is my buy/sell exit at bar close simple alert study will skip to 3-5 bars before closing my position during fast markets. Both in live as well as in sim trading. I wonder if there is any solution to this problem. This usually happens on a 2 or 3 tick range or aligned Renko price chart. Works perfectly fine on 2-3 seconds time chart. I have tried all kinds of chart update interval settings but does not seem to have any effect. This happens even on a very simple one line alert formula so I know it can’t be coding related.
|
[2023-09-25 19:43:40] |
sgne - Posts: 105 |
Under those conditions, orders will have to be active early in the bar. You'll need ACSIL or a fast-acting spreadsheet for that. On such small ranges, however, it won't keep up with fast markets. |
[2023-09-27 20:30:13] |
Sierra_Chart Engineering - Posts: 17190 |
We used to do this in the past but then it would create inaccurate fills when the bid and ask, are both away from the last trade price, and the last trade price is old and then we are filling orders against old data: In these situations I would rather the simulated orders were linked to the last traded price, not the implied bid/offer prices available,
We can always add an option for this behavior. Maybe that is the best thing. 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, use the Teton service: Sierra Chart Teton Futures Order Routing Date Time Of Last Edit: 2023-09-27 20:30:32
|
[2023-09-27 20:32:30] |
Sierra_Chart Engineering - Posts: 17190 |
The bid and ask prices that you see from the Bid and Ask Prices study : https://www.sierrachart.com/Download.php?Folder=SupportBoard&download=87611 Only show the bid and ask prices when there is a trade. If these are changing to out of range values, when the market is closed, and then an order is filled against those out of range bid and ask prices, then you are going to get an out of range fill price according to those bid and ask prices. Sierra Chart trade simulation mode does not know when a market is open or closed. This information will be added to the documentation. 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, use the Teton service: Sierra Chart Teton Futures Order Routing Date Time Of Last Edit: 2023-09-27 20:32:44
|
[2023-09-29 14:04:04] |
User222959 - Posts: 15 |
I've updated the global symbol settings for Brent session times as these were slightly off, maybe this was the problem. Does the sim trading conditionally ignore bid/ask for execution outside the session trading hours if these are entered correctly? If so I think my issue would be resolved. We can always add an option for this behavior. Maybe that is the best thing.
It would be nice to have an option for this, though I appreciate the benefits of the bid/ask execution simulation so wouldn't always want to use it. |
[2023-09-29 14:42:16] |
Sierra_Chart Engineering - Posts: 17190 |
No this is not going to help: Does the sim trading conditionally ignore bid/ask for execution outside the session trading hours if these are entered correctly? If so I think my issue would be resolved.
This type of functionality does exist on our Trading Evaluator/ Simulated Futures Trading Service but it is not locally used within Sierra Chart on the client side. 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, use the Teton service: Sierra Chart Teton Futures Order Routing |
To post a message in this thread, you need to log in with your Sierra Chart account: