Login Page - Create Account

Support Board


Date/Time: Sat, 18 May 2024 21:55:01 +0000



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

[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