Libraries: CheckHistory - Check and load history function

 

CheckHistory - Check and load history function:

Slightly modified history load function from MetaQuotes

Author: Andrey Khatimlianskii

 

Hello,


I have two questions concerning your code.

Within the function

CheckServerHistory() 

CheckServerHistory(...)
{
        ...
        if(first_server_date>TimeCurrent()-size*PeriodSeconds(period)) return(false);
        ...
}

Will this really work, because the time difference and the counting of periods is different when taking market closes into account?


In the function

CheckLoadHistory()

CheckLoadHistory(...)
{
        if(CheckTerminalHistory(symbol,period,size) || CheckServerHistory(symbol,period,size))
        { ... }
}


Here the execution is first checking terminal data and after that it checks server data. 

Does it make sence to do it the other way around?

Reason: