You cannot Buy at Bid . . . it's the wrong price, hence . . . from the Documentation ( did you read it ? ) . . . . "The requested price has become out of date or bid and ask prices have been mixed up. "
RaptorUK:
You cannot Buy at Bid . . . it's the wrong price, ...
Meaning that you should be Buying at Ask :-)
You cannot Buy at Bid . . . it's the wrong price, ...
WHRoeder:
- Must buy at the Ask.
- Using a 1 pip slippage on a 5 digit broker. (Adjust for 4/5 digit brokers)
- Not checking return codes
Thank you. I cannot believe I made such a stupid mistake.
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
I am using version 4.0 Build 419.
I found an error 138 in my EA backtest in the strategy tester and then I tried to simplify the code to see what was wrong. But finally, it was simplifed to the following code.
int start()
{
OrderSend(Symbol(),OP_BUY,0.1,Bid,10,0,0," ",0,0,Blue);
return(0);
}
I tried using different time frames and different pairs, but nothing worked.
Please help me.