Login Page - Create Account

Support Board


Date/Time: Fri, 09 May 2025 19:40:32 +0000



[User Discussion] - Color Bar Based on Alert Condition Code Help

View Count: 2066

[2014-10-28 23:43:21]
User121729 - Posts: 37
I want to color a bar that has a short duration between its open and close..

For example if the the difference in the open and the close is less than X minutes or seconds.

So say the bar open time - bar close time is less than X seconds(or minutes) ...

What would the code look like ? This aimed at non timed based charts.

Thanks
[2014-10-29 00:14:56]
Sawtooth - Posts: 4214
Try this:
=BARTIME-BARTIME[-1]<TIMEVALUE("00:01:00")

This will color the previous bar if its duration is less than 1 min.

It is not possible to use Simple Alerts to alert/color on the duration of the current bar because the BARTIME is the Open, and there is no equivalent Identifier for the Last Bar End DateTime cell J41 found on spreadsheet studies.
Date Time Of Last Edit: 2014-10-29 13:03:22
[2014-10-29 12:01:43]
User121729 - Posts: 37
THanks! Just what I needed.
[2014-10-31 18:30:58]
User121729 - Posts: 37
OK... It colors the current bar.. How do I get it to color the previous bar? Is there a way to use the color bar on alert condition so that the bar it colors is the previous bar?

Thanks
Date Time Of Last Edit: 2014-10-31 18:32:41
[2014-10-31 19:19:32]
User11942 - Posts: 298
Right click on chart, click on "Studies" or "Study settings", then choose your "Color bar based..." study, go to "Subgraphs" tab, set "Displacement" value to -1.
[2014-10-31 19:41:25]
Sawtooth - Posts: 4214
Yes, thanks User11942, I forgot that detail.

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

Login

Login Page - Create Account