Download MetaTrader 5

OP_BuyLimit - Error 130

To add comments, please log in or register
Have you developed a profitable strategy? Launch your trading signal and make profit from it!
John
17
John 2014.02.04 00:15 

I am trying to make a simple EA that can open and close limit orders at specific times. Every time I run the code I get an Error 130. The take profit and stop loss both look right. Could anyone look at the code and see if they can give me a better idea of what is causing the error?

Here is a piece of the code. The full EA is attached.

ticket=OrderSend(Symbol(),OP_BUYLIMIT,Lots,Ask+5*Point,3,NormalizeDouble(Ask-5*Point,Digits),NormalizeDouble(Ask+15*Point,Digits),"",MAGICMA,0,Blue)

I spent all weekend trying to figure this out but didn't have any luck. If anyone could help I would really appreciate it.

Thanks.

Files:
Alain Verleyen
Moderator
30736
Alain Verleyen 2014.02.04 00:32  

See this document : Requirements and Limitations in Making Trades.

A buy limit order have to be placed below market price, not above or it will be triggered immediately.

To add comments, please log in or register