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?
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.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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.