double bid = SymbolInfoDouble(symbol_1, SYMBOL_BID); double ask = SymbolInfoDouble(symbol_1, SYMBOL_ASK);
-
You didn't state what symbol_1 is. You didn't state what the current chart is. You didn't state that symbol_1 is in Market Watch.
-
You said it returns zero, but you didn't state what the error code is.
Only those functions that return a value (e.g. iClose, MarketInfo, etc.) must you call ResetLastError before in order to check after.
-
On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
Download history in MQL4 EA - MQL4 programming forum - Page 3 #26.4 (2019)
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problem
-
You didn't state what symbol_1 is. You didn't state what the current chart is. You didn't state that symbol_1 is in Market Watch.
-
You said it returns zero, but you didn't state what the error code is.
Only those functions that return a value (e.g. iClose, MarketInfo, etc.) must you call ResetLastError before in order to check after.
-
On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
Download history in MQL4 EA - MQL4 programming forum - Page 3 #26.4 (2019)
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problem
Ok, after i check number 2, i think error in case XAUUSD. I will back soon after thinking fixed

- 2020.09.04
- www.mql5.com

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
When i use two code below, i get zero (0) return. I using it in OnTimer:
This is my full code:
This code get from 10-15 string (i call "command string") every 5 minute.
Example: String "1=XAUUSD=11*60=1=10.705=0" is set a order in case " XAUUSD", comment "11*60", type sell (1 is sell, 0 is buy), sl is 10.705 + Spread (see up code), tp is input (see up code)
When i run code, i see the 3-5 string first get 0 when call 2 code
After it, code run normal.
Any one have solution to fix it, thank you!