I am making my first steps with ACSIL and with C++.
I wish to write a studies that utilize the Time and Sales data. For an example a study that will calculate the cumulative delta within a bar but that will reset and start from zero each time the bar makes a new high or low.
So each new tick I need to get the latest entries of the ask size and bid size from the Time and Sales array.
This is what I wrote:
int TSIndex = TimeSales.GetArraySize()-1;
int LastBidSize = TimeSales[TSIndex].BidSize;
int LastAskSize = TimeSales[TSIndex].AskSize;
I wrote this assuming that the TimeSales[TSIndex] line of the time and sales array stores the latest time and sales data each new tick and that the TimeSales stores the oldest data.
Is this assumption correct ?
Last edited by yonatan; June 26th, 2012 at 05:51 AM.
I didn't get much further with this as I first focused on working with volume by price with ACSIL.
My main goal with the Time and sales was to write a pullback column for the Numbers bars charts but now the SC Team has just launched a perfect official pullback column for the Numbers bars so the urgency has diminished.
I still want to figure out how to work with Time and Sales with ACSIL and I have this goal written on my desk at a high priority BUT my really really first priority is to become a "profitable enough" trader and I have the tendency to run away from this very hard mission and play with programming instead of practicing my trading methods.....I will post when I make some progress with the Time and Sales.
@yonatan, I have understood that this question on T&S is not your top priority for the moment, so do not feel forced to react to what I could say in this message or the next ones.
If other futures.io (formerly BMT) member "fluent" with T&S in ACSIL wants to step in, do not hesitate!
My need (and I think that it is close to @yonatan's) is to access to the full T&S within a bar.
Let's suppose that we have a 5-min chart.
I want to know all the individual transactions which took place in each 5-min bar (+ their sizes + at-the-bid-or-ask).
For instance, it could allow me calculating the delta of the bar (which would emulate SC's built-in delta) or other custom use.
If @yonatan accepts this hi-jack, I will post my comments in the following messages. I hope it could also be useful for him.
Last edited by Nicolas11; August 11th, 2012 at 02:57 AM.
This function has a major drawback: it gives access only to the 2,000 last transactions (or other number defined by the user in Global Settings >> Data/Trade Service Settings).
I wrongly assumed it was the last 2,000 transactions before the current update of the study on the current bar. It would have been fine. But it is 2,000 transactions before the current time in real world. There is no historical data maintained. So GetTimeAndSales() is useless on historical data. Except on the very last minutes of the chart covered by the 2,000 transactions.
To be clearer and coming back to @yonatan's initial question...
According to my understanding and my tests... TimeSales[TimeSales.GetArraySize()-1] refers to most recent transaction (you can check it by printing its time in the log). TimeSales refers to the 2,000th transaction in the past.
But, when I say "most recent transaction", it does not mean the most recent compared to the bar. It is the most recent compared to now in real world. So if you call the function on a bar 1 year ago, it will still give you the 2,000 most recent transactions of today. At least, it is what I observed.
To put it another way... When not in real-time, GetTimeAndSales() gives the same information on each bar. It gives the 2,000 last transactions compared to the final moment of the chart.
Note: the above is not contrary to Sierra Chart's documentation. It is fully compatible with it. But SC's documentation on T&S is rather... short.
Last edited by Nicolas11; August 11th, 2012 at 04:24 AM.
To illustrate the above, attached please find a code.
(Do not forget to correct the #include line)
It simply retrieves the T&S information at each bar.
And prints in the log the time of the first and last transactions of the T&S.
Whatever the bar, the results are the same, and relate to the last bar of the chart.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).
The following 2 users say Thank You to Nicolas11 for this post: