Guarda come scaricare robot di trading gratuitamente
Ci trovi su Twitter!
Unisciti alla nostra fan page
Script interessante?
Pubblica il link!
lasciare che altri lo valutino
Ti è piaciuto lo script? Provalo nel Terminale MetaTrader 5
Script

Real Tick Coverage - where your broker's tick history exists, month by month - script per MetaTrader 5

Visualizzazioni:
75
Pubblicato:
Freelance MQL5 Hai bisogno di un robot o indicatore basato su questo codice? Ordinalo su Freelance Vai a Freelance

The Strategy Tester model "Every tick based on real ticks" uses the broker's recorded ticks where the broker has them. Where they are missing, the tick data has to be modelled. The tester reports a single percentage for the whole test; it does not break it down by year. On the broker I tested (Admirals demo), the history is complete for EURUSD and gold but starts only in 2023 for GERMANY40.

This script answers that before you run the test. For each symbol you list, it samples four weekdays in every month (the 6th, 13th, 20th and 27th, moved to the next weekday) and asks the terminal for ticks in four 10-minute windows of the day (02:00, 09:00, 13:00 and 17:00 server time). A day counts as covered when any of the windows holds ticks. The result is printed in the Experts log, and optionally on the chart, as a table with one line per year and one character per month:

  • # every sampled day of the month has ticks;
  • + some of them have;
  • . none;
  • blank: not reached (the month is still in the future, or the time limit stopped the run).

Below each table, a Total line gives the share of sampled days with real ticks over the whole period and the first month that has any. If the terminal cannot return history for a window, it is counted as no ticks and the number of failed windows is printed under the table.

Example from my demo server, 2018 to November 2026 (run on 6 December 2026). EURUSD: 100%, real ticks from January 2018. GERMANY40: no ticks from 2018 to 2022, real ticks from January 2023, 43% of the sampled days overall. One Strategy Tester run on that index over a similar period reported 43% of the test on real ticks, close to this estimate (one broker, one run).

Real Tick Coverage output for GERMANY40 and EURUSD

Inputs:

  • Symbols: comma-separated list, empty = the chart symbol;
  • First year to check (default 2018);
  • Time limit in seconds for the whole run, all symbols together: when it is reached the script stops and prints a partial result (default 120);
  • Show on chart: also writes the table with Comment(). For many symbols, read the Experts log.

Notes and limits:

  • It is a sample, not a count of every day, and not the tester's own history quality figure. Public holidays on the sampled days can lower a month's result.
  • Four 10-minute windows can miss a day when the market is very quiet at those hours. A symbol that does not trade at any of the four sampled times will show no ticks even if its history exists.
  • The first run on a symbol can take a few seconds per year while the terminal downloads old ticks. The terminal needs a connection to the trade server to download ticks that are not cached yet.
  • The script only reads data. It adds the listed symbols to Market Watch and does not trade, open charts or change any setting.
  • Whether other brokers store ticks the same way is not tested here; check your own server.
Lot Sentinel – drag one stop line, get the exact lot size on any symbol Lot Sentinel – drag one stop line, get the exact lot size on any symbol

Lot Sentinel shows the exact lot size for the stop loss you drag on the chart. Drag one red line to your stop level: the panel instantly shows the position size for your risk (% of balance, % of equity or a fixed amount), the actual risk after rounding, and a take-profit level at your reward ratio. The loss per lot uses the broker's own tick size and tick value, so it is accurate on forex, gold, indices, stocks and crypto. The lot is always rounded down, so the real risk never exceeds your setting. The indicator never opens or modifies trades.

SafeRequest - complete and check every MqlTradeRequest in one place SafeRequest - complete and check every MqlTradeRequest in one place

An include file that fills every field of a trade request on purpose, rounds prices to the tick grid, respects stops and freeze levels, and never removes a take profit by accident.

Identifying the highest and lowest price levels over a specific period Identifying the highest and lowest price levels over a specific period

Finds and plots the highest high and lowest low over a specified lookback period Includes a vertical lookback boundary line, price labels, and optional push notifications

Universal Risk, Tick-Size and Margin-Fit Lot Calculator Library Universal Risk, Tick-Size and Margin-Fit Lot Calculator Library

MQL5 include library (#include) for equity risk % lot sizing, broker volume limit and free-margin checks, tick-size price normalization, and minimum stop distance validation across Forex, Gold, Oil, Crypto, Indices, and Stocks on Hedging or Netting accounts. Includes URM_CalculateSafeLot(), URM_NormalizePrice(), URM_GetMinStopDistance(), URM_DetectAssetClass(), URM_IsCentAccount(), and URM_IsNettingAccount() with zero DLLs and zero WebRequest calls.