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
Scripts

Spread Statistics by Hour - script for MetaTrader 5

Views:
35
Published:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

This script measures the historical spread of many symbols at once, hour by hour, using the spread stored in the M1 bars of your broker. It helps you see the real trading cost of each symbol and the cheapest and most expensive hours to trade.

Mean spread by server hour for GBPUSD, US100 and XAUUSD over the last 90 days.

How to use: attach the script to any chart. By default it analyses all symbols in Market Watch over the last 90 days; you can also give your own comma-separated list of symbols.

Inputs:

  • Use all symbols in Market Watch (true/false)
  • Comma-separated symbol list (used when the option above is false)
  • Days of M1 history to read (default 90)
  • Output file name prefix

Output (folder MQL5\Files):

  • SpreadStats_hours.csv: for each symbol and server hour, the median, 75th percentile and mean spread, in points and as a % of price
  • SpreadStats_specs.csv: swap long/short, contract size, point, digits and tick value of each symbol

A short summary for each symbol is printed in the Experts tab.

Notes:

  • MetaTrader stores in each bar the spread of the bar (usually the minimum), so values are slightly optimistic.
  • On raw-spread accounts many M1 bars store a spread of 0, so the median can be 0: in that case use the mean column.
  • The script does not trade and does not change any setting.
  • Developed with the help of AI tools and tested on a live MetaTrader 5 terminal.
Risk Order Script: Drop at Stop Loss for Auto Lot Size and R:R Take Profit Risk Order Script: Drop at Stop Loss for Auto Lot Size and R:R Take Profit

Drop the script on the chart at your stop loss price and it opens a market order with the lot size calculated from your risk percentage and take profit placed at your reward:risk ratio.

Economic Calendar Event Lines by Impact Economic Calendar Event Lines by Impact

Draws a dotted vertical line at the release time of each economic calendar event of the selected currencies, coloured by impact, from the built-in MetaTrader 5 calendar.

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

MACD Signals MACD Signals

Indicator edition for new platform.