Download MetaTrader 5

need help with offline chart

To add comments, please log in or register
mrluck1
884
mrluck1  

I think metatrader 4 is all a trader will ever need, as metaquotes will try to end it, i found a way to keep it forever, using

offline charts, i see that period converter open a hst file and just refresh it every 2 seconds, on offline chart, my question is how to 

instead of use hst file, use a csv file with high, low, open, close, and time, it's possible to create an offline chart using a csv file? 

and how to code it? 

Jose Francisco Casado Fernandez
4411
Jose Francisco Casado Fernandez  

That does not make sense, because for MT4 to show a chart, there must be an .hst file with the data from the bars to build it. Even if you use a .csv file, you would still have to transform the data and save it in the .hst file

Therefore, it is faster as Period Converter does.

Regards.

mrluck1
884
mrluck1  

yes that's an old topic, it really seems more complicated to do, i even forgot about this post, thanks for reply anyway

alphatrading
64
alphatrading  

The way I do it is as follows:

(1) One terminal is connected to a regular price feed. It calculates indices, spreads, synthetic instruments and writes the data on-the-fly to full history sets (i.e. nine .hst files for all timeframes) in the history folder of another trade server. It also creates new symbols for those instrument if they don't yet exist on that server.

(2) On that "other history folder" runs a disconnected terminal using the written history for charting, analysis and also for trading (via a trade adapter). As the first terminal creates real symbols the second terminal doesn't run on offline charts but on regular online charts. These charts do not update the regular way (the terminal is disconnected) but are updated like offline charts once a second from the first terminal. There is a trick to make this work with regular charts which is documented here: https://github.com/rosasurfer/mt4-expander/issues/2

The terminal with the new symbols/charts is already expired, so MetaQuotes cannot break the setup by introducing new limitations. In the worst case MetaQuotes goes down the drain and disappeares, in which case I have to write a new price feed and trade adapter for another broker to continue trading wit MT4. But honestly, I don't see this coming.

mrluck1
884
mrluck1  

y

alphatrading:

The way I do it is as follows:

(1) One terminal is connected to a regular price feed. It calculates indices, spreads, synthetic instruments and writes the data on-the-fly to full history sets (i.e. nine .hst files for all timeframes) in the history folder of another trade server. It also creates new symbols for those instrument if they don't yet exist on that server.

(2) On that "other history folder" runs a disconnected terminal using the written history for charting, analysis and also for trading (via a trade adapter). As the first terminal creates real symbols the second terminal doesn't run on offline charts but on regular online charts. These charts do not update the regular way (the terminal is disconnected) but are updated like offline charts once a second from the first terminal. There is a trick to make this work with regular charts which is documented here: https://github.com/rosasurfer/mt4-expander/issues/2

The terminal with the new symbols/charts is already expired, so MetaQuotes cannot break the setup by introducing new limitations. In the worst case MetaQuotes goes down the drain and disappeares, in which case I have to write a new price feed and trade adapter for another broker to continue trading wit MT4. But honestly, I don't see this coming.


Yes that is exactly what i mean, in doing this you can have stability that you can use the same program forever, and trading need those kind of stability. MT4 is all a trader will ever need, and it's simple. The thing with russian engineering is that they are made to be useful and not have problems, if you could share your code for doing this it would be great, please share, i need this, long live MT4!

Jose Francisco Casado Fernandez
4411
Jose Francisco Casado Fernandez  
mrluck1:

yes that's an old topic, it really seems more complicated to do, i even forgot about this post, thanks for reply anyway

Ok. You are welcome. Regards.-
alphatrading
64
alphatrading  
mrluck1: ...if you could share your code for doing this it would be great...

Yes, some time ago I decided to share everything and make it public. Imho transparency and open-source are the only ways to go forward. However it needs a good developer and dedication and surely doesn't suit the average MQL user. You'll find everything at the above mentioned Github account.

Calculation of synthetic instruments: https://github.com/rosasurfer/mt4-mql/blob/1535e959c781c5b87f7b630f291f19eaf5f4b102/mql4/indicators/LFX-Monitor.mq4#L503
This indicator calculates multiple currency indices on-the-fly and records the data to .hst files. You can find an example of how this looks like in the first screenshot of the Github issue I mentioned in my previous reply.

Creation of real symbols and writing of full history sets to another trade server: https://github.com/rosasurfer/mt4-mql/blob/master/mql4/include/history.mqh
and https://github.com/rosasurfer/mt4-mql/blob/master/mql4/libraries/history.mq4

Communication between multiple terminals (trade commands, order execution etc): https://github.com/rosasurfer/mt4-mql/blob/1535e959c781c5b87f7b630f291f19eaf5f4b102/mql4/include/lfx.mqh#L1064

...just to point out some. All code runs in the most current builds and is 100% backward compatible to older ones. Be ready to invest some time to understand what's going on or maybe look for others to approach it together. In case of questions just create a regular issue and ask. You're welcome.

ps: These are not copy-n-paste scripts. While it's possible to copy-n-paste and successfully run the whole project it's recommended to study their work and to adapt it to one's own needs.
mrluck1
884
mrluck1  
thanks for sharing, i'll try to understand it 
To add comments, please log in or register