Need help with 4107 error

 

I'm a fairly experienced programmer, but still learning mql4. This one has me stumped. Apologies if this has been asked and answered, I can't find or deduce an explanation:

• Same EA running on EURUSD and AUDUSD in the same account.

• Executes fine on EURUSD but returns 4107 error on AUDUSD

• I've applied MODE_STOP values to all orders to avoid 129 and 130 errors.

• 4107 is documented to be a price parameter, not a price, error

Q1: How is it in MQL4 that a price parameter can be valid for one pair but not another?

Q2: What does MQL4 mean by "price parameter" as opposed to price value or format? The values were in bounds and as for format:

All I could think was maybe the integer "0" was missing from the front of AUDUSD, it being less than 1. I know this causes trouble if I forget to add it when I directly assign a number to a double variable. But the pending ticket looks fine with a "0.XXXXX" format showing, and in another account I send orders of AUDUSD, doing nothing to the number format and AUDUSD executes fine.

I thought I was beginning to understand these errors, now I just don't know.

Any help would be greatly appreciated.

 
No mind readers here. post your code.
 
LouK:
...

ERR_INVALID_PRICE_PARAM4107Invalid price.

Error 4107 seems to me very clear. Fix your code.
 
LouK:

I'm a fairly experienced programmer, but still learning mql4. This one has me stumped. Apologies if this has been asked and answered, I can't find or deduce an explanation:

• Same EA running on EURUSD and AUDUSD in the same account.

• Executes fine on EURUSD but returns 4107 error on AUDUSD

• I've applied MODE_STOP values to all orders to avoid 129 and 130 errors.

• 4107 is documented to be a price parameter, not a price, error

Use the Forum search . . . https://www.mql5.com/en/forum/136997/page2#779284
 
WHRoeder:
No mind readers here. post your code.

I have a follow up question below which I think is more precise and what I should have been asking about.

There's about 650 lines including all the inits, more than I think you want to look at. I'll post it if you wish, but at the moment I think I know where the problem lies - I just need to know more about MT4 behavior. I always entertain the notion that I may be wrong, but I don't see anything structurally wrong with the EA since it had been executing correctly up to this point. But perhaps it needs tuning for extreme price motion.

Three things I should have added to the post:

• The EA submissions have executed with no problem, on all pairs - just not in this instance. 1 out of 4 sends executed successfully - same code.

• The 15min bars were pretty steep in this instance.

• The sent stops were 40pips away, off the chart display, and the final bar never came within 30pips - yet I received in 3 out of four sends, 130 and 4107 errors.

The point that I was trying to make is that if the EA executes OK at other times, doesn't this suggest an environmental problem, not a script problem? Maybe prices were simply moving too fast in this instance. I adjusted the slippage, but maybe not fast enough.

Which brings me to the question I probably should be asking: I haven't used MQL4 in a couple of years, but I seem to recall a 130 error, even though it says invalid stops, being caused by an incorrect open price.

Q1: Can a too close entry send cause a 130 error? (Again - prices never came within 30 pips of the stop).

If I remember that correctly, it could be that after executing one order without difficulty, prices moved on causing the others to fail. But the open price is the only value that could have been too close.

Q2: Why "invalid stops" when placed so far away?

Thanks!

 
 

30 pips or 30 points (3 pips on a 5 digit broker)?

Without seeing your code we have no idea what's broken in your code. There are no mind readers here

You keep saying "too close" that is meaningless. There are no mind readers here. Post actual numbers.

 
LouK:

I have a follow up question below which I think is more precise and what I should have been asking about.

There's about 650 lines including all the inits, more than I think you want to look at. I'll post it if you wish, but at the moment I think I know where the problem lies - I just need to know more about MT4 behavior. I always entertain the notion that I may be wrong, but I don't see anything structurally wrong with the EA since it had been executing correctly up to this point. But perhaps it needs tuning for extreme price motion.

This is what you need to test and ensure for compliance: Requirements and Limitations in Making Trades
Reason: