Technical Indicators for MetaTrader 5

Range Bars Chart

CustomChartLogo Range
99.95 USD80.96 USD

Free updates are included

We Accept:

We guarantee that all our
products are 100% authentic


MetaTrader 5
Konstantin Gruzdev


iRangeBarsChart indicator allows you to create custom Range Bars charts. Open history file format and history quality control are used.

This indicator is based on iCustomChart and represents its particular implementation. The demo version of iCustomChart can be downloaded for free.


  1. Advantages and Features
  2. Input Parameters
  3. Indicator Buffer
  4. Data Window
  5. History Files
  6. History Quality Control
  7. Time Scale 
  8. Graphical Objects for Technical Analysis
  9. Indicators and Expert Advisors

1. Advantages and Features

  • works at any open chart window (called "base chart" further on in this document);
  • looks like a common chart after launching (see Screenshots);
  • to get started,previously created history files are not required; 
  • open history file format is used;
  • MetaTrader 4 and MetaTrader 5 data format can be used;
  • history quality control  (see Screenshot 7);
  • full format of history including open time of bars, spread, tick and exchange volume;
  • built-in Data Window (see Screenshot 4);
  • built-in Time Scale (see Screenshot 6);
  • auto scaling of price scale;
  • major part of the objects from the MetaTrader 5 standard set can be used for technical analysis (see Screenshot 2);
  • displaying online and offline charts;
  • controlling bars open time up to milliseconds;
  • custom indicators and Expert Advisors can be created based on the iRangeBarsChart chart using LibCustomChart (seeScreenshots 3, 8).

2. Input Parameters

  • Max bars in chart allows to display a fixed number of bars in a chart window. Zero value of the parameter allows displaying the maximum possible number of bars, but no more than the number specified in the client terminal settings. This parameter acts as the equivalent parameter of the client terminal described in Help. The default value is 1000.
  • Range - the range or a size of bars in points from Low to High. The default value is 200.
  • Update - iRangeBarsChart indicator update method:
                   Disable - update disabled; 
                   Ticks    - update at each base chart tick, set by default; 
                   Bars     - update when a new bar appears on a base chart.
  • Shadows - managing candlestick shadows drawing:
                   Enable  - shadow display enabled, set by default; 
                   Disable - shadow display disabled.
  • Price scale - select price scale:  
                   Standard - standard price scale. Scaling and scale management are performed by means of MetaTrader 5.
                   Custom - scaling is performed by iRangeBarsChart, set by default.
  • Value of zero buffer - zero buffer value calculated according to selected price constant.

3. Indicator Buffer

0  Contains selected price constant. The buffer is basically created for the indicators that use the first call form to get data. 
1  Bar open time 
2  Bar open price 
3  Bar high price 
4  Bar low price 
5  Bar closing price 
6  Bar color 
7  Exchange volume 
8  Tick volume 
9  Spread 

4. Data Window 

Built-in data window looks similar to the standard MetaTrader 5 data window, but has some additional features (Screenshot 4). Data fields displayed in the window:

  • Upper field - symbol name and parameter. Parameter is a size of bar in points (Range), specified in the indicator input parameters. The window containing data on a history file will be opened once you click on this field (Screenshot 5).
  • Date            - bar open date.
  • Time            - bar open time.
  • Open           - bar open price.
  • High            - bar high price.
  • Low             - bar low price.
  • Close           - bar close price.
  • Volume        - exchange volume.
  • Tick Volume - tick volume.
  • Spread        - bar spread.
  • Bar              - bar index, zero bar - last unfinished bar.
5. History Files (HST Files)
Open history files format described in the MetaTrader 4 user guide is used to draw charts. A user can take a ready-made Range Bars history file or create one of their own. Then the iRangeBarsChart indicator can be used to display a chart.
History file format is as following. History file header goes first:
struct HistoryHeader
  int		version		// base version
  char		copyright[64];	// copyright
  char		symbol[12];	// symbol
  int		parameter;      // symbol period or parameter, for iRangeBarsChart it is "Range" input parameter value
  int		digits;         // number of digits after the decimal point in a symbol
  time_t	timesign;       // base creation timestamp
  time_t        last_sync;      // last synchronization time
  int		unused[13];	// for future use
The version of the base for MetaTrader 4 history files is displayed as "400", while for MetaTrader 5 it is "500". This is important, as each version has its own bar data structure.
The standard representation of the bars array following the header for the version "400" history file looks as follows:
#pragma pack(push,1)
struct RateInfo
 time_t   ctm;	  // time in seconds
 double	  open;	  // bar open price
 double	  low;	  // bar low price
 double   high;	  // bar high price
 double   close;  // bar close price
 double   vol;	  // volume
#pragma pack(pop)
The standard representation of the bars array for the version "500" history file looks as follows:
#pragma pack(push,1)
struct MqlRates
 datetime time;         // bar time in seconds or milliseconds
 double   open;         // open price
 double   high;         // high price for the period
 double   low;          // low price for the period
 double   close;        // close price
 long     tick_volume;  // tick volume
 int      spread;       // spread
 long     real_volume;  // market volume 
#pragma pack(pop)

Note that bar time can be set either in seconds or in milliseconds for version "500". iRangeBarsChart  defines both time formats correctly.

Note: users bear responsibility for a history file correctness.

To make iRangeBarsChart recognize a history file, it must be located in the "terminal_data_folder\MQL5\Files\iRangeBarsChart\History". The history file name

  1. must start with "Range" prefix;
  2. Then it must contain the symbol name on the base chart of which the indicator will be loaded (for example, "EURUSD");
  3. Then it must contain the value of the "Range" input parameter;
  4. Finally it must have ".hst" extension.
An example of the file name: RangeEURUSD200.hst

If the history file doesn't exist, so it will be automatically created from the minute history available in the terminal. If it exists, it will be updated in accordance with the "Update" input parameter of the indicator. 

6. History Quality Control

For history files created by iRangeBarsChart, history quality control is available.

Any new history file is created from the minute history available in the terminal. Accordingly, there can be situations when the simulated bars can differ from bars created online. Each doubtful simulated bar on the chart is displayed in lighter color than the concrete bars (Screenshot 7). It allows estimating history quality visually.

When initializing the indicator, a message about its quality will appear in the log (Screenshot 7). It can be estimated in the percentage of good and bad bars. Please note that history quality calculation is performed only for bars displayed on charts, not for the whole history file. 

Using the indicator buffer "Bar color" you can programmatically estimate the history quality in your own indicators and the Expert Advisors. It allows making adequate solutions when implementing a trading strategy.

You can improve the history quality using iRangeBarsChart in the online mode only. At coming of tick data iRangeBarsChart correctly calculates all parameters of bars and saves them in the history file. For example, bar open time will be calculated to milliseconds and saved. If there is no tick data to build history for a period of time (connection failure, terminal is turned off or any other nonstandard situation), so the missing Range history will be formed on the basis of a minute history. 

7. Time Scale

Time scale of charts created using iRangeBarsChart, does not usually coincide with a base chart time scale and it is non-linear. Therefore, the indicator automatically rebinds applied graphical objects to its time scale (Screenshot 6). Built-in scale features:

  • looks similar to the standard time scale;
  • easy to move vertically;
  • semi-transparent background, always visible chart objects and price chart behind the scale.

8. Graphical Objects for Technical Analysis

Standard graphical objects of the terminal are bound to a base chart time scale when placed in a chart window. Therefore, iRangeBarsChart automatically rebinds applied graphical objects to its time scale. It allows using the standard graphical objects for technical analysis of Range Bars charts. Synchronization with iRangeBarsChart is supported for the following conventional MetaTrader 5 graphical objects:
  • lines: horizontal, vertical, trend, trend by angle, cycle, arrowed;
  • channels: equidistant, Andrews Pitchfork;
  • Fibonacci: retracement, time zones, fan, arcs, channel, expansion;
  • Elliott instruments: motive wave, corrective wave;
  • figures: triangle, rectangle, ellipse;
  • arrows: thumbs up, thumbs down, arrow down, arrow up, stop sign, check sign, left and right price labels, Buy and Sell signs, arrow.
In some cases, for example when closing the terminal, iRangeBarsChart saves the objects data to a temporary file located in the "terminal_data_folder\MQL5\Files\iRangeBarsChart\Objects" directory. The system deletes all temporary files when iRangeBarsChart is being removed from a chart window.
9. Indicators and Expert Advisors
Standard indicators follow the time scale of a base chart, as well as the objects. Free LibCustomChart library should be used for binding the indicators to the iRangeBarsChart time scale. 
The library functions allow writing the indicators that are automatically connected to iRangeBarsChart (Screenshort 3), in case it is uploaded to a chart window. In case iRangeBarsChart is not uploaded, these indicators will work in a common chart window. Besides, the library provides simplified access to iRangeBarsChart time series.
In case the library functions are used in an Expert Advisor, then it will also automatically use iRangeBarsChart, in case the latter has already been run on a chart window. In case iRangeBarsChart is not run, the Expert Advisor will work on a common chart window and use its data.
Examples of the library use in indicators and Expert Advisors can be found in Code Base.

This indicator is based on iCustomChart and represents its particular implementation. The demo version of iCustomChart can be downloaded for free.


If for any reason you do not like the purchased program, you can request a refund within 14 days from the date of purchase. You can also make an exchange for any other product at an equal cost or by paying the difference.

Simply send a request for refund or exchange with your order number by email:

Refund requests received more than 14 days after purchase will be rejected.

Email Us Now! Support is available 24/7
by Email:

Do You Need Help?
Click Here To Start Live Chat

Contact Us

Copyright © 2021 All rights reserved. Terms and conditions | Privacy policy     We speak your language EN|CN|DE|ES|RU

RISK WARNING: is a software reseller, we do not offer investment advice or execute trades. The software we provide is a tool where the settings are input by the end user to design their own trading strategy. Trading forex and CFDs carry a high degree of risk to your capital and it is possible to lose your entire deposit. Only speculate with money you can afford to lose. As with any trading, you should not engage in it unless you understand the nature of the transaction you are entering, and the true extent of your exposure to the risk of loss. These products may not be suitable for all investors, therefore if you do not fully understand the risks involved, please seek independent advice.