Release of SQX 139 Dev 1 and what’s planned for year 2024
We’d like to announce the release of the new SX 139 Dev 1 version – note that this is a development version for testing, not the final 139 version. Most …
Přejít k obsahu | Přejít k hlavnímu menu | Přejít k vyhledávání
In this article I’ll explain the step-by-step process of building a strategy for range or renko charts on MetaTrader4. The example below will use range bars, but the same process can be applied also to renko charts.
They are alternative charts that don’t display data in blocks grouped by time (5 minutes, 15 minutes, 1 hour) but by other criterion.
For Range bar, one candle on the chart represents given range, for example 10 pips. So every time market moves by another 10 pips a new candle is drawn.
Image: Range chart – every bar has the same size (range from high to low)
NinjaTrader platform has build-in support for these chart types, so the only thing you need to do to use these charts in SQ is to export the chart data as same as for any other chart type.
MetaTrader4 platform doesn’t natively support Range or Renko charts, in order to display and use them you need third-party plugin. Very affordable provider of Range/Renko plugins for MT4 that we tested and can recommend is AZ-INVEST.EU
You should use high quality (preferably tick) data to compute accurate range or renko charts. You can use our Tick Data Downloader to download high quality tick data for free.
Just download the data for your selected symbol and export it as tick data to CSV file. In this example I’ll use GBPUSD data.
Image: Downloading and exporting tick data
MetaTrader4 doesn’t natively support Range / Renko bars, you need to use external plugin that will enable this functionality. Purchasing and installing this plugin is beyond the scope of this article, it is a simple process.
AZ-INVEST plugins do have their own documentation and standard installer that will lead you through the setup.
With the Pro version of the Range bars plugin you’ll get a set of special CSV2FXT scripts that should be used to generate data files that will be needed for backtest.
If you properly installed the Range bars plugin you should see these scripts in your MetaTrader.
Then click on OK. This script will generate .HST and .FXT files necessary for testing in MetaTrader as well as data file for StrategyQuant.
This data conversion will take some time and you’ll see its progress on the chart.
When it is finished it will show dialog asking you if it can copy the new HST and FXT files to the appropriate folders. You can clickYes
The next step is importing the generated range data file to StrategyQuant so it can be used to backtest strategies. If you used StrategyQuantExport=true the script generated new data file containing range chart data in your MQL4/Files folder.
We’ll import this file to StrategyQuant.
Open StrategyQuant, go to Data Manager and create a new symbol GBPUSD_range10:
Now select the new symbol and import the file GBPUSD_10pip_rangebars.csv generated in previous step.
You will see the new data with Timeframe type Intraday.
That’s virtually all! Now you can work with the new symbol in StrategyQuant as same as with any other data and generate new strategies for it.
Building strategies for Range or Renko data is as sam eas building them for any other standard timeframe. You can of course use In-Sample and Out-of-Sample periods, robustness tests, optimizations, etc.
For more information on complete strategy building process please refer to this article.
Let’s say we generated some nice strategy in StrategyQuant and we want to test it in MetaTrader. In this example we’ll use Strategy 0.2232 below.
To test your range strategy EA in MetaTrader you need Tick Data Suite. Start your MT4 using TDS. Then go to Tools -> MetaQuotes Language Editor and create New Expert Advisor with name Strategy 0.2232.
Copy & paste the strategy EA from StrategyQuant to MetaQuotes Editor and compile the strategy.
Then open Strategy Tester in MT4 and choose GBPUSD symbol on 1 Minute timeframe. If you didn’t do any change, you still have the .FXT and .HST files generated by CSV2FXT scripts in their place and they will be used in backtest.
Select your strategy and click on Start to start the backtest.
When the test is finished you can check the chart, you’ll see that the results are as same as in StrategyQuant.
Trading the strategy in MT4 requires opening a range chart. Go to the GBPUSD, M1 chart and then find RangeBarChart indicator in Navigator -> Custom Indicators. Apply this indicator to the chart with the correct setting – in our case we used pip Range = 10 before.
Once you’ll do this you’ll see the following comment below your chart:
Now you need to open the generated offline chart – GBPUSD,M2 (as presented in the displayed comment) to access the LIVE RangeBars chart:
Open GBPUSD, M2 offline chart for 10.0 pip RangeBars.
To do this go to the File menu in your MT4 terminal and click on the Open Offline menu item:
The “offline” chart will start “ticking” when new quotes are received by MT4 and new 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 ofhistory).
Despite its name this is live range chart and you can normally add EA to it:
This EA will then normally trade on this range chart on demo or real account.
We’d like to announce the release of the new SX 139 Dev 1 version – note that this is a development version for testing, not the final 139 version. Most …
Dive into Algorithmic Trading Without the Coding Headache! Are you intrigued by algorithmic trading but dread the thought of coding? Today marks the beginning of our exciting series that’s about …
In this interview, we catch up with Naoufel, a seasoned trader, to explore his journey through the stormy market of 2023. Naoufel is successful trader with verfied track record who …
Hello, its the same for Meta Trader 5? Thanks
Hello, can i also use this? I need the Median Renko, that would be very nice. Thanks
https://www.az-invest.eu/median-renko-plug-in-for-metatrader-4
You should be able to work with this the same way like with the Range bars plugin mentioned in the article. For MT5 you can check this link https://www.mql5.com/en/market/product/16762#!tab=tab_p_overview
Hello, just wanted to ask if the Range Bars Charting from MQL5
is still the only way how to apply Renko from MT5 to SQ ?
Hi,
if you manage to export range/renko data from MT5 you can import SQX without any issue. Beware you import raw OHLC data for final bars so SQX cannot look into the bar (intra-bar). It knows only 4 prices
Hi Tomas,
Does this work for renko/range (and other non-time based) bars built from 1-second data? The article mentions 1-minute data and I wanted to double-check.
Yes, it could work. SQ just expects OHLC data for rangebars