![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Open properties for USDCAD symbol and look at Stops level. It is a minimum 100, my broker set 120.
Why would the MIN STOP be less?
Should spread fit into the calculation at all if I am defaulting to use the MIN_STOP level if my stop level is too small?
OrderSend error 130
Hi,
I am currently running some forward testing of my EA on demo account and I am facing a problem each time a position should be opened. EA returns error 130. I went through a lot of threads dealing with this problem, but seems that there is no problem with placing stops in my case.
Here is my OrderSend command for opening long position:
SL = Ask - (Stop_Loss*Point);
Limit = Ask - ((MarketInfo(Symbol(), MODE_STOPLEVEL) +
MarketInfo(Symbol(), MODE_SPREAD)))*Point;
if(SL>Limit) SL=Limit;
Ticket=OrderSend(Symbol(),OP_BUY,lots,Ask,3,SL,0,"",MAGIC,0,Red);
I tried this on FXopen and FXCM demo accounts with the same result. EA works without problems in backtesting.
Any help would be very appreciated.
Thank you.
Hi, problem solved. It seems that there is no chance to place stops within OrderSend when working with FXopen and FXCM. Simply I have to use OrderModify after opening a position to set SL/TP values.
Error ordersend 130
Working fine on demo account.
Always to send error ordersend(130) on real account.
I am used default settings and i am try all case but it not work. Please ! help.
Hi everybody ! i had fixed that problem.Thank so much
130
Working fine on demo account.
Always to send error ordersend(130) on real account.
I am used default settings and i am try all case but it not work. Please ! help.
Hi everybody ! i had fixed that problem.Thank so muchDo you use the same broker on both accounts? Post the code and we might be able to help a bit more. Best regards.
Do you use the same broker on both accounts? Post the code and we might be able to help a bit more. Best regards.
When ever you have a error 130 invalid stop when sending orders, most likely because you broker is ECN broker that doesn't allow a new order to have stop loss to be attached. Solution is to first ordersend(), then ordermodify().
Good to see the error 130 got solved. I would recommend that you normalize your rates too. Like this "NormalizeDouble(Ask,Digits)" and "NormalizeDouble(SL,Digits)". This will prevent annoying errors when backtesting.
Need help with Error 130
Hi Guys,
I started learning mql4 and made my first program. It compiles fine but gives Error 130 when placing an order. Here's the snippet:
...
pivot=((iHigh(NULL,0,1)+iLow(NULL,0,1)+iClose(NULL,0,1))/3); //calculates the pivot point of previous candle
if (Ask<pivot)
{
OrderSend(Symbol(),OP_BUY,0.04,Ask,3,Ask-iATR(NULL,0,1,1),pivot); //Buy at ask, SL at ATR of previous candle, TP at pivot
Alert (Symbol(),": ",GetLastError());
...I get an alert of Error 130, which I understand points to a stoploss or takeprofit problem. I checked the minimum stoploss allowed by my broker OANDA via Alert(MarketInfo(Symbol(), MODE_STOPLEVEL)); and the alert comes back as "0". Don't really know what's the problem. Hopefully someone can point out my mistake. Thanks.