Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
As a reminder, GetTimeAndSales() only gives access to the most recent T&S (typically: last 2,000 trades), so is not very suitable on historical data.
It exists another way to access T&S: use a 1-tick chart in parallel, since it "embeds" all the T&S information (by the way, this is also suggested by SC T&S documentation).
On the below chart of 2-min TF...
The first sub-panel is built-in SC information: volume, ask volume, bid volume, upticks volume, downticks volume.
The second sub-panel gives the same volume information, but recomputed by a custom study on the basis of the 1-tick chart.
This study identifies the 1-tick ticks which correspond to the 2-min bar.
Then, it looks at these ticks one by one, see if the trade was at the ask or at the bid (for ask volume and bid volume), see if it was an uptick or a downtick (for upticks and downticks volume), etc.
The figures are the same, so the logic of the study seems OK. The code could give a template to access T&S data within each bar of a chart.
For instance, and referring to @yonatan's previous message, nothing prevents in theory from emulating SC's pullback column.
Except if some one has an urgent need, I do not intend to post the code right now:
- it works with historical data, but I would like to check it in real-time
- it only works for time charts, and I would like to adapt it to other charts (range charts, reversal charts, volume charts, etc.)
Open a 2-min chart of the instrument (or other timeframe, but still time-based)
On the 2-min chart, add "Volume (emulated) for time charts only" study. Check that the input field "1-tick chart" refers to the 1-tick chart. Otherwise, change it.
The 5 emulated volume information shall appear in the sub-panel (total volume, bid volume, ask volume, upticks volume, downticks volume) of the 2-min chart. You can compare them with SC built-in data.
I am facing a serious difficulty for non-time-based charts.
I do not succeed in making a tick-by-tick correspondence between, let's say, a 6-range chart, and a 1-tick chart.
Even between a 100-tick chart and a 1-tick chart.
I have them side by side. How could I know which ticks of the 1-tick chart belong to a given 100-tick candle?
I have tried to overlay, but I have observed that the overlay is not precise to the tick.
When overlaying, mapping is apparently not done tick by tick. It is rather done with timestamp, which are less precise than ticks (there could be several ticks in the same second).
My question on SC board: problem with overlay and tick charts - Sierra Chart (with an illustration)
A previous answer from SC support that I have just found on SC board: tick count not accurate - Sierra Chart
I found a workaround.
And I would not say it was easy.
It now seems to work with nearly all kinds of charts.
More on this later. I need to clear things up...
A solution has already been proposed for time charts (for instance: 2-min) only. It cannot be used with other kind of charts, since it uses time-based functions as sc.GetNearestMatchForDateTimeIndex.
This message proposes a new solution: scsf_Volume_Emulated (v1)
It does not work with volume charts, since they apparently do not respect the integrity of each tick. For instance, the volume of each bar of a 10,000-volume chart is exactly 10,000. It shows that tick at the border between 2 bars are split between the 2 bars.
How does it work?
Let's suppose that the main chart is a 2-min chart.
The study maintains an index on the 1-tick chart and follows the progress of the 2-min chart. It moves the index on the 1-tick chart in order to catch-up the volume on the 2-min chart.
More precisely, each time the 2-min chart is updated...
(1) If we are still on the same 2-min bar as in the previous update...
Is it the same volume in the bar as in the previous update? --> nothing to do
Has the volume in the bar increased? --> the study moves the index on the 1-tick chart until the volumes on the 2 charts are the same
(2) If it is a new 2-min bar...
First, the study moves the index on the 1-tick chart until the volume on the previous and completed 2-min bar is reached
Then, the study moves the index on the 1-tick chart until the current volume on the current 2-min bar is reached
How could it be used?
By the above process, the study "sees" which ticks of the 1-tick chart are contained within each bar of the 2-min chart.
The programmer could insert instructions to do something specific.
For instance... see next paragraph.
What does the code do?
The attached code illustrates a possible use of the above by emulating SC's built-in volume, ask volume, bid volume, upticks volume and downticks volume.
We have already seen that the study identifies the individual ticks which belong to the 2-min bar.
The study looks at these ticks one by one as soon as they are identified, see if the trade was at the ask or at the bid (for ask volume and bid volume), see if it was an uptick or a downtick (for upticks and downticks volume), etc.
Disclaimers:
- not tested in real time (just on historical data)
- a bit experimental
- use at your own risks
Do not forget to correct the #include line at the beginning of the code.
Prerequisites:
In "Data/Trade Service Settings", I have :
- Download Historical Intraday Data As: Ticks
- Intraday Data Storage Time Unit: 1 Tick
Use:
Open a 1-tick chart of the instrument
Open a 2-min chart of the instrument (or other kind of chart - see above)
The 2 charts (1-tick and 2-min) shall start at the exact same date
On the 2-min chart, add "Volume (emulated)" study. Check that the input field "1-tick chart" refers to the 1-tick chart. Otherwise, change it.
The 5 emulated volume information shall appear in the sub-panel (total volume, bid volume, ask volume, upticks volume, downticks volume) of the 2-min chart. You can compare them with SC built-in data.
Below please find some screenshots on 4 different kinds of charts (and 4 different instruments).
I am aware that the above is a rather complicated, that the code (even if commented) is too "heavy" and that probably nobody will need to use it. But it was an interesting coding experience for me. So, no regret. And it will be useful for my own research.
Here-above, I said that overlay could not be used to know precisely which tick are within a 2-min bar, since the overlay is not precise to the tick.
In a discussion with Sierra Chart support on their board, they have confirmed that overlay is based on timestamp. And several ticks may have the same timestamp (= same second). It explains the behaviour. So a 10-tick chart/study will overlay on average with a 1-tick chart/study, but not to the tick.
Following this discussion, they have updated their documentation in order to explain the above, and give the detailed mechanism behind the the overlay: (red color added)
Not really a solution for you, but just a comment that you can go quite a bit higher than 2000 records for time and sales. I don't know what the upper limit is but I have been running with 50000 with no problem.