Timing tick to tick

Questions about MultiCharts and user contributed studies.
Nick
Posts: 496
Joined: 04 Aug 2006
Has thanked: 4 times
Been thanked: 24 times

Timing tick to tick

Postby Nick » 23 May 2011

Is there anyway to measure the time difference between tick N and tick N+1 to millisecond or better resolution? I understand that the database is only 1 second resolution but can I accurately measure the timing on ticks for live data?

My hunch is no though I notice there is a reserved word MillisecondsFromDateTime that is reserved for future use but it is not implemented yet.

Is there another way to do it? If not can I ask that this reserved word it is implemented?

The reason I want it is to write a 'trade intensity' indicator, something that has proved very useful to me in the past.

Nick
Posts: 496
Joined: 04 Aug 2006
Has thanked: 4 times
Been thanked: 24 times

Re: Timing tick to tick

Postby Nick » 24 May 2011

Well it appears ComputerDateTime should return the time since midnight from the computers real time clock. It seems to truncate this at seconds. Is this working as intended? It would have zero effect on other functions to return the full time.

I understand the limitations of the database but limiting timing to second resolution on live data I can see absolutely no reason for?

Have I missed something here?

SP
Posts: 465
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 286 times

Re: Timing tick to tick

Postby SP » 24 May 2011

Nick,
put the dll into the multicharts folder.

This should give you the time with milliseconds.

DefineDLLFunc: "GetMachineTime.dll", Long,"MachineTimeMill";
If LastBarOnChart Then Print("HHMMSSMMM",MachineTimeMill:1:0);
Attachments
GetMachineTime.dll
(17 KiB) Downloaded 526 times

Nick
Posts: 496
Joined: 04 Aug 2006
Has thanked: 4 times
Been thanked: 24 times

Re: Timing tick to tick

Postby Nick » 25 May 2011

Thanks SP! I had a copy of the getmachinetime.dll however the sample code I had did not have the MachineTimeMill parameter and so was only returning seconds.

Still it does seem that ComputerDateTime should return full PC clock resolution. Multicharts must actively mask out the highest resolution bits in between getting the value from the windows API & returning it through the power language function. This 'masking out' should be removed imho.

SP
Posts: 465
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 286 times

Re: Timing tick to tick

Postby SP » 25 May 2011

A Tick Rate template for seconds, changing some lines gives it in milli- or microseconds.

http://www.hightick.com/TS/In ... index.html

Nick
Posts: 496
Joined: 04 Aug 2006
Has thanked: 4 times
Been thanked: 24 times

Re: Timing tick to tick

Postby Nick » 25 May 2011

Neat, thanks for the link.

Pretty much what i have just coded, though I am looking at volume intensity rather than tick intensity. Turning points often come right after a pop in intensity.

OOEL looks like it has a couple of neat features...e.g. timer objects

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Timing tick to tick

Postby arjfca » 05 Jul 2011

I'm using GetMachineTime.dll in a 500 millisecond delay process

Code: Select all

//Function MachineTime
DefineDLLFunc: "GetMachineTime.dll", Long,"MachineTimeMill";
MachineTime = MachineTimeMill;

//Indicator DisplayTime

Var:
TargetTime (0),
Delay (500);

Targettime = MachineTime + delay;
While Value1 =0 begin
if machinetime >= Targettime then
begin
print (Targettime);
Targettime = MachineTime + delay;
end;
end;
It work fine, but froze MC when i tried to turn the DisplayTime Indicator to Off.

Is there another way to create a 500 ms delay?

SP
Posts: 465
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 286 times

Re: Timing tick to tick

Postby SP » 05 Jul 2011

Not tested if it works with Seconds.Delay < 1.

Code: Select all


inputs : Seconds.Delay (0.5);
vars : Targettime(0);

if ComputerDateTime > Targettime then
begin
Targettime= ComputerDateTime+(Seconds.Delay*0.0000115740) ;
if lastbaronchart then print (Targettime);
end;

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Timing tick to tick

Postby arjfca » 05 Jul 2011

Not tested if it works with Seconds.Delay < 1.

Code: Select all


inputs : Seconds.Delay (0.5);
vars : Targettime(0);

if ComputerDateTime > Targettime then
begin
Targettime= ComputerDateTime+(Seconds.Delay*0.0000115740) ;
if lastbaronchart then print (Targettime);
end;
Thank SP

Seconds.delay function is not loaded. Can i get it?

Martin

SP
Posts: 465
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 286 times

Re: Timing tick to tick

Postby SP » 06 Jul 2011

Seconds.delay is a normal input, not a function.

bstrader
Posts: 15
Joined: 25 Jul 2012
Has thanked: 5 times
Been thanked: 1 time

Re: Timing tick to tick

Postby bstrader » 14 Aug 2012

Hi,

can somebody provide the dll for 64bit MC EL?

thank you,

Stephan


Return to “MultiCharts”