Быстрая сортировка (англ. ), часто называемая qsort по имени реализации в стандартной библиотеке языка Си — широко известный алгоритм сортировки, разработанный английским информатиком Чарльзом Хоаром во время его работы в МГУ в 1960 году. Один из самых быстрых известных универсальных алгоритмов сортировки массивов (в среднем O(n log n) обменов...
I'm bogged down with the logic of the algorithm for synchronizing the tick history of two or more symbols, so that each moment in time would have a corresponding symbol price, suggestion, colleagues.
I'm bogged down with the logic of the algorithm for synchronizing the tick history of two or more symbols, so that each moment in time would have a corresponding symbol price, suggestion, colleagues.
I'm bogged down with the logic of the algorithm for synchronizing the tick history of two or more symbols, so that each moment in time would have a corresponding symbol price, suggestion, colleagues.
If I've got it right: I'm thinking of doing this - break it into separate objects by days, so that each stores arrays of ticks of all symbols, (for each day is not so many ticks), and then just from sorted by time array give by request "less or equal".
Create an additional array. Write the time from all the characters there. Sort in ascending order. Remove duplicates. Synchronize the tools using this array. If there is no exact match, take the time of the nearest tick.
Rorschach: Create an additional array. There write the time from all symbols. Sort in ascending order. Remove duplicates. Synchronize the tools using this array. If there is no exact match, take the time of the nearest tick.
Yeah, that's what I did.
but there are often ticks on the same character with the same time, when there are several ticks in a millisecond
but there are often ticks on the same character with the same time, when there are several ticks in a millisecond
That's where I get stuck in the logic.
You can think of a few options. Take the average price per ms. Take the last price per ms. Artificially increase resolution to µs, e.g. 3 ticks came in one ms, make time of the first tick 10µs, the second 20µs, etc. Time information is lost, there is no better option. Taking the last price would be the most usual, like millisecond bars would work out.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I searched the whole Internet looking for string array sorting http://ru.wikipedia.org/wiki/Быстрая_сортировка.
I ended up redesigning QuickSort to suit a string array.
I'd also like to include a mode for discarding unique records.
Greetings!
Do you know about iBarShift?
Greetings!
Create an additional array. There write the time from all symbols. Sort in ascending order. Remove duplicates. Synchronize the tools using this array. If there is no exact match, take the time of the nearest tick.
Yeah, that's what I did.
You can think of a few options. Take the average price per ms. Take the last price per ms. Artificially increase resolution to µs, e.g. 3 ticks came in one ms, make time of the first tick 10µs, the second 20µs, etc. Time information is lost, there is no better option. Taking the last price would be the most usual, like millisecond bars would work out.