Login Page - Create Account

Support Board


Date/Time: Fri, 07 Feb 2025 15:13:14 +0000



[Studies] Hide Based on Condition

View Count: 1212

[2021-01-05 18:59:39]
SavantTrader - Posts: 110
Is there a way to hide a study (or its subgraph) based on a condition?

For example, let's say I have studies (Subgraph Add, Subgraph Subtract) that draw lines above/below a certain calculated value. I'd like to hide the one that is not relevant at the current price. In other words, if C > calculated value, hide the Subgraph Subtract subgraph (or study). If C < calculated value, hide the Subgraph Add (or study). Also, it would be nice to be able to specify a formula for turning a study (or subgraph) off between certain timeframes.
Date Time Of Last Edit: 2021-01-05 19:22:49
[2021-01-05 19:41:01]
John - SC Support - Posts: 37808
In general, a value of '0' is used to not draw a particular subgraph value, unless the option is set to draw zeros for that study.

As such, the easiest way to do what you want would be to use the Spreadsheet and hide the study used for Input and then use an IF condition where a '0' is output when you want to hide the graph and the original value is used when you want to display it. Refer to the information here:
https://www.sierrachart.com/index.php?page=doc/SpreadsheetFunctions.html#IF_Function

Another option to do what you are wanting is to use the Color Bar Based on Alert Condition study and set the coloring to be the same as the background.
Color Bar Based on Alert Condition
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-12-30 17:19:26]
usgvince - Posts: 23
Is there a way to hide a study or a group of studies with a button? The button would be similar to a chart time period button, but when you clicked on it either all or specific studies depending if the studies were associated with the button would hide on the chart.
[2021-12-31 14:57:33]
John - SC Support - Posts: 37808
There is not a way to do exactly what you are asking for.

But, there is the option of using the Study Collections to have one set of studies on the chart and then change them with a different Study Collection (removing the studies that you did not want on the chart). Refer to the following:
Study Collections
For the most reliable, advanced, and zero cost futures order routing, use 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