having trouble converting double to int then back to double - page 2

 
Feng Guozheng:

damn! such this problem i havd sloved ,

just by using the same code showed at the first post.

i know the issus about the float/double,why it is so difficult for you?

beats me you can run the indicator your self if you like 

 
imjeffd:

beats me you can run the indicator your self if you like 



Ok,here we go~


fist you need to know ,for easy to test,i do something to the code:


      double m1_IRS = iRSI(NULL,1,14,PRICE_CLOSE,0);
      m1_IRS=0.69;//for debug
i forced the m1 is 0.69,whick will be stored as  0.689999999999999  


the i change you code :

 ObjectSetText("m_1","M1    "+m1_IRS,9,NULL,m1color);

into

      //ObjectSetText("m_1","M1    "+m1_IRS,9,NULL,m1color); //Original
      ObjectSetText("m_1","M1    "+MyDoubleNormalization(m1_IRS,0.01),9,NULL,m1color); //fixed the display


so is your problem of #1 sloved ? :D

i leave the other M*_IRS unchange and don't forget to comment/deleted the m1_IRS=0.69 ,if it is ok for you.

Files:
rsibot.mq4  17 kb
 
Feng Guozheng:



Ok,here we go~


fist you need to know ,for easy to test,i do something to the code:


      double m1_IRS = iRSI(NULL,1,14,PRICE_CLOSE,0);
      m1_IRS=0.69;//for debug
i forced the m1 is 0.69,whick will be stored as  0.689999999999999  


the i change you code :

 ObjectSetText("m_1","M1    "+m1_IRS,9,NULL,m1color);

into

      //ObjectSetText("m_1","M1    "+m1_IRS,9,NULL,m1color); //Original
      ObjectSetText("m_1","M1    "+MyDoubleNormalization(m1_IRS,0.01),9,NULL,m1color); //fixed the display


so is your problem of #1 sloved ? :D

i leave the other M*_IRS unchange and don't forget to comment/deleted the m1_IRS=0.69 ,if it is ok for you.

seems good to me thanks 

Reason: