LastcalcDate & LastCalcTime  [SOLVED]

Questions about MultiCharts and user contributed studies.
bowlesj3
Posts: 2090
Joined: 21 Jul 2007
Has thanked: 197 times
Been thanked: 416 times

LastcalcDate & LastCalcTime

Postby bowlesj3 » 01 Jul 2018

Hi,

I am studying some of my old scripts in prep for writing a script. I noticed that the commands LastcalcDate & LastCalcTime can not be found in the wiki nor in the help. They are not in the general date and time wiki page either.
https://www.multicharts.com/trading-sof ... e_Routines

I used them a number of times. Here is an example of one time I used them with a comment.
Arw1Date = LastcalcDate; {LastCalcDate & LastCalcTime are the date and time of the LastBarOnChart available even back on currentbar = 1}
Arw1Time = MinutesToTime(TimeToMinutes(LastCalcTime) + BarsForwardToPlaceArrow); {Place arrow X bars forward of the LastBarOnChart}

I did a few tiny updates to the wiki once but I never really understood how to update it and the little I knew is gone. Someone might want to update at least the wiki. I am sure some future users would appreciate it. When I saw these commands after many years away I was not even sure what they did until I found these commands in my database reminder system with a string search.

Thanks,
John

User avatar
TJ
Posts: 7157
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 988 times
Been thanked: 2041 times

Re: LastcalcDate & LastCalcTime

Postby TJ » 01 Jul 2018

LastcalcDate & LastCalcTime are functions, not keywords.

User avatar
TJ
Posts: 7157
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 988 times
Been thanked: 2041 times

Re: LastcalcDate & LastCalcTime

Postby TJ » 01 Jul 2018

LastCalcDate (Function)


The LastCalcDate function returns the date for the last completed bar.

Syntax
LastCalcDate

Returns (Integer)
A numeric value containing the date of the last bar in YYYMMDD format.

Parameters
None

Remarks
For example, if the function returns 960203, it means the last bar was on 02/03/96, or February 3, 1996.

Example
Value1 = LastCalcDate;

See Also
LastCalcTime

User avatar
TJ
Posts: 7157
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 988 times
Been thanked: 2041 times

Re: LastcalcDate & LastCalcTime

Postby TJ » 01 Jul 2018

LastCalcTime (Function)


The LastCalcTime function returns the time of the last completed bar, in 24-hour military format (HHMM).

Syntax
LastCalcTime

Returns (Integer)
A numeric value containing the time of the last completed bar in 24-hour (HHMM) format.

Parameters
None

Remarks
For example, if the function returns 1700, the last bar was completed, or closed, at 5:00pm.

Example
Value1 = LastCalcTime;

See Also
LastCalcDate

bowlesj3
Posts: 2090
Joined: 21 Jul 2007
Has thanked: 197 times
Been thanked: 416 times

Re: LastcalcDate & LastCalcTime

Postby bowlesj3 » 01 Jul 2018

Interesting. Now that you point this out I seem to remember seeing these functions before (I did a scan of all the supplied functions at one point). So that leads to a question. Why does the wiki have to be limited to keywords when these functions are supplied with MC? Might it not be a good idea to have a section of the wiki for supplied functions and the keyword searches would also search this section?

User avatar
Anna MultiCharts
Posts: 405
Joined: 14 Jul 2017
Has thanked: 28 times
Been thanked: 103 times

Re: LastcalcDate & LastCalcTime

Postby Anna MultiCharts » 03 Jul 2018

Hello, bowlesj3!

You can view the logic of the pre-built functions in their code. They can be split into elementary keywords that are described in Help of the PowerLanguage Editor, so you can understand the function’s logic from them.

bowlesj3
Posts: 2090
Joined: 21 Jul 2007
Has thanked: 197 times
Been thanked: 416 times

Re: LastcalcDate & LastCalcTime  [SOLVED]

Postby bowlesj3 » 03 Jul 2018

Hello, bowlesj3!

You can view the logic of the pre-built functions in their code. They can be split into elementary keywords that are described in Help of the PowerLanguage Editor, so you can understand the function’s logic from them.

Thanks Anna,

your reply reminded me of a forum thread I once created called "MultiCharts/EasyLanguage learning strategies" (link below).
viewtopic.php?f=1&t=11741

The reason your comment triggered the memory of this post was I recommended new users study all the build in code supplied with MC. I sort of did that but many times reading just the code was just too overwhelming when I was in a rush to get my scripts going. So that is one problem with the idea. Many of them have no comments that could help. Although I don't remember what I wrote in that post I am pretty sure I never included this tip which is an extension of your comment. "You can click the help tab at the bottom of the Power Language Editor and highlight any keyword and press F1 to see the help at the bottom for that keyword. You can also drag the separator line up so you can see more of the help text".

The interesting part is once again, I am in a rush to get some script ideas coded up and I don't really have the time to study the code keyword by keyword. Many of my scripts I am revisiting. I put in some comments but now I wish I had commented a lot more thoroughly. Figuring some of them out again can be challenging to say the least even though I wrote them.

User avatar
Anna MultiCharts
Posts: 405
Joined: 14 Jul 2017
Has thanked: 28 times
Been thanked: 103 times

Re: LastcalcDate & LastCalcTime

Postby Anna MultiCharts » 06 Jul 2018

bowlesj3,

We'll concider adding the description for the functions to the PowerLanguage Help, thank you for your suggestion.
At the moment you can refer to the additional information sources for PowerLanguage/EasyLanguage programming in order to find the description of the functions:
https://www.multicharts.com/trading-sof ... on_Sources


Return to “MultiCharts”