Login Page - Create Account

Support Board


Date/Time: Sun, 05 May 2024 22:58:31 +0000



Simple way to get previous bars indicator reading using price-overlay

View Count: 719

[2017-01-01 20:18:33]
AcquaLife - Posts: 33
Hello,

Is there a simple way to get the previous (most recent closed bar) from price overlay? Example: Overlaying 30min on a 30second chart. I want the most recent closed 30min bar indicator value. I have been doing if loops using the modulus operator to find out when 30min has passed and i save the current 30min indicator value into an persistent variable. I am using the getminute and gettime functions as shown here: http://www.sierrachart.com/index.php?page=doc/SCDateTime.html#TimeValue

Is there an easier way to get this value? I know about the barclosed function but that seems to only work on the 30sec chart (the one i am loading the code onto). Maybe i am wrong?

Thanks for all your help
[2017-01-01 22:31:48]
Sierra Chart Engineering - Posts: 104368
Using the Study/Price Overlay study for this, is a very complicated and unstable way to do this.

You simply want to access the data from the other chart using the method here:
Referencing Other Time Frames and Symbols When Using the ACSIL: Referencing Data from Other Time Frames By Direct Referencing of the Other Timeframe

Then access the second to last array element in the Base Data array from this other chart. This is all.
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

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

Login

Login Page - Create Account