Support Board
Date/Time: Thu, 26 Jun 2025 08:57:12 +0000
Spreadsheet programming question - FRACTIME
View Count: 983
[2021-12-04 20:07:01] |
User183724 - Posts: 194 |
I have a 5 minute chart with a spreadsheet study. In column AN, I have this formula =FRACTIME(A3)-FRACTIME(A4). I'm looking for the difference between the last two FRACTIMES. Im getting the following results: 0.00347222222222221 row 3 0.00347222222222221 row 4 0.003472222210648135 <========= ... 0.003472222233796285 <========= 0.00347222222222221 0.00347222222222221 0.003472222222222321 <========= 0.00347222222222221 0.00347222222222221 0.00347222222222221 0.00347222222222221 0.003472222210648135 <========= 0.003472222233796285 <========= 0.00347222222222221 0.00347222222222221 0.003472222222222321 <========= 0.00347222222222221 0.00347222222222221 appears to me to be the 'correct' answer and those 'hiccups' are where the sheet updates. I understand they are double float numbers and will be slightly different based on updates. Could someone with better math skills please explain just how long the updates take and maybe a little on the time keeping in general. Ive read all I can find on time keeping including the following but cant quite make sense of it. Spreadsheet Functions: Serial DateTime Values Spreadsheet Example Formulas and Usage thx tim |
[2021-12-04 22:34:52] |
Sawtooth - Posts: 4231 |
Column A is the bar's Open timestamp, so on a 5 min chart, the difference is always going to be 5 min. 0.003472222222222222 is 5 min (300 sec) in SerialDateTime 5/1440 = 0.003472222222222222 300/86400 = 0.003472222222222222 If you want to compare the current bar's Open time to the current intrabar time, use J41: =FRACTIME($J$41)-FRACTIME(A3) Or you could use the Bar Time Duration study. |
[2021-12-06 16:19:07] |
John - SC Support - Posts: 40605 |
The results you see that are not quite "perfect" is due to floating point error. Refer to the following: Working with Spreadsheets: Floating-Point Values and Comparisons When Using the Spreadsheet Study For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
To post a message in this thread, you need to log in with your Sierra Chart account: