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

 
yen 3 digits, the rest 5 digits. Alpari.
 
alexey1979621:
yen 3 digits, the rest 5 digits. Alpari.

Request Digits from the programme to be printed.
 

Anticipate the question - I usually use the simplest option:

if( Digits%2>0.5 ){
         Points*=0.1;
         Speed*=0.1;
      }
 
tara:

Anticipate the question - I usually use the simplest option:

The priming didn't work.
 
alexey1979621:
The priming didn't help.

You've got the wrong attachment on the wrong side. Have you tried DoubleToStr() to "see with the right precision"?
 
alexey1979621:
This has been removed. But the problem lies elsewhere - in normalisation. For some reason the EA sees 4 decimal places instead of 5. How do I fix it?

What does this conclusion mean?
 
artmedia70:
You stuck the wrong hotkey on the wrong side. Have you tried DoubleToStr() to "see if it's accurate"?

Read the tutorial on this thing

string DoubleToStr( double value, int digits)
Converts a numeric value to a text string containing a character representation of a number in a specified accuracy format.
Parameters:
value - Value with floating point.
digits - A precision format, the number of digits after the decimal point (0-8).
Example:
 string value=DoubleToStr(1.28473418, 5); // the content of string value is "1.28473"


However, I still haven't figured out where to stick it in our case. Here we go again, boss.

int init()
{
              if (Digits ==3 || Digits ==5) // для пятизначного брокера
         {
            TakeProfit *= 10;
            StopLoss *= 10;
            Slippage *= 10;
            Step *= 10;
            BULevel *= 10;
            NotBULevel *= 10;
         }
      return(0);
}
 
alexey1979621:

Read the tutorial on this thing.

string DoubleToStr( double value, int digits)
Converts a numeric value to a text string containing a character representation of a number in a specified accuracy format.
Parameters:
value - Value with floating point.
digits - A precision format, the number of digits after the decimal point (0-8).
Example:


However, I still haven't figured out where to put it in our case. Save the guv'nor again.

 
Think. Just think, there is time.
 
alexey1979621:

Read the tutorial on this thing.

string DoubleToStr( double value, int digits)
Converts a numeric value to a text string containing a character representation of a number in a specified accuracy format.
Parameters:
value - Value with floating point.
digits - A precision format, the number of digits after the decimal point (0-8).
Example:


However, I still haven't figured out where to attach it in our case. Save the chief again.

There is nothing to attach it to.

This is where it can be attached:

Print("А ведь цена-то Ask ("+DoubleToStr(Ask,Digits)+") у меня однако с точностью Digits");
It is for output in string format, not for calculation.