The tkc files are broken down by month. Questions because of this
If the terminal doesn't have the tick data uploaded yet, when you call CopyTicks, how does the terminal know which tkc files to pull?
Pulls every month, starting from the current month.
Is CopyTicksRange implemented based on CopyTicks or independently?
Based on CopyTicks, i.e. not optimised at all.
Am I right to understand that getting ticks for September, for example, will always be faster through CopyTicksRange, than through CopyTicks, because CopyTicks doesn't know through the input parameters, for which month data should be pulled?
No, CopyTicksRange will be just as slow because of the point above. Here is a script showing some absurdity of the current implementation of CopyTicksRange
It seems to be clearly given information what tkc-files must be pulled. But no, it will pull the same way as CopyTicks - all tkc-files. And it will stop working by timeout. But actually it should work almost instantly.
You need to get the history in the indicator as quickly as possible. It is possible to request it via CopyTicksRange and get a -1 until everything is downloaded. And if you request by month: current month, then previous month, etc. It will not be slower, but the indicator will be ready to work with at least some history. Right?
No difference, as it turns out (see points above).
When you change the account(to another trade server) we need to write into the file the last 2000 ticks of the old account. How to do it?
This will not work.
voidOnDeinit( constint )
{
MqlTick Ticks[];
CopyTicks(_Symbol, Ticks); // Если была смена торгового сервера, то БД-тиков поменяласьFileSave(__FILE__, Ticks);
}
Please generate CHARTEVENT_ACCOUNTCLOSING event before account change, when processing it (in OnChartEvent) all trading environment has not yet switched to the new one.
fxsaber: When changing the account(another trade server) it is necessary to write into the file the last 2000 ticks of the old account. How do I do that?
This will not work.
Before changing the account, please generate CHARTEVENT_ACCOUNTCLOSING event, when processing it (in OnChartEvent) the whole trading environment has not yet switched to the new one.
Intelligently, we should add a feedback, as it is done in Windows.
In the form of a flag in chart (or not chart) event, when setting it, the event itself (in this case, account switch) is canceled.
Indeed, such an interesting feature in the language, and it works out of the box...
Here's a question. I downloaded the ticks manually (685,007 ticks) through the Symbols menu. I need for EURUSD from 2016.11.01 00:00 to 2016.11.08 00:00. Here is a screenshot.
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.
The tkc files are broken down by month. Questions because of this
No, CopyTicksRange will be just as slow because of the point above. Here is a script showing some absurdity of the current implementation of CopyTicksRange
It seems to be clearly given information what tkc-files must be pulled. But no, it will pull the same way as CopyTicks - all tkc-files. And it will stop working by timeout. But actually it should work almost instantly.
No difference, as it turns out (see points above).
CopyTicks does not work in OnDeinit ifUninitializeReason !=REASON_CHARTCHANGE
Result (after Expert Advisor removal)
This happens in Expert Advisors. In indicators, CopyTicks works normally in OnDeinit.
This will not work.
Please generate CHARTEVENT_ACCOUNTCLOSING event before account change, when processing it (in OnChartEvent) all trading environment has not yet switched to the new one.
When changing the account(another trade server) it is necessary to write into the file the last 2000 ticks of the old account. How do I do that?
This will not work.
Before changing the account, please generate CHARTEVENT_ACCOUNTCLOSING event, when processing it (in OnChartEvent) the whole trading environment has not yet switched to the new one.
Intelligently, we should add a feedback, as it is done in Windows.
In the form of a flag in chart (or not chart) event, when setting it, the event itself (in this case, account switch) is canceled.
Let it be abrupt, but it's annoying that dozens of bug reports, they get fixed, and new ones keep popping up with this CopyTicks.
It tires me out such tricks.
Result
Remove one from the source code
Reproduced on different characters and trade servers. Checked on day off - kotirs are standing.
When will the bugs be defeated in this thread?
Indeed, such an interesting feature in the language, and it works out of the box...
Here's a question. I downloaded the ticks manually (685,007 ticks) through the Symbols menu. I need for EURUSD from 2016.11.01 00:00 to 2016.11.08 00:00. Here is a screenshot.
I am requesting programmatically like this:
The output is 0. What is wrong?
The output is 0. What's wrong?
Multiply by 1000 from and to.
Multiply by 1,000 from and to.
Shame on me, I've got it wrong. Thanks, man.
After the first run on EURUSD M1 MetaQuotes-Demo we have a correct result
All next runs will show a bug
The situation will be repeated after reloading the terminal: first run - fine, next runs - bug.
SZY Note the highlighted comment in the source!