Download MetaTrader 5

Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal

2016.03.25 14:10
Converting hst-files into csv files

Converting hst-files into csv files - script for MetaTrader 4

| English Español Русский 中文 Deutsch 日本語 Português

votes: 7
hst2csv.mq4 (5.66 KB)view

The hst2csv script is used for converting *.hst files to *.csv files, that can be imported into the MetaTrader 4 client terminal with no errors.

Script Operation Principle

  • The input_file_name parameter must be specified with the extension. Extensions other than *.hst are not processed;
  • The input_file_from_history parameter set to 'true' allows to open files from the current history folder (terminal_folder\history\server_name). If it is set to 'false', the file is opened from \\experts\files.

What is the purpose of this script: by the client's request, I once put together a history from the pieces given by the customer, and found out that not all files are read by the terminal at all when importing the data from a hst file. But the data inside is valuable. And this script converted all those non-importable files to csv, and comparing the file sizes - correctly.

Those who have a comma as a decimal point can have the quotes turn into dates when opening a csv in Excel... inevitably. I can not think of any other way than writing a separate function for converting the number to a string with "," as decimal separator. My system has ".", so I left it as is.

Translated from Russian by MetaQuotes Software Corp.
Original code:

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

Average Directional Movement Index (ADX) Average Directional Movement Index (ADX)

The Average Directional Movement Index Indicator (ADX) helps to determine if there is a price trend.

Modify All TP SL Modify All TP SL

The script modifies all orders (market and pending) on the symbol with specified Take Profit and Stop Loss.

iFractals 4all TF iFractals 4all TF

Buy or sell just by looking at the "arrow" as a signal. Very easy and simple.