Watch how to download trading robots for free
Find us on Facebook!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Indicators

Robustness Lab: Seasonality heatmap with t-statistics (hour x weekday) - indicator for MetaTrader 5

Panagiotis Paterakis
Panagiotis Paterakis
  • Algorithmic trading developer (MQL5, cTrader C#, Python) at  Self-employed
  • Greece
  • 128
I design, code and run automated trading systems. My own systems trade forex, indices and gold live on cTrader (C#), across several brokers, so I work through the full cycle: clear strategy rules, backtesting with realistic costs, robustness checks around the chosen parameters, live deployment, and
Views:
60
Rating:
(1)
Published:
\MQL5\Include\RobustnessLab\
RL_Common.mqh (8.96 KB) view
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

Most "best hour to trade" tables show averages without asking whether they differ from zero. This indicator adds the test and warns you about the multiple-testing trap.

Seasonality heatmap, XAUUSD H1

How it works

  • It reads the bars of the chosen timeframe (M5 to H1) over the lookback period and puts the return of each bar, (close - open) / open, into a weekday x hour cell. Server time is used, with an optional shift in hours.
  • For every cell it calculates the mean return, the t-statistic of that mean (mean divided by standard deviation / square root of n), the hit rate (share of rising bars) and the average range in points.
  • Cells with at least the minimum number of bars and |t| at or above the threshold get a gold frame.
  • With about 120 cells, roughly 5 will reach |t| >= 2 by pure luck. The note under the table shows the framed count next to the number expected by chance. It turns green only when the framed count is clearly above chance.

Inputs

  • Bars used for the statistics: M5 to H1 (higher timeframes have no intraday hours).
  • Lookback in calendar days (default 730).
  • Colour by: t-statistic, mean return %, hit rate or mean range.
  • Shift from server time in hours, |t| threshold, minimum bars per cell, show weekend, panel position, cell size and font size.

Notes

  • The table is recalculated once per day, so it costs nothing on every tick.
  • Requires RL_Common.mqh in MQL5\Include\RobustnessLab (included in this package).
  • Statistics describe past data only. A framed cell is a reason to look closer, not a trading signal.

The screenshot shows XAUUSD H1 on a MetaQuotes demo account, 730 days.

Risk Lot Calculator Risk Lot Calculator

Calculates the lot size for a risk % and a stop distance on any symbol, using the broker's own profit calculation, so the result is exact for forex, gold, indices, stocks and crypto.

Same H4 and D1 candles on every broker - NY close candles from H1 Same H4 and D1 candles on every broker - NY close candles from H1

Builds H2 to D1 candles from H1 on the New York close clock, so your indicators see the same candles on every broker, no matter which server time it uses. Detects the server clock automatically.

Robustness Lab: Market regime indicator (bias-corrected Hurst, efficiency ratio, volatility) Robustness Lab: Market regime indicator (bias-corrected Hurst, efficiency ratio, volatility)

Classifies the market as trend, mean-reversion or noise using three public measures: the Hurst exponent by rescaled range with small-sample bias correction, Kaufman's efficiency ratio and the percentile of the current ATR. A colour strip shows the regime bar by bar, and a panel shows the regime on M15, H1, H4 and D1 at the same time. Part of the free Robustness Lab set.

Robustness Lab: Monte Carlo drawdown analysis of your trading history Robustness Lab: Monte Carlo drawdown analysis of your trading history

Takes the closed trades of your account (all, or filtered by magic number and symbol), reshuffles or resamples them thousands of times and shows how deep the drawdown could realistically get. You get drawdown percentiles, the probability of a drawdown above your limit, the spread of final equity, an equity fan chart and a drawdown histogram, on the chart and as an HTML report. Part of the free Robustness Lab set.