OP_BuyLimit - Error 130

 

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:
 

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.

Reason: