Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 172

 
extern int aver_bar=3;					 // количество баров которые влияют на коефициент (входит и бар в котором ищется коефф.)
double muss[]; 						//  массив для коефициента поиска

for ( int n=1; n<=i; n++) 				// n - номер бара для поиска коеффициента, i- количество баров в которіх будет найдено коефф.
{
 double z,k,zz,f;
 
 k=0; 							// k счетчик
 z=Volume[n]; 						// Volume- буфер величины которую сравниваем, z-записываем чтобы каждый раз не обращаться в массив
 for (int m=n+1; m<=n+aver_bar-1;m++)			// перебор всех баров влияющих на коееф.
 {
  zz=Volume[m]/z-1; 					// отношение во сколько раз величина на исходном баре больше или меньше искомого 
  if( zz<0) zz= -1/(zz+1)+1; 				// если величина zz меньще 1
  k+=zz;						 // сумируем в k значение
 }
 muss[n]=k/((aver_bar-1)/1.0)+1;  			//  рассчітиваем коеффициент на n - м  баре
}

Well here is the code for it was calculated with sequence 1,2 0,8 1

Didn't check, but it should return the correct value

 
artmedia70:
And move them all to the left : Shift+Tab

Thank you!
 

I read the certificate. It says:

Записи в двух видах бинарных файлов представляют последовательность данных без каких-либо разделителей. Такой порядок записи определяется фиксированной длиной для данных разного типа: 4 байта для данных типа int, bool, datetime и color и 8 байт (или 4 байта, в зависимости от параметров функции записи) для данных типа double.

What is the meaning of "or 4 bytes depending on the parameters of the write function" ?

 
hoz:

I read the certificate. It says:

What is the meaning of "or 4 bytes depending on the parameters of the write function" ?


In C++ (not in MQL4) there is a more fractional separation of variable types (same in Delphi). There are 2 types of floating point formats: double (8 bytes) and float (4 bytes). In MQL4, as in normal stripped-down C, only double is known. The truth is that double is not the only floating-point number format in file read-write functions. Most likely, FLOAT_VALUE (4 bytes) is meant.
 
gyfto:

In C++ (not in MQL4) there is a more fractional separation of variable types (same in Delphi). There are 2 types of floating point formats: double (8 bytes) and float (4 bytes). In MQL4, as in normal truncated C, only double is known. The truth is that double is not the only floating-point number format in file read-write functions. FLOAT_VALUE (4 bytes) is most likely meant.

That's the point, mcl only handles double, while float is not recognizable. That's why I asked the question. It says double very clearly. It doesn't say anything about float. So there must be some justification for it.
 
hoz:

That's the thing: mcl only works with double, and float is not recognised. That's why I asked the question. It clearly says double. There's no mention of float. So there must be some justification for it.

Justification for what? Are we talking about files or data types?
 
hoz:

So there must be some justification for this.
A great deal of precision. And the purposes of this can already be interpreted in different ways.
 
tara:

Justification for what? Is it about files, or about data types?

I mean, the documentation doesn't mention that mcl works with the float data type. So, apparently, this feature is not provided.
 
hoz:

I mean, the documentation doesn't mention that mcl works with the float data type. So, apparently, this feature is not provided.

In file operations, it is provided.
 
tara:

In file operations - provided.

Where does it say that? It's not in the documentation. Or is it a deliberate cover-up? :)
Reason: