Login Page - Create Account

Support Board


Date/Time: Fri, 19 Apr 2024 13:41:31 +0000



[User Discussion] - use of time bar duration

View Count: 1491

[2019-05-25 00:27:18]
User259724 - Posts: 43
I would like to use the bar time duration as part of a calculation. I would need to convert the time to a standard decimal format. In other words a time of 6:14 would need to be 6 + 14/60 which would be 6.23 rounded to 2 decimals. A time of 30 seconds would be 0.5 etc. How may I convert bar time duration to standard decimal format? Also on a fast moving tic chart sometimes at news the bar duration is occasionally zero which cannot be used in calculations. Is it possible for a bar duration of zero to have it converted to 1 for calculation purposes?
Thanks
Date Time Of Last Edit: 2019-05-25 00:30:06
[2019-05-25 00:53:43]
Sawtooth - Posts: 3973
The Serial DateTime format uses an integer for each day and a decimal for portions of a day, IOW: days.decimal
Since there are 1440 minutes in 24 hours, to convert the Bar Time Duration study's output to minutes.decimal, use a formula like this:
=ID1.SG1*1440
where the Bar Time Duration is ID1; edit as needed.

If you are using a spreadsheet study, the syntax would be:
=ID1.SG1@3*1440
Date Time Of Last Edit: 2019-05-25 01:05:56
[2020-07-09 01:41:00]
User459170 - Posts: 262
Is there some way to use the bar duration study (or something else) to get the chart bar period value and display it boldly somewhere on the chart?
[2020-07-09 02:16:48]
Sawtooth - Posts: 3973
To display the current bar's accumulating duration:
- Add the Bar Time Duration study, and Hide it
- Add the Text Display for Study study
---set the Value Format to Time
---set the Study and Subgraph to Display to the Bar Time Duration study
[2020-07-09 02:21:15]
User459170 - Posts: 262
I have already tried that, but it shows the count down unfortunately.
Date Time Of Last Edit: 2020-07-09 02:21:42
[2020-07-09 03:45:29]
Sawtooth - Posts: 3973
It shows the count up, in seconds for me.
[2020-07-09 03:51:34]
User459170 - Posts: 262
Thanks so much. It show the counter, thats the thing. I want it to just show 5.00 (for 5 mins) and not count down. Is that possible?
Date Time Of Last Edit: 2020-07-09 03:55:47
[2020-07-09 03:55:17]
Sawtooth - Posts: 3973
I want it to just show 5.00 and not count down. Is that possible?
Yes, if the bars are 5 min bars.

In the Text Display for Study settings, set the Subgraph Columns Back to 1.
[2020-07-09 04:11:14]
User459170 - Posts: 262
Thank you so much!!! Its working perfectly! Thanks for the help!!

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

Login

Login Page - Create Account