You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello, hope you all good. This is my first time coding.
I'm getting this error with (Bid and Ask for MQL5) when I'm compiling my code for mt5
this is my code:
I'm getting this error: "Bid" undeclared identifier >>> "Ask" undeclared identifier
>> The code works well on MQL4 but this terms "Bid" and "Ask" are giving me errors on MQL5 code
>> My question is how do I call a Bid price and the Ask price in MQL5?
is there a term that i need to use?
Unlike MQL4, MQL5 does not have the predefined variables "Ask" and "Bid". So, you will have to assign them yourself, either by using the SymbolInfoDouble() function or by using the SymbolInfoTick() function.
If you want to mimic the MQL4 style of predefined variables, then you can use one the following examples (sample code is untested/uncompiled):