gunoiux Posted September 2, 2010 Report Share Posted September 2, 2010 Hello everyone. This is my first post which i decided to make because i need something, but also because i intend to give something if you help me - an interesting and useful indicator (in my opinion). I want a script which i cannot find anywhere on the internet, and not even something to get me going. This script would have to take values from different pairs (O-H-L-C-Vol) and combine them to give other values which will be put on an offline chart. For example, if I want to calculate EURUSD divided by EURGBP (which is of course GBPUSD), the script would have to open the .hst files for the respective pairs and perform the calculus based on given formula (EURUSD/EURGBP) and then put the result in a new .hst file which will contain OHLC, exactly like a normal pair. It would do this for the last 100 candles, for example. The script should be able to do other formulas, for example: (EURUSD+EURGBP)/2. So what I dont know is how i can open the .hst files, take the last 100 values and then put them in the new hst file. i have some basic understanding of programming, so i need just an idea on how to work exactly with those .hst files. Please if somebody could guide me here, i would be very grateful. And I promise to post my indicator here, and only here, to be used by everyone, because it may be very useful for many purposes, like arbitrage, correlations, averaging over multiple pairs... Again, please give me an idea, cause i cant find anything on the internet, cause the period_converter script did not help me and because Excel is driving me insane grrrrr... Thanks in advance! :) Quote Link to comment Share on other sites More sharing options...
iwjw Posted September 2, 2010 Report Share Posted September 2, 2010 Hello everyone. This is my first post which i decided to make because i need something, but also because i intend to give something if you help me - an interesting and useful indicator (in my opinion). I want a script which i cannot find anywhere on the internet, and not even something to get me going. This script would have to take values from different pairs (O-H-L-C-Vol) and combine them to give other values which will be put on an offline chart. For example, if I want to calculate EURUSD divided by EURGBP (which is of course GBPUSD), the script would have to open the .hst files for the respective pairs and perform the calculus based on given formula (EURUSD/EURGBP) and then put the result in a new .hst file which will contain OHLC, exactly like a normal pair. It would do this for the last 100 candles, for example. The script should be able to do other formulas, for example: (EURUSD+EURGBP)/2. So what I dont know is how i can open the .hst files, take the last 100 values and then put them in the new hst file. i have some basic understanding of programming, so i need just an idea on how to work exactly with those .hst files. Please if somebody could guide me here, i would be very grateful. And I promise to post my indicator here, and only here, to be used by everyone, because it may be very useful for many purposes, like arbitrage, correlations, averaging over multiple pairs... Again, please give me an idea, cause i cant find anything on the internet, cause the period_converter script did not help me and because Excel is driving me insane grrrrr... Thanks in advance! :) Take a look at the code of the "RenkoLiveChart_v3.2" EA....you'll find it with google This EA is designed to produce a renko chart that runs in offline mode In the code you can find the basic i/o functions for .hst files Quote Link to comment Share on other sites More sharing options...
gunoiux Posted September 3, 2010 Author Report Share Posted September 3, 2010 Take a look at the code of the "RenkoLiveChart_v3.2" EA....you'll find it with google This EA is designed to produce a renko chart that runs in offline mode In the code you can find the basic i/o functions for .hst files Thanks, iwjw! I made some progress and I have an idea on how to solve this. But... now I have another question, if you will be so kind to answer: how can I read backwards from a hst file? I know how to go to the end of file: FileSeek(file,0,SEEK_END), but how do I make a step backwards to read the previous record? That is what I need to solve the problem, so please again if you are kind answer me :) Thank you! Quote Link to comment Share on other sites More sharing options...
iwjw Posted September 3, 2010 Report Share Posted September 3, 2010 (edited) Thanks, iwjw! I made some progress and I have an idea on how to solve this. But... now I have another question, if you will be so kind to answer: how can I read backwards from a hst file? I know how to go to the end of file: FileSeek(file,0,SEEK_END), but how do I make a step backwards to read the previous record? That is what I need to solve the problem, so please again if you are kind answer me :) Thank you! First thing is, you have to know the size in bytes of a single record Next is the number of records --You could try whether the second FileSeek parameter accepts negative values (would be the size of one record ->offset=-xxx) --if it doesn't you could use a SEEK_SET with offset #ofRecords-1*#ofBytes/Record edit: think it should be #ofRecords-2 and the size of two records...offset=-2*xxx edit2: got confused...what's the previous record?...the latest one or that before Edited September 3, 2010 by iwjw Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.