Login Page - Create Account

Support Board


Date/Time: Wed, 10 Sep 2025 11:21:49 +0000



[Programming Help] - Engineering iteration.

View Count: 157

[2025-07-15 19:35:13]
User373245 - Posts: 62
Does anyone know the engineering iteration logic to intraday data indicators live. I am curious how it looks from aggregate data call it in seconds, to live time frames to a calculation. Say I load a 30min RSI on a chart at the RSI length at 5. Is the calculation derived from bar-5 30min|Last bar-4 30min|Last bar-3 30min Last bar-2 30min|Last to sc.BaseData[SC_LAST][sc.Index] as a rolling calculation. I understand there is more math that goes into this. I am just trying to tackle the iteration logic from second data to match a live calculation on a chart. Simple rolling to the difference in sec to minutes does not appear to be the same logic as a live indicator on a chart.

In going from lower time data to larger and still have it be like real time. I need to be able to look at any given second in the raw data and see what any indicator is doing at any given second. Everyone computes from end of bar. This is very static! I think you need bar data as chunks O H L C to time frame and have it move through to the last calculation being Last in seconds?

If anyone knows this logic and would like to share it I would be grateful!
[2025-07-15 20:09:39]
John - SC Support - Posts: 41709
The source code for the RSI study, in particular, is available in the Studies7.cpp file located in the ACS_Source folder under your main Sierra Chart installation folder. You can view how the study is calculated from that code.

Another thing to look at is the following:
Chart Studies: Study Calculation Precedence And Related Issues

And the following and the section below it:
Working with ACSIL Arrays and Understanding Looping: Automatic Looping/Iterating

--

Otherwise, we are not really sure what you are asking or wanting to do. We have therefore set this as "Programming Help" for others to be able to help you.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-07-15 21:24:12]
User373245 - Posts: 62
I am asking how you get a live calculation. If I have second data. and want a 30min calculation. lets just say a 30min MA length 3. Are you taking second 3,600 last + second 1,800 last + sc.BaseData[SC_LAST][sc.Index]/3 and than have it be rolling.

If want length 3 30min MA from second data. I do 10bar30Last + 9bar30Last + 8bar30Last/3 and have it rolling ....I have no way of seeing at second 17,190 what the 30min MA lenght of three would have been doing at that exact moment.

This is not from ACSIL...this is from download of second data....and I am trying to run calculations.
[2025-07-15 22:11:56]
John - SC Support - Posts: 41709
Most of the calculations are done based on Bars and not on the underlying data.

So if you have 30 minute bars and want a Moving Average of the Close with a Length of 3 (meaning 3 bars) the system will take the data for the Close of the 3 bars that need to be calculated and give an average of those bars.

There is no way within Sierra Chart to see what is occurring at every second, unless you have a 1 second bar period. But then you would not be able to get a 30 minute Moving Average with a length of 3.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-07-16 05:45:07]
User373245 - Posts: 62
What about the current bar in real time as it updates with the tick? Do you just treat that aspect of the calculation as Bar last, until the bar ends?

So say bar 3 is close 106.2, bar 2 is 105.4 and current last lets say 20seconds into the current bar is 104.0 than the current bar live outputs 106.2+105.4+104.0/3 and then on say second 21, current bar jumps to 104.2 than the output is 106.2+105.4+104.2/3. I believe this is what is happening. I just want to make sure.
[2025-07-16 15:00:37]
John - SC Support - Posts: 41709
So say bar 3 is close 106.2, bar 2 is 105.4 and current last lets say 20seconds into the current bar is 104.0 than the current bar live outputs 106.2+105.4+104.0/3 and then on say second 21, current bar jumps to 104.2 than the output is 106.2+105.4+104.2/3. I believe this is what is happening. I just want to make sure.

Yes, this is what is occurring generally. Keep in mind that the calculations are done based on the "Chart Update Interval".

Note that the information for the bar at 20 seconds is lost once the calculation for the bar at 21 seconds is done.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-07-16 18:24:54]
ondafringe - Posts: 327
@User373245

Based on the way you presented your formulas makes me wonder if you're aware of the algebraic/mathematical order of operations. If not, your formulas, as presented, will not calculate your indicator correctly -- you'll need a parenthetical in there.

Just double checking. :)
[2025-07-16 18:42:33]
User373245 - Posts: 62
Thank you! Yes I am aware of the caveats and minutiae relative to how the data is updated and all that jazz. My question is purely the iterative indexing. I don't assume anything! EVER! I ask questions. Or run 10 years and let the statistics tell me how to think!! I am working backwards. Ive been on the trade side for 19 years! Only on engineering side for 4 ...so I have a great deal to learn! Thank you!
[2025-07-16 18:44:49]
User373245 - Posts: 62
I have not presented any formula...I have only asked a question relative to a question not stated. And so steered the question to answer my other question. Which I got exactly!

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account