ObjectGetValueByShift Exact value

 

I'm trying to get value of a trendline, this is my trendline:

ObjectCreate("SellStopTP", OBJ_TREND, 0, CurTime()-(Period()*60*30), Low[Lowest(NULL,0,MODE_LOW,10,1)]-10*Point,CurTime(),Low[Lowest(NULL,0,MODE_LOW,10,1)]-10*Point);
      ObjectSet("SellStopTP",6,Tomato);
      ObjectSet("SellStopTP",7,STYLE_DOT);
      ObjectSet("SellStopTP",10,0);
      ObjectSetText("SellStopTP","SellStopTP");

then I want to get the price value of it like this:

double SellStopTP =ObjectGetValueByShift("SellStopTP",0);

The problem is the returned value is not exact and has less digits after decimal point,for example:

actual value must be 1.12345 but returned value is 1.1234

"My broker is 5 digit"

 
Zakarya Khezri: The problem is the returned value is not exact and has less digits after decimal point,

Floating-point has an infinite number of decimals, it's your not understanding floating-point and that some numbers can't be represented exactly. (like 1/10.)
          Double-precision floating-point format - Wikipedia, the free encyclopedia

See also The == operand. - MQL4 programming forum 2013.06.07

If you want to see the correct number of digits, convert it to a string with the correct/wanted accuracy.
          question about decima of marketinfo() - MQL4 programming forum 2016.05.18

 

Thanks William.

"#property strict" solved the issue but whole code needed some update.

cheers