Scripts: Save history to HST

 

Save history to HST:

The script exports historical data to HST format for its use in MetaTrader 4 client terminal. This file can be imported in MetaTrader 4 as historical data or you can open it as offline chart.

Initially, this script was designed for checking of the indicators, written in MQL4 and MQL5, because the same data needed for the compare.

Author: Andrey Voytenko

Save history to HST

 

why OFFLINE_RECORD_SIZEis used

when

int position=bars_back*OFFLINE_RECORD_SIZE;

always 0 ?

 
wlad:

why OFFLINE_RECORD_SIZEis used

when int position=bars_back*OFFLINE_RECORD_SIZE; is always 0 ?

All this is done to make WriteOfflineBar - the function of writing data to the history file - universal.

For example: if you need to update the value of a bar that is in the middle of the history, for example the penultimate one, then you specify bars_back=1 and it is updated.

 
avoitenko:

All this is done to make WriteOfflineBar - the function of writing data to the history file - universal.

For example: if you need to update the value of a bar that is in the middle of the history, for example the penultimate one, then you specify bars_back=1 and it will be updated.

thanks
 
Hello Mr Voytenko , my name is Regis Karam, I'm from Brazil and found very interesting your script.Here in Brazil we only have the real time signal on the metatrader 5, so I thought you could help me get our charts in real time in MT4 through your script or possibly turn this script on an indicator that can update the .hst file(rel-time) so that I can work with my system renko charts online, is it possible? I know little MQL5 and think it would be interesting to have an indicator that works this way, I have not found anything similar like it on the Internet.
Thanks,

Regis Karam
 
registk:
Hello Mr Voytenko , my name is Regis Karam, I'm from Brazil and found very interesting your script.Here in Brazil we only have the real time signal on the metatrader 5, so I thought you could help me get our charts in real time in MT4 through your script or possibly turn this script on an indicator that can update the .hst file(rel-time) so that I can work with my system renko charts online, is it possible? I know little MQL5 and think it would be interesting to have an indicator that works this way, I have not found anything similar like it on the Internet.
Thanks,

Regis Karam

Hello. Please look at this code:

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

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

Renko Charts
Renko Charts
  • votes: 10
  • 2009.12.16
  • baramantan
  • www.mql5.com
The Renko chart has been created by the Japanese Traders. The main feature of the Renko Charts is that it doesn't use the time and volume.
 

Thanks for quickly reply. I'm testing this Renko system in the Forex market, but my problem is that I don't have real time signal in Brazil stock exchange ,only in new MT5, so for me to use Renko Charts on MT4 I need .hst file to be updated with historical data in real time through the MT5 with your script or indicator (savehistoryhst.mq5). Can you add an update routine of data in real time, similar routines of periodcon.mq4 converted to MQ5? Then I open a chart on MT5 , load de script and open my MT4 accessing .hst file with updates in real time, would it be possible?

Thanks!

 

If hst file is imported into MT4 with the name of an instrument that is not in the market environment, then the chart displays quotes with fewer digits than specified in the file. For example, not 5 but only 4.

This prevents comparison of quotes. That's why we can go another way. Create a file with the existing MT4 instrument name and specify a non-standard timeframe, for example 11, 23, etc.

To set the required instrument name and timeframe, there are corresponding settings in the script.

 
Great script ! Thank you.
 
Great tool! I had to use Chat GPT to define some error message that printed, but in the end, I had it working. Thank you very much.