Support Board
Date/Time: Sat, 11 Jan 2025 22:40:50 +0000
ACSIL/Most efficient way to...
View Count: 1172
[2017-01-05 11:10:01] |
User29662 - Posts: 76 |
...have multiple studies use the same integer period parameter automatically. For instance, I want Study A, Study B, and Study C to all work off the same periodicity value. That way if I want to change the period value, I only have to change it in one place and all three studies adjust. This way I can flip through different period values without have to constantly adjust all three studies every time. |
[2017-01-05 18:32:03] |
Sierra Chart Engineering - Posts: 104368 |
integer period parameter
Are you referring to a study Input? Not supported in this case. Or to the Chart >> Chart Settings >> Intraday Chart Bar Period? 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 |
[2017-01-05 20:47:28] |
Merlin - Posts: 83 |
Are you talking about your own ACSIL studies? If so, I would think you could accomplish this using a global variable, as documented here: http://www.sierrachart.com/index.php?page=doc/ACSILProgrammingConcepts.html#GlobalVariables . Note - I haven't tested this! But if I wanted to accomplish what you're suggesting, this is what I would try: Have study A accept the periodicity value as an Input, and store it in the global variable. Then have studies B and C get their periodicity by reading the global variable, instead of as an input. When study A changes the value of the global variable, it can use sc.FlagFullRecalculate to cause all the studies on the chart to recalculate. It has to test whether this is really a new value by comparing the current vs. new values, and only trigger the recalc for genuine new values, otherwise you could get an endless loop. Also note the warning that global variables only work with sc.FreeDLL set to 0. Another approach would be to add a subgraph to Study A that just outputs the current period value, and have studies B and C read that subgraph. One of these two approaches should definitely work. :-) Good luck! Date Time Of Last Edit: 2017-01-05 20:48:00
|
[2017-01-05 22:54:24] |
User29662 - Posts: 76 |
Yes, I was referring to a study input. Thanks so much Merlin, I will try out your suggestions! |
[2017-01-06 18:58:42] |
Merlin - Posts: 83 |
I just noticed there is a third way to do this, which might be the best option. ACSIL allows a study to store and retrieve persistent variables: http://www.sierrachart.com/index.php?page=doc/ACSIL_Members_Functions.html#scGetPersistentInt What I didn't realize until now, is that Sierra also provides functions for one study to access the persistent variables of another study: http://www.sierrachart.com/index.php?page=doc/ACSIL_Members_Functions.html#scGetStudyPersistentIntFromChart This is a better solution than global variables, because it doesn't require sc.FreeDLL=0, which is a pain to work with when debugging. The code example in the GetStudyPersistent docs should give you everything you need to make this work. Cheers! |
[2017-01-07 02:27:52] |
User29662 - Posts: 76 |
I thought that may be a possibility but wasn't sure. I didn't want to head down that road and waste time if I was wrong. Thanks for confirming!!!
|
To post a message in this thread, you need to log in with your Sierra Chart account: