Support Board
Date/Time: Fri, 07 Feb 2025 18:03:00 +0000
How to color subgraph study lines based on +/- of an independent (non-zero) horiz. line?
View Count: 111
[2025-01-04 15:51:43] |
User708541 - Posts: 107 |
I'd like to be able to color the lines of a study like ADX or other studies so they change color, weight, line type at a horizontal line location of my choosing. A line location not at zero. How can this be done? I'm not interested in changing the price bars, only the lines of a study. Many studies, like ADX, have no built in horizontal line. So, I'm using the Horizontal Line study which places a line at my desired location. I'd like to have ADX reference that horiz. line and change its color if its above or below it. |
[2025-01-04 19:12:13] |
Sierra_Chart Engineering - Posts: 18330 |
You are only able to change the color. And this can be done with the Color Bar Based on Alert Condition study: Color Bar Based on Alert Condition Specifically refer to: Color Bar Based on Alert Condition: Coloring Subgraphs of Other Studies 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, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2025-01-04 21:48:03] |
User708541 - Posts: 107 |
Reading the information in the link you provided and following the steps, the instructions don't mention how to reference the horizontal line I've placed. If I want the ADX to change color when it's above the horiz. line that's placed in the subgraph using the Horizontal Line study I don't see how this would be done. Would I have to create an Alert code that somehow references the horiz. line and then write an Above/Below alert? |
[2025-01-06 15:28:23] |
John - SC Support - Posts: 37827 |
Would I have to create an Alert code that somehow references the horiz. line and then write an Above/Below alert?
Yes, this is exactly what you need to do. To test if the ADX is greater than the Horizontal Line from the Horizontal Line study, your formula would look like the following: =ID1.SG1 > ID2.SG1 Where ID1 is the ID of the ADX study, the .SG1 after ID1 is the first subgraph (ADX) of the ADX study, ID2 is the Horizontal Line study and the .SG1 after ID2 is the first subgraph of the Horizontal Line study. 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: