Questions from Beginners MQL5 MT5 MetaTrader 5 - page 821

 
User_mt5:

I wonder what the developers will say about it.

They won't say anything. They're already sick of explaining it to everyone separately.

You just have to read more.

I can not explain anything with a clever look, but I read and understand that this is not from MT4 or 5, this is from Windows and the processor takes its origin. So, if this explanation is enough, then don't bother reading the translated values into strings or understand that what you see is not what counts in the formulas or is sent in a request to the trading server.

 
Alexey Viktorov:

They won't say anything. They're sick of explaining it to everyone separately.

You just have to read more.

I can't explain anything in a smart way, but I've read and understand that it's not from MT4 or 5, it's from Windows and the processor. So, if this explanation is enough, then don't bother reading the translated values into strings or understand that what you see is not what counts in the formulas or is sent in a request to the trading server.

Thank you, I have read it. The help explains in detail what the real numbers are, but I don't believe that this: "what you see is not what counts in the formulas or is sent in a request to the trading server.", that it should be.
 
Андрей:
Thank you, I have read it. The reference explains in detail what the real numbers are, but I don't believe that this: " what you see is not what is counted in the formulas or sent in a request to the trading server." that it should be.

But it's easy to check...

Send an order to open an order with lot 0.07 and print that value...


 
Alexey Viktorov:

But it's easy to check...

Send an order to open an order with lot 0.07 and print this value...


That's what I believe, I don't believe in "this is the way it should be".
 
Андрей:
That's what I believe, I don't believe that "it has to be this way ".

If it happens, then it must be so. Otherwise how can one fight if 0.07 produces ...... regardless of the software. After all, non-normalized 0.07 has the same bug. But, experiment with a number greater than 1, e.g. 13.07 and it won't be a problem.

 
Alexey Viktorov:

If this happens, it must be so. Otherwise, how can you fight if 0.07 is made into ...... regardless of the software. After all, non-normalized 0.07 has the same bug. But, experiment with a number greater than 1, e.g. 13.07, and it won't be a problem.

There is a note like this in the help:

"For example, the numbers 0.3 and 0.7 are represented in the computer as infinite fractions, while the number 0.25 is stored exactly as it is a power of two."

But that's just a matter of opinion.

 

Hello. Help me find out the number of the bar where the fast MA crossed the slow MA from bottom to top.

 
lil_lil:

Hello. Help me find out the number of the bar where the fast MA crossed the slow MA from bottom to top.


A rough algorithm:

  1. We create two handles in OnInit() (for fast and slow Moving Average indicator )
  2. In OnTick() (recommended to work only on a new bar, not on every tick) declare two arrays - one of them will copy values from the fast MA, the second array will copy data from the slow MA.
  3. Copy for example 100 last values (i.e. we should copy data from index "0" and number "100") from slow MA and fast MA into these arrays.
  4. We invert the arrays so that index #0 in the arrays corresponds to the rightmost bar in the chart.
  5. Now we only need to loop from "0" to "100-1" through both arrays and look for the intersection. When we find the intersection, the value of the loop variable will be the bar number.
Note: this algorithm does not take into account any checks and protections against errors.

 
Is there any way to know if a graphical object is deleted/modified in another window? (in which no programmes are running)
 
User_mt5:
Is there any way to know about deletion/modification of a graphical object in another window? (which has no running programs)

ObjectGetInteger(), chart_id property to help you

Reason: