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.
Timing tick to tick
Re: Timing tick to tick
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?
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?
Re: Timing tick to tick
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);
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 530 times
Re: Timing tick to tick
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.
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.
Re: Timing tick to tick
A Tick Rate template for seconds, changing some lines gives it in milli- or microseconds.
http://www.hightick.com/TS/In ... index.html
http://www.hightick.com/TS/In ... index.html
Re: Timing tick to tick
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
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
Re: Timing tick to tick
I'm using GetMachineTime.dll in a 500 millisecond delay process
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?
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;
Is there another way to create a 500 ms delay?
Re: Timing tick to tick
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;
Re: Timing tick to tick
Thank SPNot 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;
Seconds.delay function is not loaded. Can i get it?
Martin