Login Page - Create Account

Support Board


Date/Time: Thu, 28 Mar 2024 14:03:41 +0000



[User Discussion] - Time in spreadsheets

View Count: 2014

[2013-12-30 03:42:59]
100 - Posts: 147
I have reviewed your examples of date and time functions,and I've been having some trouble using them.
Would someone please give me an example of shutting down a spreadsheet at a certain time?

I would like to shut the spreadsheet down at 4 pm.
I've tried saying 'A3<.57' and 'A3<840/1440'
Can someone tell me what I'm doing wrong?
or help me understand how to achieve this shutdown function?

Thank you for any help! Pce.
-100
[2013-12-30 04:07:03]
T44 - Posts: 363
Sierra Chart Spreadsheets store Dates and Times as double precision floating point numbers which represent the time since 1900-Jan-1 at 00:00. The integer part of the floating-point number represents the days and the fractional part, to the right of the decimal place, represents the time. This is exactly the same way as Excel and OpenOffice Calc represent date and Time values. This is called a Serial Date Time value.

http://www.sierrachart.com/index.php?l=doc/doc_WorksheetFunctions.html#SerialDateTimeValues

See also: http://www.sierrachart.com/index.php?l=doc/doc_SCDateTime.html

Sorry I don't have a specific example for you. Perhaps the simplest would be to read the current time, extract the hour, and check for hour==16. This can be done simply enough in ASCIL by referring to the example code, and then perhaps you could link this in with the sheet?

[2013-12-30 05:02:07]
Sawtooth - Posts: 3952
Use the TIMEVALUE function, like this in J29:

=J41-INT(J41)>TIMEVALUE("15:59:00")

or this in J28:

=OR(J41-INT(J41)<TIMEVALUE("09:30:00"),J41-INT(J41)>TIMEVALUE("16:00:00"))

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

Login

Login Page - Create Account