Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 21:57:10 +0000



[User Discussion] - Help with Color bar based on alert condition

View Count: 340

[2024-02-12 10:42:16]
User733263 - Posts: 7
Hi Team, I want the “Color bar based on alert condition” study to evaluate bartime for a specific volume bar and overlay/color the chart if the barends below a specific time. For. E.g I use 2500 volume bar on ES, and I want the study to highlight the bar when it completes within 10 seconds. How can I code this in the study?

I already use Number bars calculated study to alert me on other parameters such as delta. I see Number bars calculated values study’s SubGraph 30 gives bar duration. I just can’t seem to find information on the formula to use to evaluate this condition. Any help is greatly appreciated.
[2024-02-12 13:51:56]
User43 - Posts: 101
did you try this study?
Bar Time Duration
[2024-02-12 13:56:58]
User733263 - Posts: 7
I did, but can't seem to get the syntax of the alert formula right.The goal for me is to overlay this information on my chart as signals.
[2024-02-12 14:41:36]
Sawtooth - Posts: 4120
I just can’t seem to find information on the formula to use to evaluate this condition.
The Bar Time Duration study, and SG30 of the Numbers Bar Calculated Values study, both output the bar duration in SCDateTime format.
If you use SG30, then follow these instructions from the documentation:
Bar Duration: This is the time duration of the chart bar. The actual numeric value is a SCDateTime. This value can also be referenced in an Alert Condition Formula. This particular Numbers Bars Calculated Value is Subgraph 30. An example Alert Formula is SG30 < TIME(0, 0, 30). This means when the Bar duration is less than 30 seconds return TRUE. For this to be properly evaluated it is necessary to enable the Use Full Precision when Evaluating Alert Formula Alert Option.
Numbers Bars: Numbers Bars Calculated Values Subgraph Descriptions

If you use the Bar Time Duration study, then you could use the same formula:
=ID1.SG1 < TIME(0, 0, 10)
where ID1 is Bar Time Duration study.
Or this:
ID1.SG1*86400 < 10
Spreadsheet Example Formulas and Usage: Formula Equivalents of Serial Date Time Values
[2024-02-12 17:43:15]
User733263 - Posts: 7
That worked thank you. The trick was making sure to check the "use full precision".

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

Login

Login Page - Create Account