The Custom Timeframe Generator lets you create charts for timeframes which are not available by default in MT4, e.g. 10-second charts, 3-minute charts, or tick charts. You run a Generator EA on a normal chart for your chosen symbol, and the custom timeframe is then available from MT4's list of offline charts. The custom timeframe continues to update for as long as the Generator EA is running.
Periods such as M2, M3, M10, and H2
Second charts (e.g. 10 seconds)
Tick charts
Range bars
Renko bars
Most EAs and indicators will work correctly on these custom charts. However, you should test things carefully before trading real money, because there are subtle differences between normal charts and the custom charts which could potentially cause problems with some MT4 code.
Unless otherwise specified in writing by FX Blue, this software is licensed for personal use only. You are not allowed to distribute it to other people, regardless of whether or not money is changing hands. You only have a licence to use the software if you, personally, downloaded it from our website.
The software is provided entirely at the user's risk, and you should check it thoroughly before deploying it on computers trading real money. FX Blue accepts no responsibility whatsoever for any loss of any kind caused by installation or use of the software.
To install the Generator, run the setup program. You can choose one or more copies of MetaTrader 4 where you want to install the EA. If any copies of MT4 are not shown, you can add them to the list using the "Find MT4" button.
MT4 needs to be restarted in order for its Navigator list to update after new EAs are installed.
In order to create a chart for a custom timeframe, you need to do two main things:
The chart for the custom timeframe will only update while the Generator EA is running on the other (normal) chart.
In more detail, the steps are as follows:
Choose one of the following, leaving the others set to zero:
Set BarPeriodSeconds if you want a chart with bars every N seconds (e.g. 10 for 10 seconds, or 180 for M3, or 7200 for H2).
Or, set BarPeriodTicks if you want a chart with bars every N ticks.
Or, set RangeBarPips to a number of pips if you want to draw range bars.
Or, set RenkoBarPips to a number of pips if you want to draw Renko bars.
Set ShowAsOfflinePeriod to a value which you will use to identify this custom chart. For example, you could use 1010 to mean "10-second chart" and 2010 to mean "10-tick chart". The meaning and numbering of ShowAsOfflinePeriod is entirely up to you, and has no effect on the chart's behaviour. If you are running multiple copies of the Generator, then each one should have a different ShowAsOfflinePeriod setting.
Click on File | Offline Chart
Choose the entry corresponding to the ShowAsOfflinePeriod parameter. For example, if you used the value 2010, then the custom offline chart will be listed as "EURUSD,M2010"
The chart for your custom timeframe will open and start drawing, and will continue to update for as long as the Generator EA is running on its host chart.
By default, the bespoke chart will start from the time that you run the Generator EA, and will not contain any historic data. However, under some circumstances it is possible to use the CreateHistory parameter to tell the Generator EA to calculate historic bars.
In addition to the parameters described above, the Generator EA has some further settings which you can use to customize its behaviour.
By default the ContinueExistingFile parameter is turned off, and the Generator EA will restart the custom offline chart from scratch. If you turn ContinueExistingFile on, then the Generator EA will add new ticks and bars to any existing contents of the offline file.
If you use the Generator EA to create charts for short timeframes (e.g. 10 seconds), then there can be periods where no tick occurs and no bar is drawn. (Similarly, on a normal M1 chart, there are usually a few "missing" bars per day because no ticks happened during those minutes. There can be even be gaps on M5 and M15 charts if the market is very quiet.)
If you turn on InterpolateEmptyBars, then the Generator EA will create a dummy bar for each period during which no ticks occurred. It will use the previous close as the OHLC of the dummy bar, and it records the volume as zero. The dummy bars are created after the gap, when the first tick of the new bar occurs.
These extra empty bars can help to identify quiet periods in the market, but please note that they will affect indicator calculations. For example, a moving average will include the dummy bars (whereas on a normal M1 chart, for example, an indicator will not take into account any bars which are "missing").
InterpolateEmptyBars cannot be used with tick charts or range charts (i.e. where BarPeriodTicks > 0 or RangeBarPips > 0 or RenkoBarPips > 0), simply because there cannot be "missing" bars on a tick or range chart.
The CreateHistory parameter can only be used on time charts, not tick charts or range charts, and only when the bar period is a number of minutes. In other words, you can only use CreateHistory if BarPeriodSeconds is exactly divisible by 60.
This setting tells the Generator EA to read the M1 data stored in MetaTrader 4, and to create historic bars for your bespoke timeframe. For example, if BarPeriodSeconds is set to 180 (i.e. 3 minutes), then CreateHistory will use the available M1 data to create historic M3 bars, as well as then continuing to draw new M3 bars going forwards. In other words, CreateHistory is similar to the period_converter script which is supplied by default with MT4.
CreateHistory cannot be used on tick charts or on time periods less than 1-minute because it is impossible to calculate this historic data from MT4's M1 bar history. Such charts can only be drawn on a forward basis.
In order to use CreateHistory you need to have M1 data within MT4. You can get M1 data either by opening an M1 chart for the symbol, or by using the History Center to download the data manually.
The SendTicks parameter is an aid for running automated systems (EAs) on the offline chart. This parameter tells the Generator to send simulated ticks to the offline chart, which can force an EA on the automated chart to run.
The BarShiftMinutes parameter can be used to adjust the start time of bars on the offline chart. It is only applicable to time charts; it is ignored with tick charts and range bars.
For example, you can set BarPeriodSeconds to 3600 in order to create H1 bars, but set BarShiftMinutes to -60 so that the time of the adjusted bars is one hour behind the broker's time.
If you are using Renko bars (RenkoBarPips > 0) then you can turn on the ShowRenkoTails option in order to show the amount of "adverse" or "incomplete" opposite move on each bar which is usually trimmed off a Renko chart. This can help to indicate the strength of a trend, and signal the end of a trend. For example, in the following screenshot the length of the tails indicates the strength of the move:
By default the Generator will use a pip size (for range and Renko charts) which is derived from the number of decimal places to which a price is quoted. For example, if a price is quoted to 4DP or 5DP then the pip size will be 0.0001; if the price is quoted to 2DP or 3DP then the pip size will be 0.01.
Particularly for use on non-forex symbols, you can override this using the CustomPipSize parameter. For example, if the Dax index is quoted to 2DP but you want the pip size to be 1.00 rather than 0.01, then you can set CustomPipSize to 1.
When you have finished with a custom chart, you can either overwrite it (by running the Generator EA with the same ShowAsOfflinePeriod parameter and with ContinueExistingFile turned off), or you can manually delete the history file from the history\<broker-server> directory within the MT4 installation.