Ordersend error 130

 

Hello,

I've been trying to get my ordersend function to work but I keep getting error 130. The function is as follows:

currentOrder = OrderSend(currencies[i], OP_SELL, 0.1, Bid, 3, Bid+(MarketInfo(currencies[i], MODE_STOPLEVEL) + MarketInfo(currencies[i], MODE_SPREAD))*0.0001, Bid-(MarketInfo(currencies[i], MODE_STOPLEVEL) + MarketInfo(currencies[i], MODE_SPREAD))*0.0001,”Sell”, BlueViolet); 
What can I do to fix this?
 

130 means:

ERR_INVALID_STOPS 130 Invalid stops.


so either the stops are to close or in another way not valid or your broker just does not accept an order with target and stop. In this case send OrderSend() without stop or target and then send an OrderModify()

to set stop and target.

 
okay thank you will try that