Hi there !
Need help (quite quickly !), lost money because of ...
Did I miss something ? Is there anyway to return the current price (ask/bid) ?
See SymbolInfoDouble() documentation :
Note
It is recommended to use SymbolInfoTick() if the function is used for getting information about the last tick. It may well be that not a single quote has appeared yet since the terminal is connected to a trading account. In such a case, the requested value will be indefinite.
In most cases, it is enough to use SymbolInfoTick() function allowing a user to receive the values of Ask, Bid, Last, Volume and the time of the last tick's arrival during a single call.
When you are using a function, you ALWAYS have to check the returned value. I don't know why you got a value of 0 but obviously there was an error.
P.S: It seems it's common situation.
Hi there !
Need help (quite quickly !), lost money because of ...
Did I miss something ? Is there anyway to return the current price (ask/bid) ?
EDIT : do I have to write to the service desk, it seems to me the syntax is definitively good ?
See SymbolInfoDouble() documentation :
When you are using a function, you ALWAYS have to check the returned value. I don't know why you got a value of 0 but obviously there was an error.
Checking always the returned value is kinda ... errrr ... I either don't know why, I will write to the service desk. How am I supposed to use SymbolInfoTick ?
MqlTick Tick; double LastPrice=SymbolInfoTick(Symbol(),Tick.ask);
Debug :
'ask' - parameter conversion not allowed
Checking always the returned value is kinda ... errrr ... I either don't know why, I will write to the service desk.
How am I supposed to use SymbolInfoTick ?
Debug :
It's good programming practice. But you are free to do it or not :-)
See an example here.
- 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 there !
Need help (quite quickly !), lost money because of ...
Did I miss something ? Is there anyway to return the current price (ask/bid) ?
EDIT : do I have to write to the service desk, it seems to me the syntax is definitively good ?