
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
Where are you getting your price data from then?
I use
Where esle can you get the current price data? MarketInfo(Symbo()l,Mod_Bid)returns the same value as Bid? If you get a 138 on the OrderSend() you need to do a RefreshRates() don't you?
https://www.mql5.com/en/forum/135058
Now you have me thinking my code may be wrong!
MarketInfo(Symbol(), MODE_BID) is not a Predefined Variable and is not affected by RefreshRates. MarketInfo(Symbol(), MODE_BID) will return the correct Bid price even if enough time has elapsed such that Bid is out of date.
Error 138 can be caused by things other than prices that are out of date, ". . . . or bid and ask prices have been mixed up." If there is enough time for price to change between you setting your price variable and you using it then it can become out of date . . . but using RefreshRates will not refresh your price variable.
Set a 10-20 pip slippage
Adjust your slippage value for 4/5 digit brokers.
Adjust your slippage value for 4/5 digit brokers.