History Centre updated - free history of minute quotations since 1999 - page 8

 
Rosh:
Alas, put the "Max bars on the chart" (around 3 million for today) and you can watch any date.
i.e. it is not possible to set an arbitrary segment?
For example, only August 2005?
 
No, and why. The article 'Secrets of the MetaTrader 4 Client Terminal' describes some useful things that make life easier, here is one of them:

 
Have you ever wanted to remove the limit on the number of bars in the history and window in general? Or make a checkbox like unlimited. This would make the users have no questions about it at all.
It is possible to replace the limitation on the number of bars in the window with a smarter logic of swapping the history from a file. There will be a buffer for display if we shift on the data outside of this buffer then in this buffer is loaded from a file new history data instead of previous - it can scrolling lags a little bit at it, of course. Although if the entire history is loaded or as scrolling in the depth of the history can be placed in a buffer created by VirtualAlloc in this case the memory will be loaded from the swap file of the data to which the terminal accesses at the moment instead of the old which are cleared from memory and remain in the swap file - the same buffering but at the level of the operating system.
 
elritmo:
Would you like to remove the limitation on the number of bars in the history and window in general? Or make a checkbox such as unlimited. Users would have no questions about it at all.
You can replace the limitation on the number of bars in the window with a smarter logic of swapping the history from a file. There will be a buffer for display if we shift on the data outside of this buffer then in this buffer is loaded from a file new history data instead of previous - it can scrolling lags a little bit at it, of course. Although if the entire history is loaded or as scrolling in the depth of the history can be placed in a buffer created by VirtualAlloc in this case the memory will be loaded from the swap file of the data to which the terminal accesses at the moment instead of the old which are cleared from memory and remain in the swap file - the same buffering but at the level of the operating system.
God forbid on paging!
Limiting the history is also necessary for those who put the terminal on a server for automated trading. They need the minimum history there to make indicators work and limit the disk space.
 
make a checkbox such as unlimited or infinity. Whoever needs to be limited will easily do so. By default, there are no restrictions so you don't have to ask: Why am I not able to see all of my history?
 
Yeah, and everyone's memory is unlimited by default...

If you display all the history, there will be questions as to why things are so slow.
 

You can load history from a file as you scroll. But it seems to me that it slows down because the memory is relocated through the pile. There are other approaches to reserving memory. We recommend using VirtualAlloc memory allocation for huge arrays. Heap can be used freely for dynamic arrays not exceeding 1Mbyte
In MT I assume for memory allocation use new[] operator and cpymem function or malloc and realloc which then call HeapAlloc and HeapRealloc. Out of memory message appears if you can't find a fresh chunk of address space to place items one after another (not sure about this :)). Or maybe swap file size is insufficient at some point.

Here's an example of how you can use virtual memory for timeseries instead of heap

MemManager::MemManager(int reg_size, int unt_size, void*& p) {
    unit_size = unt_size;
    SYSTEM_INFO si;
    GetSystemInfo(&si);
    page_size = si.dwPageSize;
    region_size = (reg_size / page_size) * page_size;
    if(reg_size % page_size != 0) region_size += page_size;
    next_page = region = (char*)VirtualAlloc(0, region_size, MEM_RESERVE, PAGE_READWRITE);
    p = region;
    capacity = 0;
}
 
MemManager::~MemManager() {
     VirtualFree(region, 0, MEM_RELEASE);
}
 
void MemManager::realloc(int sz) {
    size = sz*unit_size;
    if(size <= capacity)
        return;
    int tmp_size = size - capacity;
    int inc_size = (tmp_size / page_size) * page_size;
    if (tmp_size % page_size != 0) inc_size += page_size;
    char* p = (char*)VirtualAlloc(next_page, inc_size, MEM_COMMIT, PAGE_READWRITE);
    next_page += inc_size;
    capacity += inc_size;
}
 
Yes, yes, I too have a lot of ideas on how to improve the economy around the world.
I can also give valuable advice to ploughmen on how to plough and women on how to give birth.
And I'm the smartest one here, even though I'm very poor... .
 

The smart ones use other people's ideas ;o) Sort of like the Japanese after WW2...

 
Tell me the history for 6E, Euro FX Currencies -Globex is missing in the history centre? Why only the last two days are downloaded?