Another Error Easy for experienced users to solve

 

here is where I have problems.I want to take a pending order and I have a hard time setting it up I have try many things but none works so far I always have error 130 even tough I have way out of the minimum range takeprofit and stoploss.I don,t know how to set this up properly maybe someone is willing to help me out

here is the code I have errors with these are the most likely to me try that I have made so far

double takeprofit = 95;




I have try this first 

     ticket3 = OrderSend("EURUSD", OP_BUYSTOP, lot, Ask+450*Point, 30, 0, 0, "", Magic, 0);
                OrderSelect(ticket3,SELECT_BY_TICKET);
             {
               tp3 = OrderTakeProfit();
               type3 = OrderType();
                   if (tp3 == 0 && type3 == OP_BUY)
                     {
                        OrderModify(ticket3, OrderOpenPrice(), Ask-10000*Point, Ask+(45+takeprofit*10)*Point, 0, Blue); 
                     }
            }  
Then I have try this too

      ticket3 = OrderSend("EURUSD", OP_BUYSTOP, lot, Ask+450*Point, 30, 0, 0, "", Magic, 0);
                OrderSelect(ticket3,SELECT_BY_TICKET);
             {
               tp3 = OrderTakeProfit();
               type3 = OrderType();
                   if (tp3 == 0 && type3 == OP_BUY)
                     {
                        OrderModify(ticket3, OrderOpenPrice(), OrderOpenPrice()-10000*Point, OrderOpenPrice()+(45+takeprofit*10)*Point, 0, Blue); 
                     }
            }       
 

u skipped one parameter (SL)

(& try OP_BUYLIMIT 2)

 
liquidd:

here is where I have problems.I want to take a pending order and I have a hard time setting it up I have try many things but none works so far I always have error 130 even tough I have way out of the minimum range takeprofit and stoploss.


ticket3 = OrderSend("EURUSD", OP_BUYSTOP, lot, Ask+450*Point, 30, 0, 0, "", Magic, 0);
You are specifying EURUSD instead of the usual Symbol(). 1) if you are not on the EURUSD chart then Ask is invalid price. 2) the actual symbol may not be exactly EURUSD (some brokers use EURUSDm for micro accounts etc.)
     ticket3 = OrderSend("EURUSD", OP_BUYSTOP, lot, Ask+450*Point, 30, 0, 0, "", Magic, 0);
                OrderSelect(ticket3,SELECT_BY_TICKET);
             {
               tp3 = OrderTakeProfit();
If the orderSelect fails the OrderTakeProfit, etc is meaningless. Always check return codes
ticket3 = OrderSend("EURUSD", OP_BUYSTOP, lot, Ask+450*Point, 30, 0, 0, "", Magic, 0);
if (ticket3 < 0){ Alert(GetLastError()); ... }
else if (OrderSelect(ticket3,SELECT_BY_TICKET)){
     tp3 = OrderTakeProfit();
Reason: