Why SymbolInfoDouble returns le-05

I have already answered that several times yet you insist in ignoring my advice. I have already stated that “le-05” is just a different notation for “0.00001” and if you want a different format, then print accordingly …

Print( "Point Size: ", DoubleToString( point, digits ) );

However, the value is correct and does not need to be corrected. It is just how you print it that makes a difference.

I understand I can print it differently. It does not work in a calculation. Cannot divide by le-05. It tells me I am dividing by zero, that is the problem.

Maybe I am not explaining this very well which is always possible. I am printing it out to debug and establish why i get an error for dividing by zero. I have isolated it to:

double point = SymbolInfoDouble(position_symbol,SYMBOL_POINT);

This outputs le-05. Yes I know I see that as its printed out and i can change it… it cant be divided by.

I give up! We tell you where things are wrong! We tell you where to place debug prints (and you don’t). And you give us the results of separate testing which has nothing to do with printing the actual values happening in your real-time code debugging.

We tell you to break up your code (for real, not just testing) so that it can be read and debugged more easily and you don’t!

If you are unwilling to follow advice, then we can’t help you much!

This is very bad coding:

if(orderType == 0){ //buy order
   orderPips = MathAbs((NormalizeDouble(((orderPriceCurrent - PositionGetDouble(POSITION_PRICE_OPEN))/SymbolInfoDouble(position_symbol,SYMBOL_POINT)),SymbolInfoInteger(position_symbol,SYMBOL_DIGITS)))/point_compat); //price 2 is current, price 1 is open
   if(orderPriceCurrent < PositionGetDouble(POSITION_PRICE_OPEN)){orderPips = orderPips * -1;}
}

I find this very hard to believe. Java is 100% OOP and Java devs wouldn’t concat string objects with other types…

I literally gave you the exact code to do this earlier ITT. @kaitking has spent a great deal of time spelling it out for you in increasingly simplified steps. What more information could you possibly need?

Hi Guys,

I went back and read the entire conversation again and had actually totally missed some posts. I spent 4 hours cleaning the code up and applying one other change from a post I hadn’t seen and surprise surprise it works.

string make_your_dang_doubles_a_string_before_concatination = DoubleToString(SymbolInfoDouble(_Symbol, SYMBOL_POINT), int(SymbolInfoInteger(_Symbol, SYMBOL_DIGITS)));

Thank you very much for all your assistance and pointing out where my bad habits are currently.

Awesome, no worries, and thanks for the humble response.