I've tested my EA on multiple currencies with spread current and all I can see is that I cannot use Spread Current in tester with the EA that I wrote. No errors occur if using a spread of 2 or 5, etc. I haven't seen this kind of problem come up on the web (or on google) so I'm worried my coding isn't somehow normal unless its just MT4 data.
What I'm hoping for is that anyone may offer Any suggestions for making it work with spread current, or in general work better.
Here's where I'm getting the error...
Attached
I'm pretty sure it has nothing to do with Spread . . . you Buy at Ask and Sell at Bid . . . not this . . .
if(CMD==BUY) { newSL=Bid-StopLoss*SymPt; newTP=Bid+TakeProfit*SymPt; _price = Bid; if(_ecn){_ticket=OrderSend(_symbol,Cmd(CMD),Lot(),_price,_slippage,0.0,0.0,_comment,newMagic,0,_buyarrow);} else{_ticket=OrderSend(_symbol,Cmd(CMD),Lot(),_price,_slippage,newSL,newTP,_comment,newMagic,0,_buyarrow);} } if(CMD==SELL) { newSL=Ask+StopLoss*SymPt; newTP=Ask-TakeProfit*SymPt; _price = Ask; if(_ecn){_ticket=OrderSend(_symbol,Cmd(CMD),Lot(),_price,_slippage,0,0,_comment,newMagic,0,_sellarrow);} else{_ticket=OrderSend(_symbol,Cmd(CMD),Lot(),_price,_slippage,newSL,newTP,_comment,newMagic,0,_sellarrow);}
. . . also bear in mind that Sleep() does nothing in the Strategy tester, neither does RefreshRates()
You are getting error 138 because . . . "bid and ask prices have been mixed up."
I'm pretty sure it has nothing to do with Spread . . . you Buy at Ask and Sell at Bid . . . not this . . .
. . . also bear in mind that Sleep() does nothing in the Strategy tester, neither does RefreshRates()
You are getting error 138 because . . . "bid and ask prices have been mixed up."
So cool!! my mind is just warped

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I've tested my EA on multiple currencies with spread current and all I can see is that I cannot use Spread Current in tester with the EA that I wrote. No errors occur if using a spread of 2 or 5, etc. I haven't seen this kind of problem come up on the web (or on google) so I'm worried my coding isn't somehow normal unless its just MT4 data.
What I'm hoping for is that anyone may offer Any suggestions for making it work with spread current, or in general work better.
Here's where I'm getting the error...
Attached