Get the number of decimal places of any numbers (not just quotes) bypassing Digits() in MQL4 and MQL5 - page 10

 
Dmitry Fedoseev:

There was one case for the trading panel to output the lot size with the correct number of decimal places in the text box. This is the only case.

Don't you do volume normalisation (when making trades)?
 
A100:

What's not to understand? Price has Digits(), but volume does not. That's how it's calculated.

Why do we need volume digits? For the same reason as the price digits!

But the volume has SYMBOL_VOLUME_MIN and SYMBOL_VOLUME_STEP which are enough without any intervention of users.

 
Alexey Viktorov:

But the volume has SYMBOL_VOLUME_MIN and SYMBOL_VOLUME_STEP, which are sufficient without the intervention of the user.

Enough for what? I take it you're not doing volume normalization either

 
A100:

Enough for what? For fakes? I take it you don't do volume normalisation either

Enough for character counts and normalisation, and without normalisation the mart does not pass.

 
Alexey Viktorov:

Enough for character count and normalisation, and without normalisation the market won't pass.

So I wonder why Dmitry Fedoseev writes about the only case (and exactly for table alignment, not for trading)

Apparently the Market is not rigorous enough

 
A100:

So I wonder why Dmitry Fedoseev writes about a single case (and not for the table alignment, but for trading)

Apparently, Market is not rigid enough

Dmitry Fedoseev not only writes about the table but also about the lot size

Forum on trading, automated trading systems and trading strategies testing

Getting the decimal places of any numbers (not only quotes) bypassing Digits() in MQL4 and MQL5

Dmitry Fedoseev, 2018.11.26 10:23

I've got one case for trading panel to output the lot size with correct number of dec imals in the text field. This is the only case.

and it doesn't matter if normalization is used for trading or displaying in the table. Normalization must be according to SYMBOL_VOLUME_STEP and there is nothing for the user's bad hands to do with this value.
 
Alexey Viktorov:

Dmitry Fedoseev writes not only about the table, but also about the lot size

and it doesn't matter what to normalize for, for trading or displaying in a table. Normalization must be according to SYMBOL_VOLUME_STEP and there is nothing to do with this value.

That was my message. It's like this.

 
Mesaoria:

In other words, do you use the user's entered minimum lot value (or lot increment) to determine how many digits are in this value, and then save it to normalise future values?

No, not by the entered value, but by the parameters of the symbol - by minimum lot and lot increment.

 
A100:
And you don't do volume normalisation (when making trades)?

This normalisation can also be done for 8 digits - it will be fine (if you first divide by the lot step, round it up, multiply by the lot step), there is no need to know the exact number of digits of the lot step.

But to make it look nice - you need to know the number of digits.

 
double is such a ***. all these doubles cause problems.

When will they make normal numbers for programming?

You can make a fractional number be stored in memory as an integer and a fractional part.

Reason: