Time / CurrentTime

Questions about MultiCharts and user contributed studies.
HummerH1
Posts: 66
Joined: 13 Sep 2011
Has thanked: 6 times
Been thanked: 1 time

Time / CurrentTime

Postby HummerH1 » 15 Dec 2011

Hello,

I want to get the current time of the bar, while my chart time is not my computer time.

CurrentTime is giving me the time of my computer
Time is giving me the time when the bar will close

That means that if I have a 15 mins chart, and now the time in my chart is 12:13, I want to be able to get this time.
'Time' will give me in this case 1215 and not 1213
'CurrentTime' will give me 19:13 and I can't do anything with that.

Any solution?

Thanks

User avatar
TJ
Posts: 7743
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Time / CurrentTime

Postby TJ » 15 Dec 2011

Hello,

I want to get the current time of the bar, while my chart time is not my computer time.

CurrentTime is giving me the time of my computer
Time is giving me the time when the bar will close

That means that if I have a 15 mins chart, and now the time in my chart is 12:13, I want to be able to get this time.
'Time' will give me in this case 1215 and not 1213
'CurrentTime' will give me 19:13 and I can't do anything with that.

Any solution?

Thanks
are you using the Premium version or the Discretionary version?

HummerH1
Posts: 66
Joined: 13 Sep 2011
Has thanked: 6 times
Been thanked: 1 time

Re: Time / CurrentTime

Postby HummerH1 » 16 Dec 2011

premium

User avatar
TJ
Posts: 7743
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Time / CurrentTime

Postby TJ » 06 Mar 2012

Hello,

I want to get the current time of the bar, while my chart time is not my computer time.

CurrentTime is giving me the time of my computer
Time is giving me the time when the bar will close

That means that if I have a 15 mins chart, and now the time in my chart is 12:13, I want to be able to get this time.
'Time' will give me in this case 1215 and not 1213
'CurrentTime' will give me 19:13 and I can't do anything with that.

Any solution?

Thanks
Sorry for the late reply. Must have missed it because of the Christmas happenings.

You can add an adjustment to the time

eg.

Code: Select all


input:
time.adjustment(600);

var:
corrected.time(0);

corrected.time = currenttime - time.adjustment;


ps. This is only a concept. For proper time adjustments, you will need to use time serial numbers.

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Time / CurrentTime

Postby JoshM » 06 Mar 2012

ps. This is only a concept. For proper time adjustments, you will need to use time serial numbers.
For example:

Code: Select all

Inputs:
TimeZoneOffSet(0);
// To display the time in another regionale, enter whole hours here, for example -5 or 3

Variables:
tzOffset(ELTimeToDateTime(TimeZoneOffSet * 100)); // Time zone offset in DateTime format

Print("Time zone adjusted time: ", FormatTime(" HH:mm:ss ", ELTimeToDateTime_s(CurrentTime_s) + tzOffset) );


Return to “MultiCharts”