Hi everyone,
I tried to store a price value into a variable:
double price = Ask;
and then
Print("price", price);
to check if it be stored properly, but it seems not be stored,
the result shows 0.
Who can help me find a way to store a price value into a variable?
Thanks a lot.
price is double variable and to print u need to convert it to a string so
Print("price",DoubletoStr(price,2));
price is double variable and to print u need to convert it to a string so
Print("price",DoubletoStr(price,2));
I don't believe that's correct information, shouldn't be necessary to convert to string just to print unless you specifically only wanted to see the value to 2 decimals.
Any chance you're variable is being reset before it gets printed?
Have you tried just printing Ask?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi everyone,
I tried to store a price value into a variable:
double price = Ask;
and then
Print("price", price);
to check if it be stored properly, but it seems not be stored,
the result shows 0.
Who can help me find a way to store a price value into a variable?
Thanks a lot.