Support Board
Date/Time: Thu, 28 Nov 2024 18:44:12 +0000
Show/Hide Level Based on Proximity to Level
View Count: 500
[2023-04-12 04:36:27] |
User688525 - Posts: 259 |
Hello Sierra Chart, Similar to how an alert can be triggered once the symbol trades within "x" of a level, is it possible to show/hide a level (or study) based on proximity to a level? For example, if a chart has levels at 2000, 2020, 2040, 2060, etc., is it possible to only display the levels once the symbol is trading within 20 points of a level? In this example, if the ticker is trading at 2020, then the levels 2000, 2020 and 2040 would display, but not 2060. However, if the ticker trades at 2030, then the 2000 would no longer display, keeping 2020 and 2040 visible. Does Sierra Chart support the above out of the box? If not, can this be achieved with a custom study? Thank you |
[2023-04-12 04:54:22] |
Sierra_Chart Engineering - Posts: 17204 |
We do not know how these levels are implemented. Whether they are from a Study or a Chart Drawing. However, certainly you can create an ACSIL study to do exactly what you want.
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 |
[2023-04-12 07:13:03] |
User688525 - Posts: 259 |
Thank you for the assistance. The levels would either be from a drawing (Horizontal Line) or Study (Period OHLC-Variable Period, Initial Balance, etc.). If this isn't supported by Sierra out of the box and ACSIL is required, would the sc.HideStudy be the starting point? |
[2023-04-12 10:59:38] |
User688525 - Posts: 259 |
Another question related to the above: - When resetting a chart ("Reset Bar Size/Spacing/Scale"), if there is a study that has a value that is beyond the visible range (for example, a study has a value at 3500 when the ticker is trading at 4000), the chart will reset to display the study so that all is in view. When there is a wide range, the chart compresses to display the value. Is there a way to exclude a study from being included when the chart is reset? Thank you |
[2023-04-12 15:19:29] |
John - SC Support - Posts: 36350 |
With respect to your first question - if the line in question is from a study, then you could use the Color Bar Based on Alert Condition to color the line the same as the background when the price is not within the range, and then to "not" color it when the price is within range. Refer to the information here: Color Bar Based on Alert Condition Just note that you would need a single Color Bar Based on Alert Condition study for each line in question. So it would definitely be better to create a custom study. If you do, you do not want to hide the Study, you would want to hide the Subgraph for the study (sc.SetStudySubgraphDrawStyle()) With regards to your last question, refer to the following: Chart Scale and Scale Adjusting: Basing Scale Only on Price Bars For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2023-04-13 12:07:27] |
User688525 - Posts: 259 |
Hello John, The "Basing Scale Only on Price Bars" link solved the issue. Thank you. I am looking into creating a custom study for showing/hiding levels (drawing or study). In the meantime, are you able to share sample alert code that I can use with the "Color Bar Based on Alert Condition" study for the following scenarios: - If level (Line ID = "-3125") is > 20 points away from current price, then color - If level (Study ID = "15" / Subgraph ID = "3") is > 20 points away from current price, then color Thank you |
[2023-04-13 15:38:36] |
John - SC Support - Posts: 36350 |
You can not use the Color Bar Based on Alert Condition for a line drawing. For the second part, we assume you are giving us the situation where you want the "Color Bar Based on Alert Condition" to actually color the study. In which case it is just the following: =OR(ID15.SG3 > L + 20, ID15.SG3 < L - 20) For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2023-04-13 16:19:22] |
Sawtooth - Posts: 4120 |
- If level (Line ID = "-3125") is > 20 points away from current price, then color
Try this in a Color Bar Based on Alert Condition study:=OR(C > UDID[3125].A1+20,C < UDID[3125].A1-20) This assumes the line is horizontal, and extends across the entire chart. Study/Chart Alerts And Scanning: Referencing Chart Drawings There are limitations using the color bar study with line drawings. |
[2023-04-13 17:58:50] |
John - SC Support - Posts: 36350 |
What tomgilb is stating is correct - you can reference a drawing in the alert. But you can not change the color using the Color Bar Based on Alert Condition. And for what you are wanting to do, you can not change the color of a drawing (you can change the color of a drawing using the Drawing Alert, but it does not allow for complex options like what you need).
For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2023-04-16 13:57:53] |
User688525 - Posts: 259 |
Hi John & Tom, Thank you for the Alert Condition codes. After some extensive testing, a custom study will be required to achieve the desired functionality. In the interim, I am using the Horizontal Lines study which provides more functionality than a regular Horizontal Line. Cheers |
To post a message in this thread, you need to log in with your Sierra Chart account: