Login Page - Create Account

Support Board


Date/Time: Wed, 02 Jul 2025 05:51:57 +0000



[User Discussion] - Offering To The Community: Show/Hide studies using ACS buttons on a Control Bar

View Count: 1302

[2018-03-01 12:10:16]
aknsyu71@gmail - Posts: 59
I have created a ACSIL script to achieve this for my own purposes and would like to share this with anyone finding this usefull.

The script will make it possible to show or hide 5 studies from a chart by a using buttons on a control bar.
To set this up:
- Add 5 ACS buttons (choice of 150) to a control bar
- Map these 5 button numbers in the "Show/Hide studies" script to the 5 studies you'd like to show/hide
- Choose the 5 studies in the script which you'd like to show/hide

The Sierra chart control bar only allows one button to be depressed at a time so in order to allow the show/hide state to be indicated on the buttons the text of the button changes between "StudyName" and "StudyName OFF" depending on its state.

Please be aware that if you are using a study like "Trade Managment by Study" which also has an option to use a ACS button then keep in mind to not use the same button numbers and not to have the Trademanagement buttons on the same control bar as the show/hide buttons since the TradeManagement study will be disabled every time a show/hide button is pressed.
attachmentShowHideStudiesACS.cpp - Attached On 2018-03-01 11:52:07 UTC - Size: 6.58 KB - 506 views
attachmentShowHideStudiesACS.dll - Attached On 2018-03-01 12:04:16 UTC - Size: 811 KB - 399 views
[2020-12-31 20:00:58]
User542430 - Posts: 50
Thank you for this study. I tried to compile it and got errors. is there an updated version available?
[2021-01-02 01:15:19]
Flipper - Posts: 65
Looks like this function, sc.SetACSToolEnable() has been changed to this sc.SetCustomStudyControlBarButtonEnable()

so change this in the .cpp file

// reset buttons so none look pressed in
    sc.SetACSToolEnable(ACS1button.GetInt(),FALSE);
    sc.SetACSToolEnable(ACS2button.GetInt(),FALSE);
    sc.SetACSToolEnable(ACS3button.GetInt(),FALSE);
    sc.SetACSToolEnable(ACS4button.GetInt(),FALSE);
    sc.SetACSToolEnable(ACS5button.GetInt(),FALSE);

to this

// reset buttons so none look pressed in
  sc.SetCustomStudyControlBarButtonEnable(ACS1button.GetInt(), FALSE);
  sc.SetCustomStudyControlBarButtonEnable(ACS2button.GetInt(), FALSE);
  sc.SetCustomStudyControlBarButtonEnable(ACS3button.GetInt(), FALSE);
  sc.SetCustomStudyControlBarButtonEnable(ACS4button.GetInt(), FALSE);
  sc.SetCustomStudyControlBarButtonEnable(ACS5button.GetInt(), FALSE);

And it complied for me. (didn't actually check its functinality though!)
[2021-01-02 01:41:22]
User542430 - Posts: 50
Worked perfect. Thanks for taking the time to fix it!
[2021-01-05 22:02:35]
User542430 - Posts: 50
Update for those interested in using this tool,

While it does work as intended, I have discovered that it adds a very noticeable amount of lag/chopiness to any chart that I use the study on. Took me a while to pin down that this was the culprit. Hopefully I save someone else the trouble.

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

Login

Login Page - Create Account