# Seconds in Easy Language

Questions about MultiCharts and user contributed studies.
johnchan
Posts: 22
Joined: 07 Sep 2006

### Seconds in Easy Language

Is it possible to extract time in HH:MM:SS format (ie including seconds) in MultiCharts using easy language code in some way.

TJ
Posts: 7379
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 996 times
Been thanked: 2108 times
http://www.tssupport.com/support/tutorials/

https://www.TS.com/support/bo ... _Guide.pdf

look under Chapter 2
Manipulating Dates and Times: page 15

Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:
Johnchan,
MultiCharts 3.0 beta has detailed documentation of PowerLanguage fucntions. EL doesn’t have second timestamps, but we do. Simply run PowerLanguage Editor and see Dictionary at the right part of the working space. Alternatively you can press F1 in MultiCharts. He is a list of functions if you don't have MC 3.0 installed and using MC 2.1

____________________
CurrentTime_s
Returns a numerical value indicating the computer's current time, including seconds. The time is indicated in the 24-hour HHmmss format, where 130000 = 1:00:00 PM.
Usage
CurrentTime_s
Examples
CurrentTime_s will return a value of 101525 for 10:15:25 AM
______________________

ELTimeToDateTime_s
Returns the fractional portion of a double-precision decimal DateTime value corresponding to the specified time, including seconds. The time is specified in the 24-hour HHmmss format, where 130000 = 1:00:00 PM.

The integer portion of the DateTime value indicates the number of days that have elapsed since January 1st, 1900, and the fractional portion of the DateTime value indicates the fraction of the day that has passed since midnight.
Usage
ELTimeToDateTime_s(HHmmss)

Where: HHmmss - a numerical expression specifying the time
Examples
ELTimeToDateTime_s(101525) will return a value of 0.427372685, corresponding to the specified time of 10:15:25 AM

ELTimeToDateTime_s(154500) will return a value of 0.656250000, corresponding to the specified time of 3:45:00 PM
_________________________
Time2Time_s
Returns a numerical value indicating the time in the HHmmss format, corresponding to the specified time in the HHmm format.

The time is returned in the 24-hour HHmmss format, where 130000 = 1:00:00 PM, and specified in the 24-hour HHmm format, where 1300 = 1:00 PM.
Usage
Time2Time_s(HHmm)

Where: HHmm - a numerical expression specifying the time
Examples
Time2Time_s(1015) will return a value of 101500

Time2Time_s(1545) will return a value of 154500

CurrentTime_s will return a value of 154500 for 3:45:00 PM
______________________
DateTime2ELTime_s
Returns a numerical value indicating the time, including seconds, from the specified DateTime value. The time is indicated in the 24-hour HHmmss format, where 130000 = 1:00:00 PM.

The integer portion of the DateTime value specifies the number of days since January 1st, 1900, and the fractional portion of the DateTime value specifies the fraction of the day since midnight.
Usage
DateTime2ELTime_s (DateTime)

Where: DateTime - a double-precision decimal DateTime value
Example
DateTime2ELTime_s(39449.646354167) will return a value of 153045, indicating 3:30:45 PM
___________________________

johnchan
Posts: 22
Joined: 07 Sep 2006

### Time in Seconds

Thank you so much for your help. Works Fine.
JC

Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:
You are welcome!

TJ
Posts: 7379
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 996 times
Been thanked: 2108 times
is it possible to use seconds in arw_new or tl_new ?

Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:
yes, it is.

RWDickinson
Posts: 43
Joined: 01 Dec 2008
Has thanked: 2 times
Been thanked: 2 times
*********
update
*********
Ah! time_s, which is the answer to original question, was not in the list pasted into the answer by support, and is not documented in the Dictionary of the PLEditor. And is not in the MC 3.1 help file.

***********
original post
***********
Am I missing something? The original question was whether it was possible to get the seconds (instead of always 00) from a chart timestamp. The answers all indicated conversion functions that will preserve seconds if you put them in, or that will collect seconds info from the *computer* clock, not the chart timestamp. I have the same question as the original, and don't see an answer here. Again: did I miss something?

TJ
Posts: 7379
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 996 times
Been thanked: 2108 times
if you look into your directory:

c:\program files\ts support\multicharts

you will find 2 help files: (compiled HTML Help files)

MultiCharts.chm
PowerLanguage.chm

you will find the dictionary useful.

Also:

in the PowerLanguage Editor, look under:

View>Navigator Bar

all the Keywords are in the dictionary.

RWDickinson
Posts: 43
Joined: 01 Dec 2008
Has thanked: 2 times
Been thanked: 2 times
In both of those help files for my version (3.1), time_s is undocumented.

Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007
Hi Rob,

It is there in the Help file. Below am pasting an excerpt from the Help file.

Time_s
Returns a numerical value indicating the closing time, including seconds, of the current bar. The time is indicated in the 24-hour HHmmss format, where 130000 = 1:00:00 PM.
Usage
Time_s
Examples

Time_s will return a value of 101525 for 10:15:25 AM
Time_s will return a value of 154500 for 3:45:00 PM

RWDickinson
Posts: 43
Joined: 01 Dec 2008
Has thanked: 2 times
Been thanked: 2 times
Ah, yes. Now I see it Marina. I was looking under "Date and Time Routines" (silly me - how obvious that it would not be there!).

JoshM
Posts: 2184
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1539 times
Been thanked: 1540 times
Contact:

### Re:

is it possible to use seconds in arw_new or tl_new ?
When using Text_New_s, TL_New_s and Arw_New_s, is there a way to force MultiCharts to use the BarNumber for plotting instead of the Time_s?

On lower resolutions, when it's possible that multiple consecutive bars have the same seconds time stamp, using Time_s doesn't work (in practice) since it will anchor the objects on the wrong bar. It would be great if it's possible to draw those objects 'on this bar', so that these get plotted on the bar that triggered the 'draw object condition', and not on the first bar of a series of bars that have the same Time_s time value.

Does someone know if, and how, this can be done?

Edit:
According to this post from 2008 that wasn't then possible. How about now?

Also see the image below with the ES with a 4 Point resolution (which generally isn't that low/quick).

Code: Select all

``` vars: rsiValue(0); rsiValue = RSI(Close, 7); if rsiValue > 50 and rsiValue > rsiValue[1] then arw_new_s(Date, Time_s, High + (High - Low), True); ```
Regards,
Josh
Attachments
timeProblem.PNG

TJ
Posts: 7379
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 996 times
Been thanked: 2108 times

### Re: Re:

is it possible to use seconds in arw_new or tl_new ?
When using Text_New_s, TL_New_s and Arw_New_s, is there a way to force MultiCharts to use the BarNumber for plotting instead of the Time_s?
...
Regards,
Josh
no, you cannot use barnumber to draw objects.