Scripts: Period Converter All Timeframes

 

Period Converter All Timeframes:

When we do back-test, we usually download M1 data from a third party, and then convert M1 data to other timeframes.

This script helps to convert history data from M1 to M5, M15, M30, H1, H4, D1, W1 and MN.

This script must be run on M1 chart.

You may choose whether to convert to D1, W1, MN or not. By default it is false.

  • ConverterD1=false;
  • ConverterW1=false;
  • ConverterMN=false;

Please note that you should disconnect from broker server before backtesting, otherwise the data will be overridden by server data.

To avoid override, the practical method is to delete the password in MetaTrader 4 settings (menu "Tools" → "Options" → "Server").

Author: Ziheng Zhuang

 

Note: You should login MT4 account and select "show all" in Market Watch window, this is to obtain the default specification which will be used in tester.

So the steps as below :

login account,show all symbols, delete passward, convert data.


有必要提醒下:

在MT4中转换数据之前,你必须登录MT4账号,并在“市场报价”窗口中显示所有品种,这么做的目的是为了获得品种属性即合约规格(点差,利率,佣金,交易模式,杠杠等)

因为在测试时需要用到品种的这些属性。

登录账号,显示所有品种,之后就可以删除账号密码了,然后就可以转换数据了。


 
Ziheng Zhuang:

Note: You should login MT4 account and select "show all" in Market Watch window, this is to obtain the default specification which will be used in tester.

So the steps as below :

login account,show all symbols, delete passward, convert data.


有必要提醒下:

在MT4中转换数据之前,你必须登录MT4账号,并在“市场报价”窗口中显示所有品种,这么做的目的是为了获得品种属性即合约规格(点差,利率,佣金,交易模式,杠杠等)

因为在测试时需要用到品种的这些属性。

登录账号,显示所有品种,之后就可以删除账号密码了,然后就可以转换数据了。


 
bandous ggxl:
94CD1FF8
 

How to get the history data for backtesting?

https://www.mql5.com/en/code/20002

Get M1 OHLC data for MetaTrader 4 backtesting
Get M1 OHLC data for MetaTrader 4 backtesting
  • votes: 8
  • 2018.02.14
  • Ziheng Zhuang
  • www.mql5.com
Usually most brokers do not provide M1 data over 3 months in MetaTrader 4, but they provide M1 data over 3 years in MetaTrader 5. So we can use this tool to obtain the M1 data in MetaTrader 5 tester and save the data into .hst file for MetaTrader 4 backtesting. How to use it? Test EA in MetaTrader 5...
 

sorry, i Don't see it working.

it modifies the .hst file?

creates new files?

help!

thanks

 
marfil2k:

sorry, i Don't see it working.

it modifies the .hst file?

creates new files?

help!

thanks


Open a chart and change it to M1 , then run this sccript on the M1 chart, this script will create .hst files of other timeframes.

 

Thanks for this. Worked like a charm.


For others' reference this created a file in the following directory when i ran it

<MT4 Data Folder>\history\<Server Name>

 
分享一个快速获取10年高质量历史数据(用于MT4的EA测试)的方法
分享一个快速获取10年高质量历史数据(用于MT4的EA测试)的方法
  • 2018.07.21
  • www.mql5.com
第一步:从MT5下载数据,构造成MT4可用的M1的K线数据(.hst)。 这需要编写一个MT5的EA,利用该EA做复盘测试的机会下载历史数据,并转换成MT4的M1数据。 第二步:在MT4中把该M1转换成其他周期,这样就可以在MT4中测试了。 这需要一个MT4的周期转换脚本...