NexusFi: Find Your Edge


Home Menu

 





ACSIL: working with time and sales data


Discussion in Sierra Chart

Updated
      Top Posters
    1. looks_one Nicolas11 with 31 posts (22 thanks)
    2. looks_two yonatan with 6 posts (5 thanks)
    3. looks_3 mkruss with 3 posts (0 thanks)
    4. looks_4 ozunainc with 3 posts (0 thanks)
    1. trending_up 19,876 views
    2. thumb_up 28 thanks given
    3. group 12 followers
    1. forum 47 posts
    2. attach_file 17 attachments




 
Search this Thread

ACSIL: working with time and sales data

  #1 (permalink)
 yonatan 
Haifa Israel
 
Experience: Beginner
Platform: sierra chart
Broker: Optimus Trading Group/Rithmic
Trading: es
Posts: 91 since Apr 2012
Thanks Given: 50
Thanks Received: 71

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:

SCTimeAndSalesArray TimeSales;
sc.GetTimeAndSales(TimeSales);
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[0] stores the oldest data.

Is this assumption correct ?

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Deepmoney LLM
Elite Quantitative GenAI/LLM
NexusFi Journal Challenge - April 2024
Feedback and Announcements
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
38 thanks
NexusFi site changelog and issues/problem reporting
27 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
  #3 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769


Hi,

I am aware that this thread is 1-month old, but have you solved your problem?
Have you had a look at this part of ACSIL documentation: Sierra Chart - Definitions of Advanced Custom Study/System Interface Members ?


Nicolas

Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 yonatan 
Haifa Israel
 
Experience: Beginner
Platform: sierra chart
Broker: Optimus Trading Group/Rithmic
Trading: es
Posts: 91 since Apr 2012
Thanks Given: 50
Thanks Received: 71

Hey @Nicolas11,

Much thanks for the follow up.

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.

Started this thread Reply With Quote
  #5 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769


Quoting 
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 totally relate to this.

I also need to access times & sales from ACSIL for my own needs close to my trading.
I will also post if I make some progress.

Nicolas

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #6 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769

@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.

Nicolas

Visit my NexusFi Trade Journal Reply With Quote
  #7 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769

I have tried to use the function GetTimeAndSales().
Documentation: Sierra Chart - Definitions of Advanced Custom Study/System Interface Members
Examples in studies.cpp (of Sierra distribution)

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[0] 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.

Nicolas

Visit my NexusFi Trade Journal Reply With Quote
  #8 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769

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.

Nicolas


Attached Files
Elite Membership required to download: TnS.cpp
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #9 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769

I am now going to investigate the alternative way proposed by SC to access to T&S: work on a secondary 1-tick chart.

At least, it would allow benefiting from all the available historical tick data "embedded" in the 1-tick chart. More on this later!

Visit my NexusFi Trade Journal Reply With Quote
  #10 (permalink)
 yonatan 
Haifa Israel
 
Experience: Beginner
Platform: sierra chart
Broker: Optimus Trading Group/Rithmic
Trading: es
Posts: 91 since Apr 2012
Thanks Given: 50
Thanks Received: 71



Nicolas11 View Post
@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.

Nicolas

LOL, hi-jack accepted

Started this thread Reply With Quote
Thanked by:




Last Updated on November 9, 2019


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts