OrderSend error 2 and error 3 at one broker, not at others

 

I'm doing multiple broker backtesting for some strategies I've created. The data used for testing is the same at all brokers (via import). I'm testing using MT4 build 1010 on all. I'm not seeing any errors when testing my strategies at FXCM, Tallinex and ForexWare/TradeWiseFX however when testing on FXChoice I'm consistently getting OrderSend error 2 and error 3 errors about 7/8ths thru the backtest (okay prior to that) after which no new trades are taken.

I've done some searching around but can't find an answer to the problem.

What might be causing this?

 

Please see:

Files:
 
billworld2:

I'm doing multiple broker backtesting for some strategies I've created. The data used for testing is the same at all brokers (via import). I'm testing using MT4 build 1010 on all. I'm not seeing any errors when testing my strategies at FXCM, Tallinex and ForexWare/TradeWiseFX however when testing on FXChoice I'm consistently getting OrderSend error 2 and error 3 errors about 7/8ths thru the backtest (okay prior to that) after which no new trades are taken.

I've done some searching around but can't find an answer to the problem.

What might be causing this?

Well the error code tells you the reason! Error 3 means:

ERR_INVALID_TRADE_PARAMETERS

Invalid trade parameters


So just print out the values of your order function and compare them to what the broker requires, MatketInfo(..) or the mql5 one like SymbolInfo...()
 
Carl Schreiber:

Well the error code tells you the reason! Error 3 means:

ERR_INVALID_TRADE_PARAMETERS

Invalid trade parameters


So just print out the values of your order function and compare them to what the broker requires, MatketInfo(..) or the mql5 one like SymbolInfo...()

Why then is it working about 7/8ths of the way and only then fails? There must be something cumulative at play here which builds up to cause the failure.

I suspected a MaxLots ceiling might be the issue, but, it is not. 

 

Well, I am sorry but my crystal ball has got a crack - you have to check your values youself and compare them with the limits of the broker!!

Either print them out or put them on the chart with Comment(..) or ue the debugger.

 

It is going to be a problem with the broker's platform.

I had a similar problem with an EA I was using on different platforms like you for my boss and his strategies: SuperForex, InstaForex, LMFX, Alpari, ICMarkets, and ran mine on AAFXTrading and I got the same error that you did.

For me, I never got OrderSend error 3, but got OrderSend error 2 the whole time and never once got any trades to open for backtesting and was sure the same thing would happen on the demo while trading.


2017.07.14 21:20:11.160 2017.06.30 08:36:22  ARC Wave 2.62 XAUUSD,Daily: SELL XAUUSD 114.45, 1246.01, 0, 0, 0, 262071417, ARCW_262_0-24_D1

2017.07.14 21:20:11.160 2017.06.30 08:36:21  ARC Wave 2.62 XAUUSD,Daily: Creating SELL XAUUSD Error: 2 common error

2017.07.14 21:20:11.160 2017.06.30 08:36:21  ARC Wave 2.62 XAUUSD,Daily: OrderSend error 2


I suspected a MaxLots ceiling might be the issue too, but I checked the currency pair specifications to double check this, and felt that it is not too.


What if the specifications are incorrect and wrong?

What if the broker didn't correctly place the information in their platform currency pair's specification sheet though it looks correct?


I decided to try a couple things to make sure that all of my parameters are correct.

I kept rechecking the Lot size several times, and several more times, and several even more times, but everything seemed to be not working for me or working just the same.

I renamed my EA comment to take out "_" or "-".

I shortened the Magic Number to 1.

I was about to set the TargetPrice and StopLoss to a 1, but didn't get that far.

They were already both 0 (Zero).

I shortened my EA comment to 5 characters.

I set a Slippage of 3, 1, 0.01, and 0.

I didn't set a pending Sell or Buy order, so didn't need an expiration.

I rechecked the Symbol.

I rechecked the Price.

I rechecked the Color.


I checked everything many, many times.

I spent 3 days now troubleshooting OrderSend error 2, Error: 2 common error.


What? What does that mean?

What is it referring to?

What is it talking about?


I thought part of this way days before I read this forum post, but the MaxLots keeps eating at me.

I keep suspecting there to be a fake MaxLots ceiling, I decided to retest it again, and again.

I am more sure of it now, but decided maybe it is too high of a Lot size.


What if the specification is too high?

What if it is fake, even though it fits correctly with the Max Volume or MaxLots?

What if somehow the MaxLots or Max Volume internally is wrong, but on the screen externally looks perfectly fine?

What if the broker is lying about the true MaxLots?


Let's set the minimalist value for the Lots and see if it allows a trade to open.


Well now, look at that -- a trade really did open.

Solution, at least in my case, is the Maximal Volume or MaxLots of the currency pair.

Maximal Volume for XAUUSD on AAFXTrading says 1000.00.

My testing for true Maximal Volume is (when it opens up a trade) 104.00.

Reason: