double MACDcurrent =iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0); // returns 0 Print(DoubleToStr(iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0))); // returns 0.000123
How bout ...
Print(iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0));
?
Please use SRC button besides video button by the way.
Sorry about that...
Thanks for the reply.
I found a work around. I multiply the result from iMACD by a big integer(100000000) and then I get all the numbers I need after the decimal point and then if I divide that number by the same multiplier and I get the correct procession I need. I don't know if that is the right way, but it works.
I don't know if that is the right way
Hello guys,
It might be a stupid question but here it goes:
I have a double variable MACDcurrent and I call the iMACD function and I get 0 as a return, but when I do DoubleToStr I get 0.000123. How can I get that procession stored into my variable?
double MACDcurrent =iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0); // returns 0
Print( DoubleToStr( iMACD( NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0 ) ) ); // returns 0.000123
Am I doing something wrong?
Seems that if the 2nd parameter is not passed, then it will default to 8 digits.
Hello guys,
It might be a stupid question but here it goes:
I have a double variable MACDcurrent and I call the iMACD function and I get 0 as a return, but when I do DoubleToStr I get 0.000123. How can I get that procession stored into my variable?
double MACDcurrent =iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0); // returns 0
Print(DoubleToStr(iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0))); // returns 0.000123
Am I doing something wrong?
So I believe that your Print would have returned "0.00012300"
Did you not see Deysmacro's post? How do you determine that
double MACDcurrent =iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0);
returns 0. Why not Print MACDcurrent?
Seems that if the 2nd parameter is not passed, then it will default to 8 digits.
no, only by DoubleToString not DoubleToStr
double a =0.000123; Print("a = ",a); string a1=DoubleToStr(a); Print("a1 = ",a1);
2014.03.31 05:58:44.515 a1 AUDCAD,M5: a = 0.000123
the doc's says otherwise my mistake sorry
another reason not to read them ;-)
the doc's says otherwise my mistake sorry
another reason not to read them ;-)
Yes, but it is still better to do it correctly, maybe it defaults to 8 now, but maybe not in a future build.
Doesn't both means the same?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello guys,
It might be a stupid question but here it goes:
I have a double variable MACDcurrent and I call the iMACD function and I get 0 as a return, but when I do DoubleToStr I get 0.000123. How can I get that procession stored into my variable?
double MACDcurrent =iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0); // returns 0
Print(DoubleToStr(iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0))); // returns 0.000123
Am I doing something wrong?