At Last…

My script ‘TickConverter’ has been published here.

The proof reader of ‘’ site was very kind, and supportive.

Thanks for your help.

I wish to make much more programs asking for better benefit.

from author.


MT4 70 TickChart Script Version


70tickchart with BollingerBand and Volume

I made a 70 tick chart of the script version. (see. our Indicator version 70tick20ema.mqh)
Since the original include file is partially modified, it is necessary to replace these files; “Files/FileBin.mqh, Files/File.mqh”.
‘BV’s 1pip unit display’ is made possible. Spread cancellation is also implemented.
In this script, Struct MqlRate including ‘spread’ is filled with 0, and ‘real_volume’ is used for recording ‘tick interval(seconds).
I recommend a 5-minute chart to attach as a source of this script. Since data interpolation is performed, the deviation from the actual chart becomes large when the time frame is longer than that.

1 Attach this script to an M5 or M1 online chart.
2 Open offline history file from the menu(file-offline chart- see ‘T’suffix file).
3 If the offline chart was not changed automatically, attach this script to the previous online chart again.
4 Attach any indicator you like to offline chart.

::: Recommended Indicators to be used with the offline chart:::
“Volume” indicator will be recommended so that helps you see the tick completion displayed in red turn to green at a glance.
To display 20 EMA, the indicator “Moving Average” or “Bollinger Bands” should be used.

:::In development:::
It seems that it is possible to substitute existing on the range indication etc. which had been created with the indicator version. An Independent indicator for supporting BobVolman’s method is under development.

ver1.02 Tick and Bars Speed displayable.
DOWNLOAD LINK Here TickConverter1.02

70tickchart 1pip (round up price)

70tick20EMA indicator for MetaTrader4

70tick20ema & MyCPanel

The original program was developed by Mr.Rondo(

Remodeling contents by me are below:
Rounding price for the candle bar to be displayed in the 1pip unit
Adding horizontal lines to be displayed change at the time of the appearance of the DD sign
Adding horizontal lines to support range imaging
We are adding a control panel to change or reset the number of DD and Range settings.

1. Download 70tick20ema.mq4 and myCPanel.mqh.
2. Put the *.mq4 file to ‘Indicator’ directory, and Put the *.mqh file to ‘Include’ directory.
3. Compile mq4 file in MetaEditor.
4. Let’s try on your chart.

Please try in various usage.
When the display becomes strange, turn off the chart, and try to re-display.

Option notice:
‘Ignore spread true’ means to absorb the spreads variable. When it is false, the bar price is displayed as supplied price by your fx broker.

Please download here(ZIP file) >>

Thank you.

New Script version is here > TickConverter v1.02


MQL4 & Visual C++2013 DLL with string

I’ll show you here a useful ‘dll’ for MQL4 of MetaTrader4 for Windows.
You may need ‘VisualStudio2013 & C++’. Of course, also MT4.
At first, I introduce you to some helpful web sites below; Many thanks to these genius authors!!.

Basic References MSDN References for VisualC++ Mr. roberr C++ entrance

Modern Coding C++ Modern C++ Mr.Yamamoto(Cyboze co Ltd) ModernC++11,14 std namespace? what is that

Stream Stream general help Stream basic filestream basic file coding

Unicode specific Code general Unicode problem TCHAR coding TCHAR Coding for filehandle character code of filename references on windows file system version(Unicode,sjis Japanese)

MT4’mql+dll’ Mr.amenbo Helpful document with 4step development method Document about MQL4 and DLL export table

Test fo file handling and string transition

I chose the 4 step method suggested by Mr.amenbo(see link), and add a bit shortcut.
Step 1 is the same as the original idea, so let’s begin.
I wrote ‘test.cpp’ as my solution name, but you can change as you like, within coding regulations.
‘%…%’ means replace proper string.
Many impressive sites exist, but difficult for beginners. My comments in the .cpp code below might be helpful for your .dll coding for MQL4. Because I spend considerable hours to understand how to call dll from MQL4, if you like this message, please give me your expected expenses.
You may try this code at a debug mode. Push ‘local debugger,’ and you can see a console window and prompt on the window.
Here, step 1 must be complete, easy? Or difficult?
If you have a question, please comment on this message. I don’t receive any e-mail from an unknown person.
Finally some important notices, I cannot speak English, as you know?… and I’m a native Japanese living in Japan.

Step 1-1 Create full code on C++

// test.cpp : Test for Console application for MT4
#include "stdafx.h"	// you must add these header below in this headerfile
// #include "targetver.h"
// #include <tchar.h>
// #include <locale>
// #include <string>
// #include <fstream>
// #include <iostream>
// #include <stdexcept>
// #include <limits>
#if defined(_UNICODE) || defined(UNICODE)
#  define tcout std::wcout
#  define tcin std::wcin
#  define tcout std::cout
#  define tcin std::cin
typedef std::basic_string<_TCHAR> tstring;
typedef std::basic_ifstream<_TCHAR> tifstream; // file in stream
typedef std::basic_stringstream<_TCHAR> tstringstream; // string in stream
_TINT no;	//Just for debugging
_TCHAR* hello(_TCHAR *file_name);	//prototype statement
_TINT _tmain(_TINT argc, _TCHAR* argv[]){
    _tsetlocale(LC_ALL, _T("ja-JP"));	//locale is important, don't forget
    _TCHAR file_name[] = _T("% fullpath and filename here %");
    tcout << hello(file_name);
    tcin >> no;	// test use only, just for prevent close console window
    return 0;
//+---------- function-------------------------------------------+
_TCHAR* hello(_TCHAR *file_name){
    // return and pass is both 'char pointer', it's important
    tstring s;	// string
    tstring ss;	// if you need formatted string, you can use 'tstringstream'
    FILE *fs;
    errno_t err;
    err= _tfopen_s(&fs, file_name, _T("rt, ccs=UNICODE"));
        // open err
        if (err != 0){
	    return _T("fail not open that file");	//takecare, file exist?
	    // success open file
	    tifstream ifs(fs);	// make a filestream
	    while (ifs >> s){	// you don't need use 'getline' method
	 	ss += s;	// just for string case. if you want to use stream...
 		// ss << s;	// like this.
	    tcout << ss;	//just for this test, strip this line when you copy code.
	_TCHAR out[1000]; //no intention this number, not too short and not too much
		err = _tcscpy_s(out, 1000, ss.c_str());		//also above
		if (err == 0){
			static _TCHAR *outp = out;	//keep address for MQL4
			return outp;
		else return _T("copy fail");

Step1-2 Create MQL side code

This method is an alternate method for Mr.amenbo’s.
The interface of mql and dll is quite easy. If you put ‘string’ to dll, the mql send that as a pointer to that string to dll. Dll receives as it and then return pointer, and the mql takes that as a string with an arrow. So you don’t need to create a ‘call program’ as step3 in Mr.amenbo’s method.
And there is one tip, ‘Alert’ method in mql does not work well, that title is ok, but contents may fail to draw the proper character.
If you can correct that problem, please tell me how to do that.
Partially, I choose the ‘MessageBoxW’ with windows API, imported by WinUser32.mqh.

//|                                                         test.mq4 |
//|                               Copyright 2015, UHL Software Corp. |
//|                   |
#property copyright "Copyright 2015, UHL Software Corp."
#property link      ""
#property version   "1.00"
#property strict
#include <stdlib.mqh>
#include <WinUser32.mqh>
#import "test.dll"
	string hello(string);	//put filename type 'string' and get data as 'string' in facto pointer
#property script_show_inputs
//| Script program start function                                    |
input string InpFilter="*";
void OnStart(){
    string file_name;	//NTFS=unicode、FAT=sjis
    int    i=1;
    long search_handle=FileFindFirst(InpFilter,file_name);
		//PrintFormat("%d : %s name = %s",i,GetLastError()==5018 ? "Directory" : "File",file_name);	//just for debug
	//--- executional code ---
	string terminal_data_path=TerminalInfoString(TERMINAL_DATA_PATH);	//search install path
	file_name=terminal_data_path+"\\MQL4\\Files\\"+file_name;	//test pattern
	//--- close search handle
	//PrintFormat("fullpath in MQL4: %s",file_name);	//just for debug
	string ret=hello2(file_name);
	MessageBoxW(0,ret,ret,flg);		//I cannot get over the 'alert' problem, so I use a windowsAPI on user32.dll, see header file
	//Alert(ret);		//You may see a error with charcter code probrem
    else Print("Files not found");

Step2 Create dll code

Important note is just below;
1) #define MT4_EXPFUNC __declspec(dllexport)
2) __stdcall
That is it.

1) Copy the header and target function code from the full system create above.
//+———- function——————————————-+
_TCHAR* hello(_TCHAR *file_name){……

2) Change that title of the target function below.
MT4_EXPFUNC _TCHAR* __stdcall hello(_TCHAR *file_name){……

3 Set build mode to ‘Release’, and select menu project>property>, and set ‘Structure Property>c++>code create-runtime library’ to ‘multiple sleds(/MT)’.

4 Build it.

You don’t need to create a module definition (.def) file. (at least on VC++2013? I’m not sure in facto… Please tell me, genius wizard)

Step3 Test!!

Did you make it?
If you missed it, let’s work harder. Please leave a message to this article.