Errors, bugs, questions - page 1808

 
fxsaber:
_TimeCurrent = MathMax(SymbolInfoInteger(Symbol1, SYMBOL_TIME), SymbolInfoInteger(Symbol2, SYMBOL_TIME), ...);
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.
 

Application to the SR#1674783

Please decide as soon as possible!

 
fxsaber:
EmulateTimeTradeServer via GetMicrosecondCount. Either add the difference between TimeTradeServer and TimeCurrent in 99% of the BookEvent.
This is still getting multiple parameters.
 
Alexey Kozitsyn:
It is still a matter of getting a few parameters.
The issue is not the number of parameters, but their total cheapness.
 
fxsaber:
The question is not the number of parameters, but their total cheapness.
So you think that TimeTradeServer() will be faster than SymbolInfoInteger( _Symbol, SYMBOL_TIME )?
 
Alexey Kozitsyn:
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.

 
fxsaber:

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!
I haven't checked it.
datetime NewTimeCurrent( void )
{
  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));
}
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.
 
fxsaber:
Run through all symbols by querying SymbolInfoTick (+ CopyTicks). From there, scratch out the time in milliseconds.
A millisecond analog of TimeCurrent is long overdue, with its reflection in the GUI.
Reason: