Mq4 Ordersend Error 130
Contents |
in or register 2 mark1808 2010.01.18 13:41 Hi, I know there are similar questions to this one mql4 ordersend error 138 elsewhere on the forum, but none of them seem to solve
Order Modify Error 130
the problem with my script. I am fairly new to MQL4, so I'm not sure if there's ordermodify error 1 something obvious that I'm doing wrong. I have simplified my problem down to placing a simple limit order. Whenever I try to place an OP_BUYLIMIT order, I get
Error 130 Mql4
the error #130. I am using the Alpari UK Demo account. This is my code.... int Limit = 10; int stoploss = 2000; int takeprofit = 2000; double BuyLimitPrice = Ask-(Limit*Point); double StopPrice = Ask-((Limit+stoploss)*Point); double TakeProfitPrice = Ask+((-Limit+takeprofit)*Point); Print(BuyLimitPrice + " Stop: " + StopPrice + " TakeProfit: " + TakeProfitPrice); int ticket=OrderSend(Symbol(),OP_BUYLIMIT,0.1,NormalizeDouble(BuyLimitPrice,Digits),5,NormalizeDouble(StopPrice,Digits),NormalizeDouble(TakeProfitPrice,Digits),"LimitTest",0,0,Blue); I mql4 ordermodify error 130 have been testing it on GBPUSD and get the following output: 2010.01.18 10:18:47 2009.12.30 23:59 LimitTesting GBPUSD,H1: OrderSend error 130 2010.01.18 10:18:47 2009.12.30 23:59 LimitTesting GBPUSD,H1: 1.60740000 Stop: 1.58740000 TakeProfit: 1.62740000 I have placed the stoploss and take profit values a fair distance away from the current price and the limit order price, so I'm sure there must be something else wrong. I have also tried setting the stoploss and take profit values to zero, and this gives the same error. Any help would be greatly appreciated. Thanks in advance. Mark similar Differenz between OP_BuyStop und OP_BuyLimit Only take a position on a negative trend? limit order help required please Use order limit Simple "Script" 1936 BarrowBoy 2010.01.18 14:42 # Your pending order price is 'too close to market' Alpari is sub-pip so your value for Limit is only one full pip Your entry point for a pending order needs to be further away from current price Good Luck -BB- similar Can dei
Page Last Post Printable Version Similar Threads EA error message (0) no error 6 replies Fixing CCI histogram in my EA 6 replies Need help fixing this indicator 1 reply MT4 EA error- when placing trade getting error 0 rate on ask 3 replies ATR
Ordersend Error 4107
indicator needs fixing 2 replies Platform Tech / Reply to Thread Subscribe Fixing Error 130
Mql4 Error Codes
- MT4 Post #1 Quote First Post: Feb 19, 2013 11:47am Feb 19, 2013 11:47am trumpjr | Joined Feb 2010 | Status: Member | ordersend error 131 15 Posts I am receiving error 130 when I run my EA. Below is the code for buying: Inserted Code ticket=OrderSend(Symbol(),OP_BUYSTOP,Lots,HighBar1+BuySellBuffer*PointFive,3,0,0,"My EA",12345,0,Green); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice()); OrderModify(OrderTicket(),OrderOpenPrice(),HighBar1-HighMinusLow-(StopBuffer*PointFive),HighBar1+TakeProfit2,0,Green); } else Print("Error opening SELL order : https://forum.mql4.com/29061 ",GetLastError()); return(0); The reason I am getting error 130 is that this places a buy stop two pips above the previous bar. When a candle closes near the high is when I get this error and sometimes the order never fills. Any ideas on how I could make this work when this happens? Post #2 Quote Feb 19, 2013 12:34pm Feb 19, 2013 12:34pm fxtr51 Joined Jan 2010 | Status: Member | 1,163 Posts If you insert http://www.forexfactory.com/showthread.php?t=411201 "error 130 mt4" into google, you will get more than 60.000 hits. I picked 2 : http://thetrademachine.com/blog/2010...d-stops-error/ http://www.earnforex.com/blog/2008/1...30-what-to-do/ Post #3 Quote Feb 19, 2013 12:39pm Feb 19, 2013 12:39pm trumpjr | Joined Feb 2010 | Status: Member | 15 Posts These are not solutions to the problem. I understand what the problem is, I don't know how to code it to resolve it. I get error 130 because of the fact that my open price on my buy stop is to close to my current price. If the price continues to go up will never get filled. What I'm wondering is there a way to increase the open price by X amount when this happens until it gets filled? Post #4 Quote Edited at 3:08pm Feb 19, 2013 2:17pm | Edited at 3:08pm fxtr51 Joined Jan 2010 | Status: Member | 1,163 Posts Quoting trumpjr Disliked These are not solutions to the problem. I understand what the problem is, I don't know how to code it to resolve it. I get error 130 because of the fact that my open price on my buy stop is to close to my current price. If the price continues to go up will never get filled. What I'm wondering is there a way to increase the open price by X amount when this happens until it gets filled? Ignored The two links
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us http://stackoverflow.com/questions/27240934/modifying-order-returns-error-130 Learn more about Stack Overflow the company Business Learn more about hiring developers or https://www.mql5.com/en/forum/56281 posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Modifying order returns error 130 up vote 1 down error 1 vote favorite I'm trying to modify an order, but I keep Error modifying order!, error#130. I'm using an ECN broker, so I need to modify the order to set a stoploss/takeprofit. What I am doing wrong? int digits = MarketInfo( Symbol(), MODE_DIGITS ); if ( digits == 2 || digits == 3 ) pipdigits = 0.01; else if ( digits == 4 || digits == 5 ) modify error 130 pipdigits = 0.0001; selltakeprofit = Ask + ( takeprofit * pipdigits ); sellstoploss = Ask - ( stoploss * pipdigits ); ticket = OrderSend( Symbol(), OP_SELL, lotsize, Ask, 100, 0, 0, 0, 0, 0, CLR_NONE ); if ( ticket < 0 ) { Print( "venda Order send failed with error #", GetLastError() ); Print( "stop loss = ", sellstoploss ); } else { Print( "Order send sucesso!!" ); Print( "Balance = ", AccountBalance() ); Print( "Equity = ", AccountEquity() ); bool res = OrderModify( ticket, 0, sellstoploss, selltakeprofit, 0 ); if ( res == false ) { Print( "Error modifying order!, error#", GetLastError() ); Print( "sellstoploss ", sellstoploss ); Print( "selltakeprofit ", selltakeprofit ); Print( "StopLevel ", StopLevel ); Print( "Ask ", Ask ); } else { Print( "Order modified successfully" ); } } mql mql4 share|improve this question edited Dec 13 '14 at 18:39 user3666197 7,85721330 asked Dec 2 '14 at 2:33 Filipe Ferminiano 1,14722046 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote accepted Error #130 is ERR_INVALID_STOPS. The most likely problem is that a) the stoploss level you are inputting is too close to the order open price. This is dictated by Mar
log in or register Do you need a trading robot? Orderit via Freelance service! 114347 Forex Trader 2008.11.09 19:38 I am receiving an error when attempting to open a Long position: OrderSend Error 130 Error Opening Long Order: 130 Here is the code, which was modified from a expert advisor that can open trades without error. So I'm not sure why I'm receiving this error. if(BarClose