Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
As previously discussed, I have understood that you want to overlay a study on a chart, but you only want the update to be done at the open of the bar.
Apply study "Bar Number (modulo 10)" to this 1-tick chart. This study simply plots the Bar Number of each bar (modulo 10). So we are sure that the value of the study changes at each tick.
Apply study "Overlay only at bar open" to the 6-range chart. Check in the input tab that the study to overlay is the "Bar Number (modulo 10)" of 1-tick chart.
Normally, you will see that the overlaid study just updates at each 6-range open.
How does it work?
The 6-range study is updated only when sc.Index is different from the value of sc.Index at last call (known through the use of a persistent variable).
Two drawbacks:
(i) I do not know if SC systematically calls studies at the opening of new bar. If no, there could be a very short time difference between the actual open of the bar and the first call to the study. This time difference is 500ms or any shorter value defined by the user in Global Settings > General Settings
(ii) The correspondence between 1-tick chart and 6-range chart is made with function sc.GetContainingIndexForDateTimeIndex, which is not precise to the tick (timestamp effect). EDIT: This time difference is 1s maximum.
Perhaps it does not answer 100% to your need, but it could give you ideas.