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.
Try Ask[0] or Ask[1], current price, price of last full bar.
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.
Use Print("Price",DoubleToStr(price,Digits));
Try Ask[0] or Ask[1], current price, price of last full bar.
I think that would be a parse error.
Use Print("Price",DoubleToStr(price,Digits));
Agree that's a good way to show it, but not sure that's going to solve the issue if he's currently getting zero. Print should work just fine, I'd say it's something else here.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- 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.