A sub-workshop to fill in the FAQ (frequently asked questions). Let's help comrades! - page 6

 

Question: Can you tell me what is this tricky method of comparing doubles at satop, how does it work and what can it be used for?

double A;
double B;

if(NormalizeDouble(MathAbs(A-B),Digits)<0.1*Point)return(true);
else return(false);

Answer: First, the value normalized by the number of digits after the decimal point can equal either zero or some integer Point, i.e. you can simplify the notation of the function:

if(NormalizeDouble(MathAbs(A-B),Digits)==0)return(true);
else return(false);

Further, since equality to zero is checked, the sign of the number no longer matters, i.e. the function entry can be further simplified:

if(NormalizeDouble(A-B,Digits)==0)return(true);
else return(false);

For those who doubt whether the last version of the function is identical to the original, the following script can be used to test it:

int start(){

  while(!IsStopped()){
  double A=StrToDouble("0."+DoubleToStr(MathRand(),0));
  double B=StrToDouble("0."+DoubleToStr(MathRand(),0));
  if(F1(A,B)!=F2(A,B)){
  Alert("A="+A+", B="+B);
  }
  Sleep(1);
  }

  return(0);
}

bool F1(double A,double B){
  if(NormalizeDouble(MathAbs(A-B),4)<0.1*0.0001)return(true);
  else return(false);
}

bool F2(double A,double B){
  if(NormalizeDouble(A-B,4)==0)return(true);
  else return(false);
}

If, when running this script, a message box opens at least once, it means that the results of the two versions of the function are not identical. It was not possible to wait for this window to appear within 30 minutes.

Now let's see how the function works.

Suppose Digits=0, respectively Point=1 (for clarity, with any other value of Digits, the result is similar).

For instance, A=1.4, B=0.6. If we round both numbers according to rounding rules (at Digits=0, we are interested exactly in integers), then we get A=1, B=1, i.e. both numbers are equal. If you first subtract B from A, you will get 0.8, which after rounding is 1, i.e. A and B are not equal.

To check for equality of two prices, the method is applicable. However, whether or not to apply it to check for equality of, for example, the values of two moving averages, depends solely on the subjectivity of personal perception of equality or non-equality of the numbers, as shown above.

:)



 

Question: What is leverage?

Answer: We can say it is a characteristic reflecting the amount of margin required to open and maintain a position. For example, with 200 leverage and a $1000 deposit on EURUSD you can open a position of no more than one lot. With a leverage of 100, under the same conditions, the maximum position is 0.7 lots, etc. etc.


 


A glossary of stock exchange terms will form a separate section in the FAQ


and will be indexed for easy reference searching
 
sergeev:


The glossary of stock exchange terms will be a separate section in the FAQ.

and will be indexed for easy reference searching

About leverage, what Integer"answered" should be included in the Dictionary of Stock Market Terms FAQ.

I can take care of that part, instead of forming a separate file, as I suggested at first.

There, or a separate section can be placed near-trading terms.


PS. But I am confused by one thing - isn't it too late to do such a big job on FAQ for MT4, maybe for MT5 at once?

 
joo:


PS. Only one thing confuses me - isn't it a bit late to do such a big job on the FAQ for MT4, maybe for MT5 at once?


So it doesn't make much difference yet. Many things are timeless.
 
Besides, if you look at the rate at which brokers are adopting the five, the four will yet outlive us.
 
joo:

I can take over this part, instead of forming a separate file as I suggested at first.
There, too, or in a separate section, you can put the near-trade terms.

The terms have already been collected today.

I found two variants on the web. I have found one of them completely and put it in a chm. But of course I have seen broader references.

Have a look at the attached file. If you have thoughts and plans for improving this section of terms, you're welcome to do so. It's yours.

Files:
mql4_6.zip  215 kb
 
The only thing that confuses me is whether it's a little late to do such a big job on the FAQ for MT4, maybe for MT5 right away?
FAQ4 will be the first one on which the work of the whole system will be tested. Especially not before MT5 massively yet this year.
 
sergeev:
The terms have already been collected today.

I found two versions on the web. One of them is complete and transferred to a chm. But of course I have seen broader help.

Have a look at the attached file. If you have thoughts and plans for improving this section of terms, you're welcome to do so. It's yours.

OK, I'll take care of that section (editing and adding).
 

this is a link to WinCHM http://files.mail.ru/BE1R5B

and the archive contains the project with your subdivision. Back it up with the same archive of the complete project.

Files:
vocabulary.zip  89 kb