Scripts: Tick Audit - check real tick history and backtest quality month by month

Tick Audit - check real tick history and backtest quality month by month:

Reports, month by month, whether your symbol really has ticks or only bars - so you know which part of your backtest ran on generated ticks before you trust the curve. The Strategy Tester gives you one History Quality figure after the test has finished, and it never says which months were the problem. This script asks first.

Tick Audit - check real tick history and backtest quality month by month

Author: Ayaz

thank you that's exactly what I was searching for
nice. thanks for sharing!
can you add option to only give report on current state of the ticks recieved at point of attaching the script? ie without downloading more ticks.
Jean Francois Le Bas #:
thank you that's exactly what I was searching for

Jean Francois, glad it landed. That was the question I kept running into myself, which is why it ended up written down.

Michael Charles Schefe #:
nice. thanks for sharing!
can you add option to only give report on current state of the ticks recieved at point of attaching the script? ie without downloading more ticks.

Michael, on "only give report on current state of the ticks received, without downloading more" - I checked before answering rather than guessing, and the answer is partly no.

There is no way to read the tick database without touching it. The documentation for CopyTicks says the first call starts synchronising the symbol's tick database, and anything the local database does not hold is downloaded from the server. SeriesInfoInteger reports on the timeseries, so there is nothing to query about ticks either.

What can be improved is how hard the script leans on that. It samples six days a month at the moment, so a month you do not hold gets requested six times over. Stopping at the first sign a month is not cached, and marking it as not held locally rather than as having no ticks, would cut most of that. It is on the list for a future version.

What no setting can promise is zero downloading. A request for data the terminal does not have will wait while it arrives, and that wait happens inside the call, so on a heavy symbol the first month takes what it takes. I would rather say that than add an option that quietly does less than its name suggests.

Ayaz #:

Michael, on "only give report on current state of the ticks received, without downloading more" - I checked before answering rather than guessing, and the answer is partly no.

There is no way to read the tick database without touching it. The documentation for CopyTicks says the first call starts synchronising the symbol's tick database, and anything the local database does not hold is downloaded from the server. SeriesInfoInteger reports on the timeseries, so there is nothing to query about ticks either.

What can be improved is how hard the script leans on that. It samples six days a month at the moment, so a month you do not hold gets requested six times over. Stopping at the first sign a month is not cached, and marking it as not held locally rather than as having no ticks, would cut most of that. It is on the list for a future version.

What no setting can promise is zero downloading. A request for data the terminal does not have will wait while it arrives, and that wait happens inside the call, so on a heavy symbol the first month takes what it takes. I would rather say that than add an option that quietly does less than its name suggests.

Well done, Ayaz.👍 You coded an essential utility for any and every algorithmic trader.

Just so you know, real time ticks can be called with SymbolInfoTick():

Documentation on MQL5: SymbolInfoTick / Market Info
Documentation on MQL5: SymbolInfoTick / Market Info
  • www.mql5.com
The function returns current prices of a specified symbol in a variable of the MqlTick type. Parameters symbol [in]  Symbol name. tick [out]...
Ryan L Johnson #:

Well done, Ayaz.👍 You coded an essential utility for any and every algorithmic trader.

Just so you know, real time ticks can be called with SymbolInfoTick():

Thanks Ryan.
You are right that it does not touch the history database, and that is worth
knowing on its own. It reads the current quote rather than the stored ticks, so
it returns the latest tick and nothing else, which means it cannot say anything
about a month. Michael's question needs the stored history, and that is the
part that always syncs.
Where it does help is telling two silences apart. A symbol that is quoting
right now but returns no history is a different thing from one that is not
quoting at all, and at the moment the script cannot distinguish them. Checking
the current tick first would separate the two, and it costs nothing. Good
catch.
Ayaz #:
Thanks Ryan.
You are right that it does not touch the history database, and that is worth
knowing on its own. It reads the current quote rather than the stored ticks, so
it returns the latest tick and nothing else, which means it cannot say anything
about a month. Michael's question needs the stored history, and that is the
part that always syncs.
Where it does help is telling two silences apart. A symbol that is quoting
right now but returns no history is a different thing from one that is not
quoting at all, and at the moment the script cannot distinguish them. Checking
the current tick first would separate the two, and it costs nothing. Good
catch.

You're welcome.

I must have interpreted Michael's post a bit differently:

Michael Charles Schefe #:
[C]an you add option to only give report on current state of the ticks rec[ei]ved at point of attaching the script? ie without downloading more ticks.

To me, the "point of attaching the script... without downloading more ticks" means currently arriving ticks only.

Ryan L Johnson #:

You're welcome.

I must have interpreted Michael's post a bit differently:

To me, the "point of attaching the script... without downloading more ticks" means currently arriving ticks only.

Fair reading, and looking at it again the wording carries both. "Ticks received at the point of attaching" can mean the ones already sitting in the database, or the ones that start arriving once it is on the chart. Those are two different tools. The first is what this script does, and it cannot avoid the sync. The second is a live monitor, and SymbolInfoTick handles that without touching the history at all, as you say. Michael, which of the two did you mean?

Ayaz #:

Fair reading, and looking at it again the wording carries both. "Ticks received at the point of attaching" can mean the ones already sitting in the database, or the ones that start arriving once it is on the chart. Those are two different tools. The first is what this script does, and it cannot avoid the sync. The second is a live monitor, and SymbolInfoTick handles that without touching the history at all, as you say. Michael, which of the two did you mean?

i meant to simply report what ticks i already have; ie to not download further/more ticks.
Michael Charles Schefe #:
i meant to simply report what ticks i already have; ie to not download further/more ticks.

In that case, I was mistaken.

Anyway, isn't that the purpose of the input, "How many months back to audit"?

And how would the script report empty/sparse M1 bars/months?