Login Page - Create Account

Support Board


Date/Time: Fri, 20 Sep 2024 09:23:05 +0000



[User Discussion] - Syntax in Alert for the study "Bar Time Duration"

View Count: 1428

[2014-10-01 04:11:48]
FFTrader - Posts: 180
I want to add a study alert such that if the study Bar Time Duration is above a threshold, it will color the bar, etc.

If for example, I want the condition to be "greater than 5 minutes and 00 seconds", I have the Study Alerts set as (as per the time format displayed):

= ID1.SG1>00:05:00

I also tried (as in 300 seconds):

= ID1.SG1>300

and also tried (as in 1/12 of an hour):

= ID1.SG1>0.08333

All of the above format yielded nothing or a syntax error. I also tried randomly putting in a number too.

What should be the correct syntax when referring to the Bar Time Duration study?
Date Time Of Last Edit: 2014-10-01 04:16:20
[2014-10-01 05:10:27]
Sawtooth - Posts: 4091
The output of the Bar Time Duration is in SerialDateTime format, without the date. This means you must convert the time to this format. One way is to use the TIMEVALUE spreadsheet function, like this:
=ID1.SG1>TIMEVALUE("00:05:00")

Another way to do it would be:
=ID1.SG1>5/1440

You had the correct idea to try 1/12 of an hour, but the format is based on a portion of a 24 hour day, not an hour. Since you want 5 minutes, and since there are 1440 minutes in a 24 hour day, 5/1440 gives you the correct value.

[2014-10-01 08:02:45]
FFTrader - Posts: 180
Thanks!

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

Login

Login Page - Create Account