It shows that
Double is 8 places, why not 48, but 52?
The variable HighBroadreachArr is always 6. Is the maximum 6? I think there must be something I don't know
The variable HighBroadreachArr is always 6. Is the maximum 6? I think there must be something I don't know
Looks like the sizeof() will always return 52, regardless of the array size. If you want to know the number of elements in an array use ArraySize().
I think the 52 bytes cover information about size, type of element, series flags and pointer to a memory area.
- www.mql5.com
Wrong, Floating-point has infinite number of decimals.-
Print out your values to the precision you want with DoubleToString - Conversion Functions - MQL4 Reference.
Looks like the sizeof() will always return 52, regardless of the array size. If you want to know the number of elements in an array use ArraySize().
I think the 52 bytes cover information about size, type of element, series flags and pointer to a memory area.
Because the fourth parameter of CopyClose determines how many closing prices to write into the array, I want to represent the closing prices with a variable instead of fixed values.
Because the fourth parameter of CopyClose determines how many closing prices to write into the array, I want to represent the closing prices with a variable instead of fixed values.
You can specify how many values you want to have copied, and if the values are present the array will be automatically resized (in case it is dynamic.)
But you must check if the history is present, especially when copying 'foreign' chart data during OnStart.
double HighBroadreachArray[]; void OnStart() { int values_wanted=6; int values_received=CopyClose(Symbol(),PERIOD_M5,0,values_wanted,HighBroadreachArray); if(values_wanted!=values_received) { Print("error copying ",values_wanted," prices from ",PERIOD_M5,": ",_LastError); return; } Print("HighBroadreachArray size: ",ArraySize(HighBroadreachArray)); Print("HighBroadreachArray values: "); ArrayPrint(HighBroadreachArray);
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
It shows that
Double is 8 places, why not 48, but 52?