Error 130 on microlots

 
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?
 
EuroTrader:
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-

 
Thanks Gordon & BarrowBoy,

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.
 
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.
 
EuroTrader:
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-

 
Thanks Puncher,

I just got one Error 146 from Ordermodify(). So I had a position with no SL and TP and I just manually put SL and TP and it seems OK. Thanks for warning though. I used to trade with no SL and TP for a very long time.
 
You are right BarrowBoy, my SL and TP has to be 0 for the EAs to be working with my broker's server. Thanks god my trades are only at the beginning of every 30 minutes.

What exactly is an ECN Broker?
 
ET


What exactly is an ECN Broker?


See this very useful site http://www.100forexbrokers.com/stp-ecn-brokers
-BB-
 
BarrowBoy wrote >>
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)

Reason: