Login Page - Create Account

Support Board


Date/Time: Wed, 30 Apr 2025 07:45:56 +0000



[Programming Help] - Color bars alert is giving wrong output

View Count: 87

[2025-04-27 02:00:01]
Trade with ICE - Posts: 28
I don't know what im doing wrong here, but I think the formula is straightforward: color the candle that crosses the subgraph value.

I have HIGH/LOW FOR TIME PERIOD study that im referencing. ID8.SG1 and SG2
A COLOR BAR BASED ON ALERT CONDITON STUDY with alert:
=OR(CrossFromBelow(C, ID8.SG1), CrossFromAbove(C, ID8.SG1))

simply saying color the candle if it crosses the subgraph value but its not coloring the right candles.
Date Time Of Last Edit: 2025-04-27 02:20:03
imageScreenshot 2025-04-26 185117.png / V - Attached On 2025-04-27 01:59:23 UTC - Size: 24.06 KB - 21 views
imageScreenshot 2025-04-26 184223.png / V - Attached On 2025-04-27 02:19:57 UTC - Size: 21.43 KB - 19 views
[2025-04-27 02:22:34]
Trade with ICE - Posts: 28
i forgot to include what candle it is coloring... here you go.
Date Time Of Last Edit: 2025-04-27 02:23:26
imageScreenshot 2025-04-26 192105.png / V - Attached On 2025-04-27 02:22:25 UTC - Size: 15.41 KB - 23 views
imageScreenshot 2025-04-26 192309.png / V - Attached On 2025-04-27 02:23:20 UTC - Size: 25.1 KB - 19 views
[2025-04-28 16:10:53]
John - SC Support - Posts: 39559
The issue is that your "High/Low for Time Period" only covers that specific time. Since you are looking for a crossover event outside of that time frame, it will not occur, as the values for those lines do not exist beyond the specified time. Or, if you prefer, they do exist, but the values are zero, which is why you see the bars colored at the start and end of the High/Low for Time Period period.

You should use the "High/Low for Time Period - Extended" in order to have the line extended out further. Then you can see if a crossover event occurs beyond the given timeframe. Refer to the following:
High/Low for Time Period - Extended
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-04-29 23:19:01]
Trade with ICE - Posts: 28
Yea High Low for Time Period - Extended will not give the same value I wanted because I just wanted the high and low value of a specific time period. :(

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

Login

Login Page - Create Account