It could be an internal bug due to "old code" still being used, given that the previous version of the HST format used "double" for volume instead of "long" for the newer version.
thanks for the answer. I will try it now.
I used mqlrate structure, and in it volume is long.
so I have to create another struct.
//--- Structure that stores information about the prices, volumes and spread. struct MqlRatesNew { datetime time; // Period start time double open; // Open price double high; // The highest price of the period double low; // The lowest price of the period double close; // Close price double tick_volume; // Tick volume int spread; // Spread double real_volume; // Trade volume };
and change the rest of the code to see if this solves the problem. I will update this post...
thanks
It could be an internal bug due to "old code" still being used, given that the previous version of the HST format used "double" for volume instead of "long" for the newer version.
I tried a new struct in which I defined tick_volume as double... then type casted all volumes as (double) instead of (long) in the periodconverter script for a test.
it is creating the history but all candles have volume of 1 .
I checked the value in the print ... before writing the FileWriteStruct(ExtHandle,rate); it has the values.
maybe I should use FileWriteDouble... instead ? but as this is not csv and its Binary mode I don't know if that may work or not. I will try that now.
https://www.mql5.com/en/charts/15612922/usdcad-m2-grand-capital-ltd
- www.mql5.com
haha so I stop trying with converting the volume into double. as volume does not need decimal points anyways.
for now I just limited the volumes into that number...
if(rate.tick_volume>100000000000){ rate.tick_volume=100000000000; }
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hi, I faced an strange issue in my hst file builder app that when some pair has small price value so the volume goes more than "tick_volume>100,000,000,000" then metatrader4 gives "HistoryBase error" and destroys the candles data.
https://www.mql5.com/en/charts/15611872/shibusd-bin-m3-grand-capital-ltd
this is when I limit the volume in history to that number ( it starts working )
https://www.mql5.com/en/charts/15611840/shibusd-bin-m3-grand-capital-ltd
so its strange that despite tick volume is of type LONG and long max value is more than this number ... why does it face error when volume goes above that?
I searched but couldn't find any points in the documents. or the timeframe converter sample code.
https://www.mql5.com/en/forum/149178