forex software

Create and Test Forex Strategies

forex software

Skip to forum content

Forex Software

Create and Test Forex Strategies

You are not logged in. Please login or register.


Forex Software → Expert Advisor Studio → Please help with Off Quotes error

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 6

1 (edited by kiwitrade7 2022-04-04 12:00:16)

Topic: Please help with Off Quotes error

Hey there,

I've created a portfolio EA in EA Studio which I tested on an MT4 account but some trades are not being opened due to an "off quotes" error — see below log file. This is annoying because it does not perform how I want and it might make more losing trades and less winning trades. Therefore I lose money when I could be making money with what should be a good EA.

How do I fix this error?
Can I do it in my EA code? Could I change the slippage number "10" to something like "30" in the OrderSend function? My broker has 5 digits for the EURUSD symbol.

Or do I need to try more times to place my orders like changing a function that controls 'order retries' or something? I'm pretty sure I have a good internet connection, it's ultra fast fibre.

// Send an entry order with SL and TP
ticket    = OrderSend(_Symbol, command, amount, price, 10, stopLoss, takeProfit, comment, magicNum, 0, arrowColor);
lastError = GetLastError();

// If order fails, check if it is because inability to set SL or TP
if (ticket <= 0 && lastError == 130)
  {
    // Send an entry order without SL and TP
    ticket = OrderSend(_Symbol, command, amount, price, 10, 0, 0, comment, magicNum, 0, arrowColor);

19:50:29.281    '24597377': ping to current access point Datacenter is 290.77 ms
0    20:13:51.131    '24597377': order #1917027 buy 0.01 USDCAD at 1.25192 closed due stop-loss at price 1.24979
0    20:30:11.348    '24597377': order sell market 0.01 EURUSD sl: 0.00000 tp: 0.00000
0    20:30:11.368    '24597377': order sell market 0.01 EURUSD sl: 0.00000 tp: 0.00000
0    20:30:11.489    '24597377': order sell market 0.01 EURUSD sl: 0.00000 tp: 0.00000
0    20:30:11.891    '24597377': order was opened : #1917413 sell 0.01 EURUSD at 1.11561 sl: 0.00000 tp: 0.00000
1    20:30:11.891    '24597377': order sell 0.01 EURUSD opening at market sl: 0.00000 tp: 0.00000 failed [Off quotes]
1    20:30:12.240    '24597377': order sell 0.01 EURUSD opening at market sl: 0.00000 tp: 0.00000 failed [Off quotes]
0    20:30:12.240    '24597377': order sell market 0.01 EURUSD sl: 0.00000 tp: 0.00000
0    20:30:12.744    '24597377': order was opened : #1917414 sell 0.01 EURUSD at 1.11564 sl: 0.00000 tp: 0.00000
0    21:00:11.188    '24597377': order buy market 0.01 EURUSD sl: 0.00000 tp: 0.00000
0    21:00:11.335    '24597377': order buy market 0.01 EURUSD sl: 0.00000 tp: 0.00000
0    21:00:11.625    '24597377': order was opened : #1917488 buy 0.01 EURUSD at 1.11513 sl: 0.00000 tp: 0.00000
1    21:00:12.028    '24597377': order buy 0.01 EURUSD opening at market sl: 0.00000 tp: 0.00000 failed [Off quotes]
0    21:15:11.399    '24597377': order buy market 0.01 EURUSD sl: 0.00000 tp: 0.00000
0    21:15:11.414    '24597377': order sell market 0.01 EURUSD sl: 1.30542 tp: 0.00000
0    21:15:11.485    '24597377': order buy market 0.01 EURUSD sl: 0.00000 tp: 0.00000
0    21:15:11.977    '24597377': order was opened : #1917542 buy 0.01 EURUSD at 1.11382 sl: 0.00000 tp: 0.00000
1    21:15:11.977    '24597377': order sell 0.01 EURUSD opening at market sl: 1.30542 tp: 0.00000 failed [Off quotes]
1    21:15:11.977    '24597377': order buy 0.01 EURUSD opening at market sl: 0.00000 tp: 0.00000 failed [Off quotes]
0    21:15:11.977    '24597377': order sell market 0.01 EURUSD sl: 1.30543 tp: 0.00000
0    21:15:12.420    '24597377': order was opened : #1917543 sell 0.01 EURUSD at 1.11375 sl: 1.30543 tp: 0.00000
0    21:30:11.232    '24597377': order buy market 0.01 EURUSD sl: 0.00000 tp: 1.12054
0    21:30:11.423    '24597377': order buy market 0.01 EURUSD sl: 0.00000 tp: 1.12055
0    21:30:11.685    '24597377': order was opened : #1917571 buy 0.01 EURUSD at 1.11371 sl: 0.00000 tp: 1.12054
1    21:30:12.023    '24597377': order buy 0.01 EURUSD opening at market sl: 0.00000 tp: 1.12055 failed [Off quotes]
0    21:45:11.726    '24597377': order sell market 0.01 EURUSD sl: 1.30351 tp: 0.00000
0    21:45:11.726    '24597377': order buy market 0.01 EURUSD sl: 0.99624 tp: 0.00000
0    21:45:11.804    '24597377': order buy market 0.01 EURUSD sl: 0.99624 tp: 0.00000
0    21:45:12.242    '24597377': order was opened : #1917632 sell 0.01 EURUSD at 1.11182 sl: 1.30351 tp: 0.00000
1    21:45:12.242    '24597377': order buy 0.01 EURUSD opening at market sl: 0.99624 tp: 0.00000 failed [Off quotes]
1    21:45:12.242    '24597377': order buy 0.01 EURUSD opening at market sl: 0.99624 tp: 0.00000 failed [Off quotes]
0    22:00:11.607    '24597377': order buy market 0.01 EURUSD sl: 0.96432 tp: 0.00000
0    22:00:11.676    '24597377': order buy market 0.01 EURUSD sl: 0.96432 tp: 0.00000
1    22:00:12.062    '24597377': order buy 0.01 EURUSD opening at market sl: 0.96432 tp: 0.00000 failed [Off quotes]
0    22:00:12.378    '24597377': order was opened : #1917652 buy 0.01 EURUSD at 1.11299 sl: 0.96432 tp: 0.00000

I've attached the EA so you can see the code.
Thanks for your time.
- Kiwitrade7

Post's attachments

1001002 Portfolio Expert EURUSD 26 EA's M15.mq4 85.11 kb, 7 downloads since 2022-04-04 

You don't have the permssions to download the attachments of this post.

Re: Please help with Off Quotes error

What is your broker saying? If you experience no connectivity issues, then the problem stems from broker's side, they are those who are rejecting the order, the question is why.

Re: Please help with Off Quotes error

I haven't tried contacting the broker yet. I didn't think it was a broker problem. Will ring them and give an update with what they say.

Re: Please help with Off Quotes error

That is a (scam) broker's "issue". Well, not really an issue, but simply a dirty trick to reject your orders, because they think you could make a profit and they´ll lose money with that specific trade, so they simply reject these with the "Off Quotes" message. The best thing to do if you get this repeatedly is to seek a good broker! I never ever had such a message/issue with IC Markets, which I am using since 2011 for live trading. Just if you need a recommendation...

Re: Please help with Off Quotes error

Ok thanks for your suggestions. I rang CMC Markets and they claimed it was just a problem with their demo accounts and doesn't happen in their live accounts. I just opened a live account so will see if the problem continues.

I mainly got the error when I ran the 6-chart M1 stress test as seen in Popov's tutorial videos; however, I haven't been getting the error much on my actual EA's which I run on the M15 timeframe on a demo account.

Re: Please help with Off Quotes error

Of course they tell you everything you want to hear so that you deposit real funds with them. Good luck, you'll certainly need it with that broker:

https://www.forexpeacearmy.com/forex-re … ets-review

Posts: 6

Pages 1

You must login or register to post a reply

Forex Software → Expert Advisor Studio → Please help with Off Quotes error

Similar topics in this forum