Support Board
Date/Time: Wed, 15 Jan 2025 05:26:55 +0000
[Programming Help] - Time and Sales question
View Count: 1646
[2017-06-03 03:00:10] |
User103949 - Posts: 78 |
If i call GetTimeAndSales function, will the return SCTimeAndSalesArray contain all the data until the latest tick? If i specify the number of time and sales records to maintain, how does it work? Does it return the number of trades from last record sequence number or it goes back from the latest tick ? Thanks, |
[2017-06-03 03:07:07] |
Sierra Chart Engineering - Posts: 104368 |
If i call GetTimeAndSales function, will the return SCTimeAndSalesArray contain all the data until the latest tick? Yes.or it goes back from the latest tick ? Yes.
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 |
[2017-06-03 03:24:04] |
User103949 - Posts: 78 |
Thank you. With regard to the second question, if I don't specify large enough number of records, I might not get complete data, right?
|
[2017-06-03 04:51:24] |
Sierra Chart Engineering - Posts: 104368 |
Yes this is correct.
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 |
[2017-06-03 22:10:15] |
User103949 - Posts: 78 |
I noticed that when i was doing backtest replay on a tick level, calling GetTimeAndSales function always returned one number. Is that the expected behaviour?
|
[2017-06-04 05:58:55] |
Sierra Chart Engineering - Posts: 104368 |
How are you coming to this conclusion? It will be up to the Number of Time and Sales Records set in Global Settings >> Data/Trade Service Settings.
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: 2017-06-04 05:59:24
|
[2017-06-04 15:31:01] |
User103949 - Posts: 78 |
I just using Calculate at every tick/trade in the replay model. I debugged the code and check the prices returned by time and sales function. Please see the attached pic. In this example, I am calling time and sales after 500 trades. You can see sc.Index is 501 but there is only one price in TimeAndSales. And this price does not changes. |
[2017-06-04 16:47:10] |
User103949 - Posts: 78 |
Here is one more thing i tried. I open the ZBU17 contract in sierra chart and keep all the default settings. Then I applied the Time and Sales Price custom study provided by SC. Later I replayed the chart choosing calculate at every tick and trade. There is one Time and Sale price after the study is applied.
|
[2017-06-04 17:54:28] |
Sierra Chart Engineering - Posts: 104368 |
In this example, I am calling time and sales after 500 trades. You can see sc.Index is 501 but there is only one price in TimeAndSales. And this price does not changes. There is one Time and Sale price after the study is applied. Initially this will be the case but gradually there are more records as a chart replays.
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 |
[2017-06-04 17:57:11] |
User103949 - Posts: 78 |
The replay is going and the sc.Index is increasing but the size of time and sales array returned is always 1.
Date Time Of Last Edit: 2017-06-04 19:31:27
|
[2017-06-04 23:34:56] |
Sierra Chart Engineering - Posts: 104368 |
We do not see how this could be the case as long as the Number of Time and Sales Records setting is higher than that. Update to the current version in case that has something to do with it. It would seem unlikely but we have to be sure. 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 |
[2017-06-06 05:08:27] |
User103949 - Posts: 78 |
I was able to use sc.GetTimeAndSales() function in real time. However, I printed every single tick in the message box and compared that against the tick i exported to the txt file. I am using 1000 as number of stored time and sales record and 10 mm as chart update interval. I noticed most of the ticks matched but still there are some tick missing in the message window compared to those in the exported file. Is that the correct behavior or should i see exact match?
Date Time Of Last Edit: 2017-06-06 05:09:02
|
[2017-06-06 05:52:20] |
Sierra Chart Engineering - Posts: 104368 |
Unless we are going through this exact procedure it is hard for us to say what exactly the reason for the difference is. The Chart Update Interval is irrelevant. 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 |
[2017-06-06 18:20:34] |
User103949 - Posts: 78 |
Let me describe my procedure in more details. I agree that chart update interval does not matter. First of all i noticed that only ticks missing are within one second. I used a SCDateTimeMS to keep track of the latest tick from last call of time and sales. The reason is because according to document from SC. "It is identical to and supports the same member functions as SCDateTime Variables, The difference is that all comparisons to this type of variable are done to the millisecond rather than to the second." Let me use an example to explain what happened in my code. Assume the latest tick from my last call to time and sales is 19:20:30.1 1229 Then I will use a SCDateTimeMS variable to record 19:20:30.1. And after next call to times and sales return the following 5 ticks, 19:20:30.0 1231 19:20:30.1 1230 19:20:30.2 1232 19:20:30.3 1231 19:20:31 1232 In my code, i will compared the timestamps to the last record 19:20:30.1 and keep the ticks after that , in this case i should capture three ticks 19:20:30.2 1232 19:20:30.3 1231 19:20:31 1232 However in my code i only caught the one tick 19:20:31 1232. So my question is, are those ticks within one second even with different miliseconds are stored with same time stamp internally? |
[2017-06-06 19:08:36] |
Sierra Chart Engineering - Posts: 104368 |
So my question is, are those ticks within one second even with different miliseconds are stored with same time stamp internally? Rather than doing what you are doing you should work with the s_TimeAndSales::Sequence number instead. 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 |
[2017-06-06 21:07:55] |
User103949 - Posts: 78 |
I understand i can work with sequence number. the only difference is i going from the latest tick and backwards since i set chart update interval very small. i am struggling i caught all the ticks when the elapse of time is greater than one second and missing tick only within one second. i hope you can provide some insights based on what i was doing above.
|
[2017-06-06 21:13:06] |
Sierra Chart Engineering - Posts: 104368 |
At this point, we really cannot comment on this further because we do not know what your code is doing and it is not part of our support to look at it either. This really is getting outside the scope of our support. For an understanding of how to work with Time and Sales data, you really should look at the Time and Sales studies. As long as you do the same thing though studies are doing you are not going to have a problem with missing records. 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: 2017-06-06 21:13:44
|
To post a message in this thread, you need to log in with your Sierra Chart account: