OrderSend (Symbol(),OP_BUY,Lots,Ask,5,Ask-200*Point,Ask+700*Point,"Normal",255,0,CLR_NONE);
Above line works for ordering one lot but give me error 130 whenever I tried to order 0.1 lot. Can anyone please help me why is the error and how to fix it?
Verify that 'Lots' complies with min lot size and min lot step
(accessible via MarketInfo(symbol, MODE_MINLOT) and MarketInfo(symbol,
MODE_LOTSTEP)). Also normalize the 'Lots' variable to the number of
digits your broker uses for lot sizes (https://docs.mql4.com/convert/NormalizeDouble).
I'm not sure this will solve your problem though, since error 130 is
invalid stops...
Or.. if this is a sub-pip account, the Slippage may be too small - try 50 instead of 5
-BB-
Instead of placing SL and TP with OrderSend(), I open the order without SL and TP and then Modify the order with SL and TP. It fix the problems.
OrderSend(Symbol(),OP_SELL,Lots,Bid,5,0,0,"Reverse",255,0,CLR_NONE);
OrderSelect(SELECT_BY_POS, MODE_TRADES);
if(OrderType()==OP_SELL && OrderSymbol()== Symbol()&& OrderComment()== "Reverse")
{
OrderModify(OrderTicket(),5,OrderOpenPrice()+(200*Point),OrderOpenPrice()-(500*Point),0,CLR_NONE);
}
Thanks for helping me.
Code is simple and robust now.
OrderSend(Symbol(),OP_SELL,Lots,Bid,5,0,0,"Reverse",255,0,CLR_NONE);
OrderSelect(SELECT_BY_POS, MODE_TRADES);
if(OrderType()==OP_SELL && OrderSymbol()== Symbol()&& OrderComment()== "Reverse")
{
OrderModify(OrderTicket(),5,OrderOpenPrice()+(200*Point),OrderOpenPrice()-(500*Point),0,CLR_NONE);
}
Thanks for helping me.
Hi EuroTrader,
Your solution is very dangerous. When You send the order, always use SL>0 and TP>0 in OrderSend() function !
Because during OrderModify() you can give Error code: 146 from the BROKER and you are looser.
Puncher
I think ET has established that his account is on an ECN broker so stops have to be 0 to get an order on
Re OrderModify, you just have to keep checking your open orders for stops - how often you do that depends on your strategy, every tick if you're scalping, every minute otherwise perhaps
-BB-
What exactly is an ECN Broker?
What exactly is an ECN Broker?
See this very useful site http://www.100forexbrokers.com/stp-ecn-brokers
-BB-
ET
See this very useful site https://www.mql5.com/go?link=https://www.100forexbrokers.com/stp-ecn-brokers
-BB-
ECN Forex brokers always have variable spreads. Only ECN brokers charge commission for trading Forex. Commission is the only revenue/profit an ECN broker receives. ECN brokers are not making money on bid/ask (spread) difference.
An STP Forex broker is compensated through the spread (spread markups - to be explained in details below).
The way this reads to me is that if a MT4 broker does not charge commission per trade (in addition to the spread) then they must not be an ECN broker. Is this true?
Are there any MT4 brokers that are ECN with the MT4 platform? (i.e. FXDD is listed as ECN but not for their MT4 platform)
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Above line works for ordering one lot but give me error 130 whenever I tried to order 0.1 lot. Can anyone please help me why is the error and how to fix it?