Installing and using the RangeBar Chart plug-in on Metatrader4

Plug-in installation

To start the installation process download the latest plug-in and follow these steps:

First, open MT4 and make sure that you have enabled DLL imports. This is done in the Expert Advisors tab of the MT4’s Options window (you can press CTRL-O to bring up this window in MT4):


Make sure that you have enabledAllow DLL imports” as presented on the screen above. “Allow automated trading” can also be enabled, but it is not required for the plug-in to work correctly.

The screen above may look different in various MT4 builds, but the “Allow DLL imports” option is present in all of them.

When finished with the above, you’ll need to close MT4 and run the downloaded RangeBars setup program. You can follow the installation process covered in the following video or read through the text below it:

When you run the setup program you will see a window similar to the following one:


After clicking [Next > ], you’ll need to accept the license agreement and select the installation folder where RangeBars should be installed. This needs to be your MT4 installation folder (not the /experts, /experts/indicators or any other sub-folder). The installed files will automatically be synchronized with your data folder, so no manual file copying is required.


The illustration above is only an example. You’ll need to select your own MT4 installation folder, which is where you installed Metatrader and where terminal.exe is located.

When in doubt please read this short guide.

The installation process will begin once you select the destination location, click [ OK ], and press [NEXT >].

Once the installation process is complete, you’ll need to activate the software using the “Activate.exe” utility. The activation process is described in the readme file on google drive.

Using the RangeBars plug-in

To use the plug-in, first attach the RangeBars custom indicator to an M1 chart of the chosen instrument (i.e. currency pair, index, etc.). This can do this by dragging the indicator from the Navigator window’s Custom Indicators branch onto the selected M1 chart or by double-clicking the indicator name (RangeBars on the picture below) in the Navigator window.

Placing the Range Bars indicator onto the M1 chart in Metatrader4

This action will bring up the following screen, where you can set the plug-in parameters:

Various rangebar indicator settings

Note: Charts may not automatically build during the weekend but will start once the market opens on Sunday/Monday. However, clicking refresh on the chart will also force the history to build.

The variables and their meaning are described below:

  • Bar size in pips for FX (in points for others)
    This variable influences the size of each bar (range from high to low). On Forex symbols this simply means how many regular pips will each candle measure.

    When using the plug-in with CFDs, Indices, etc., the range bar size value will reflect the number of points (from high to low) that each candle will measure.


  • Display on

    This variable contains a list box with different offline timeframes where the output of the actual range bar chart will be written. Remember that the time period value does not influence the size or duration of individual candles. It only identifies a unique chart ID for the chart that will be used to display live range bars.

    Please note that if you want to set up several different range bar charts for a single instrument, you must select a unique offline chart identifier for each one.

  • Apply template to offline chart
    You can use this value to automatically apply a template that you have saved in your MT4 templates folder. You can use any name that is visible in the templates folder.

    templates folder in MT4

    The templates shown above are the ones that are available in MT4 by default (ADX, BollingerBands, Layers, Momentum, Popular, Volume, Williams), but you can create, save and use your own.

    If you choose to have a template automatically applied it will be visible on your range bar chart (for example, if you choose a custom template with 3 moving averages you will see a chart similar to the one shown below).

    Range bars with 3 moving avarages

  • Automatically open offline chart

    Setting this to “True” will automatically open the chart with range bars as soon as it is ready. Conversely, you will need to click on the “Show chart” button.

    Click to see the range bar chart or open it automatically

  • Build history for a number of days

    This variable defines the amount of historical data that should be processed from the history available on the anchor chart.

    A setting of “0” will result in using all available data on the selected anchor chart’s timeframe.

  • Build history starting from date

    This setting overrides the value set in “Build history for number of days” and lets you precisely define the chart’s anchor point via the date & time of the first processed historical 1-minute bar.

  • Reset Open on each trading day

    An optional feature, which ensures daily (or session) reference consistency. This is used to reflect the true daily (or session) open, high, low, and close values. To use this function, set Reset Open on each trading day to true. As a result, you may even see a gap between the previous session’s close and open of the current one.

  • Recalculate chart on history updates

    This variable defines whether to update the range bar chart when the terminal receives missing historical data for the used instrument. This is usually needed if you have a poor internet connection with your broker’s MT4 server, or your broker’s server has a lot of downtimes.

  • Minimum chart update interval

    This setting is designed to lower CPU usage for manual traders, who don’t need to see the charts refresh on each tick (several times per second). The parameter offers the ability to set the throttle the refresh interval in milliseconds. The default value of “0” turns OFF this feature.

  • == ATR based bar size calculation ==

    This section consists of 3 variables that automatically control the size of the range bar based on the percentage of the daily ATR value:

    • Enabled (true/false) – enables or disables the use of ATR to calculate the range bar size
    • Daily ATR period – used for changing the default ATR period parameter (default value is set to 14)
    • Percentage of ATR (candle body size) – sets the percentage of the calculated ATR value to be used as the range bar candle size for the new trading day.
  • == Alerts and Info ==

    This section is used to set up optional alerts and additional information that is displayed on the range bar chart.

Once you set the values described above to the desired settings, you will need to click the [ Show chart ] button.


This will open the RangeBar chart in your terminal.

EURJPY range bar chart

The “offline” chart will start displaying live price action as soon as new quotes are received by MT4 and new range bars will be created as they are formed.

Please note that every time the plug-in is attached (or MT4 terminal is restarted) it will recalculate all historical data so keep this in mind when you set the “RenderUsing1MhistoryBars” to 0 (all of history).

Backtesting RangeBars

There are two valid ways of backtesting range bar charts in MT4 – both have been described in separate blog posts:

  1. Backtesting using completed bar analysis only (this method is very old and is not recommended)
  2. Backtesting using tick data (every tick is backtested and taken into account)

Updating the plug-in to the latest version

The plug-in(s) can be easily updated once new plug-in features or bug fixes are released.
To update your plug-in close your MT4 terminal and run the updater program which will automatically check for newer versions, download the new files, and patch your existing plug-in installation. If you have multiple MT4 installations on your system, you should update all instances by using the updateRangeBarsPlugin.bat file, which is located in your MT4 installation folder.



  1. IBEX 35 Cac 40  August 28, 2018

    When I originally commented I clicked the “Notify me when new comments are added” checkbox and
    now each time a comment is added I get four emails
    with the same comment. Is there any way you can remove me from that
    service? Thank you!

    • admin  September 2, 2018

      Hi, In the notification emails, you should see a link to “Manage Subscriptions”. By clicking on that link, you will have the option to remove the subscription to the comments on the page.


Add a Comment