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

ICT Session Boxes - four GMT windows, automatic broker offset, high and low lines - indicator for MetaTrader 5

Jevon Naldo Yoshield
Jevon Naldo Yoshield
I build MetaTrader 5 tools I use on my own charts. Ten are on the Market.
Order Entry Panel sends market orders per click. Smart Risk and Lot Size Panel turns risk and stop into lots. Prop Firm Guard and Drawdown Lock caps my daily loss.
Views:
62
Published:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

A session box marks the hours when a market is open, and a killzone marks the shorter window around an open. Both windows are named in GMT while the chart runs on the broker's clock, so the indicator converts each window to server time before it draws.

What it does

  • Draws a box over each enabled window - Asian range, London open killzone, New York open killzone and London close - for the days you set, five by default.
  • Draws the box as an outline by default, because the fill colour starts at none, and puts that outline in front of the candles; a fill colour fills the box and moves it behind the price.
  • Runs a dashed high line and a dashed low line across each window, and each session has its own switch for them.
  • Puts the session name above the range in two lines at font size 8, on that session's newest box only, and only when the box has room for the text.
  • The range is in pips on an FX quote, and in price with the symbol's own digits and profit currency on everything else.
  • No plots, no buffers, nothing for iCustom to read, and no order call anywhere.

How it works

  • With auto detection on, it compares the server clock with the GMT clock, rounds the difference to the nearest hour and clamps it to plus or minus 14; if either clock reads zero it uses the manual offset, and the Strategy Tester always uses the manual offset.
  • Each window's GMT hour and minute are added to midnight of that day on the server clock, a window that does not end after it starts is moved forward one day, and a window not reached yet is skipped.
  • The start edge is the bar that opens at the window's start, or, where no bar opens at that time, the bar that contains the start.
  • The end edge is resolved with exact=false: the last bar that opens before the window's end, so a bar that opens at the end is never counted, because that bar lies wholly after the window.
  • High and low are the highest high and the lowest low over those bars, and a window that holds none - a weekend, a holiday, a day before the history starts - returns before anything is drawn. A window still running reads its high and low up to the current bar, while its box runs on to the scheduled end.
  • A new bar always recalculates, and a forming bar recalculates only when the server clock's second is a multiple of five, so an intrabar high or low moves on that beat, not on every tick.

Inputs

  • Days to display: how many days back the loop runs, five by default.
  • Auto detect broker GMT offset: measures the offset once on attach, on by default.
  • Manual GMT offset: the hour value used when auto detection is off or either clock reads zero, two by default.
  • Show session range in pips: switches the name and range label off for all four sessions, on by default.
  • Asian Range: enable, start hour, start minute, end hour, end minute, border colour (steel blue), fill colour (none), high and low lines (on) and their colour (dodger blue).
  • London Open Killzone: the same nine under the InpLondon prefix, with a medium sea green border and sea green lines.
  • New York Open Killzone: the same nine under the InpNY prefix, with an indian red border and firebrick lines.
  • London Close: the same nine, named InpLondonCloseEnable, InpLondonCloseStartH, InpLondonCloseStartM, InpLondonCloseEndH, InpLondonCloseEndM, InpLondonCloseBoxCol, InpLondonCloseFill, InpLondonCloseHighLow and InpLondonCloseHLCol; medium purple border and purple lines.

How to use it

  • Copy the .mq5 file into MQL5/Indicators in your terminal's data folder, open it in MetaEditor and press Compile.
  • Attach it to a chart. One line appears in the Experts tab with the symbol's digits, point, calculation mode, base and profit currency, and the unit it chose, pips or price.
  • The four windows are set in GMT, not in server time, and their defaults are 00:00-08:00, 06:00-09:00, 11:00-14:00 and 15:00-17:00.

Limits

  • The offset is read once in OnInit and never again, so a broker summer-time shift leaves the boxes an hour out until the indicator is reloaded.
  • The label needs as many bars as the longer of the name and the range, and on H1 and H4 the default windows cover fewer bars than that, so no label is drawn there; the high and low there are as coarse as those few bars.
  • Removing the indicator deletes every object whose name begins with chimaster_, so a second indicator from the same family loses its objects too.
  • The range falls back to price on anything that is not a plain FX quote with two to five digits, including a profit currency outside the 31-code list, and prints a bare number when there is no profit currency.

The indicator on a chart: outline boxes over the candles, the session name and range inside the box where the chart leaves room for them.

The indicator on a chart: outline boxes over the candles, the session name and range inside the box where the chart leaves room for them.

Risk Lot Calculator Risk Lot Calculator

Chart panel that calculates position size from risk % and stop-loss in points, with tick value, margin and money at risk. Does not place orders.

AlgoFX Session Liquidity Sweeps AlgoFX Session Liquidity Sweeps

Marks previous day, Asian and London session highs and lows from chart bars and flags closed-bar, ATR-filtered liquidity sweeps. Non-repainting, with EA-readable buy/sell buffers and an on-chart display panel.

Risk-Based Lot Size Calculator (script) Risk-Based Lot Size Calculator (script)

A small script that turns "risk in % of the account" and "stop loss in pips" into a lot size. It only calculates and prints; it never opens, modifies or closes trades.

Session Range Box Session Range Box

Draw Asian, London and New York session ranges as chart boxes with high/low lines, labels and an optional London–New York overlap. Configure GMT or broker-server hours and review the latest session statistics in a panel.