There's really only so much to go around so far. By selecting the longest time. But this is an additional cost of getting two time values at each OnBookEvent()...
Alexey Kozitsyn: There's really only so much to go around so far. By selecting the longest time. But it's additional expense of getting two time values at each OnBookEvent()...
EmulateTimeTradeServer via GetMicrosecondCount. Or add the difference between TimeTradeServer and TimeCurrent to 99% of BookEvent.
TimeTradeServer works through GetMicrosecondCount by adding the corresponding difference to TimeCurrent.
I don't know what you need to get. But saving on units of microseconds doesn't seem reasonable to me.
I need to get the correct value of current time. I'm requesting from OnBookEvent() of current time to write the value of parameter bound to time. And I need the current time, not the elapsed time, and preferably without the crutches of getting several time values and choosing the largest value. TimeCurrent() is supposed to handle this task (according to description in documentation). But it turned out that it doesn't do it now!
Alexey Kozitsyn: I need to get the correct value of the current time. I'm querying the current time from OnBookEvent() to write the value of the parameter linked to the time. And I need the current time, not the past time, and preferably without the crutches of getting multiple time values and selecting the highest value. TimeCurrent() is supposed to handle this task (according to description in documentation). But it turned out that it doesn't do that now!
You may have been more precise. For example, you could run through all symbols, calling SymbolInfoTick (+ CopyTicks). From there, scratch out the time in milliseconds. I just don't understand what practical use it could be.
There's really only so much to go around so far. By selecting the longest time. But it's additional expense of getting two time values at each OnBookEvent()...
Application to the SR#1674783
Please decide as soon as possible!
EmulateTimeTradeServer via GetMicrosecondCount. Either add the difference between TimeTradeServer and TimeCurrent in 99% of the BookEvent.
It is still a matter of getting a few parameters.
The question is not the number of parameters, but their total cheapness.
So, do you think that TimeTradeServer() will work faster than SymbolInfoInteger( _Symbol, SYMBOL_TIME )?
TimeTradeServer works through GetMicrosecondCount by adding the corresponding difference to TimeCurrent.
I don't know what you need to get. But saving money on microseconds doesn't seem reasonable to me.
TimeTradeServer works through GetMicrosecondCount by adding the corresponding difference to TimeCurrent.
I don't know what you need to get. But saving on units of microseconds doesn't seem reasonable to me.
I need to get the correct value of the current time. I'm querying the current time from OnBookEvent() to write the value of the parameter linked to the time. And I need the current time, not the past time, and preferably without the crutches of getting multiple time values and selecting the highest value. TimeCurrent() is supposed to handle this task (according to description in documentation). But it turned out that it doesn't do that now!
{
static ulong PrevStartTime = GetMicrosecondCount();
static datetime PrevTimeCurrent = TimeCurrent(); // TimeTradeServer()
const datetime NewTimeCurrent = TimeCurrent(); // TimeTradeServer()
const ulong NowTime = GetMicrosecondCount();
if (PrevTimeCurrent < NewTimeCurrent)
{
PrevTimeCurrent = NewTimeCurrent;
PrevStartTime = NowTime;
}
return(PrevTimeCurrent + (datetime)((NowTime - PrevStartTime) / 1000000));
}
Run through all symbols by querying SymbolInfoTick (+ CopyTicks). From there, scratch out the time in milliseconds.