Stops are too close, or prices are ill-calculated or unnormalized (or in the open price of a pending order). The attempt can be repeated only if the error occurred due to the price obsolescense. After 5-second (or more) delay, it is necessary to refresh data using the RefreshRates function and make a retry. If the error does not disappear, all attempts to trade must be stopped, the program logic must be changed.
Ok I see, thank you for your fast reply. I will try to widen a little the SL or to change the code to retry the opening.
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
Hi all,
I am coding an EA (MQL4) and with my strategy I want to use the tightest SL that the broker allows.
For a BUY order :
For a SELL order :
double sl = Ask + stopLevel;
I have tested the EA on my live account, most of the time the orders are correctly opened, sometime there are offquotes (there is not a problem, I know it can happens) but sometimes an order is not opened because of an "Invalid S/L or T/P" :
In the Expert logs tab my EA print some informations for debugging :
You can see it is an error 130 ("Invalid stops") but I don't understand what's the problem :
It is a buy order, stop loss = Bid - stop level = 1.28776 - 0.0002 = 1.28756
And I have 2 orders with this errors and 6 orders OK.
Thank you for your help !