takeprofit 30 pips but error 130? - page 3

 
anthor:

u mean set like this?

to get the error code?

What does  OrderModify()  return ?  it is NOT  a ticket number . . .  if you look at the Documentation and answer this question I guarantee that you will learn something.
 
RaptorUK:
What does  OrderModify()  return ?  it is NOT  a ticket number . . .  if you look at the Documentation and answer this question I guarantee that you will learn something.


is Bool, true and false...my pending function have a loop until ordermodify return TRUE....

void PendingBuy(double Size,double Price)
{
       int ticket=0;
                  while (ticket <= 0)
                  {
                  Print("Pending waiting"); 
                  ticket=OrderSend(Symbol(),OP_BUYSTOP,Size,Price,3*  pips2dbl,0,0,"",Green);
                  Sleep(1000);
                        if(ticket<0)
                                 {
                                  Print("OrderSend failed with error #",GetLastError());
                                 }
                         else if(ticket >0)
                         {
                             OrderSelect(ticket,SELECT_BY_TICKET);
                             while(OrderModify(OrderTicket(),Price,0,Price+PipsTP*pips2dbl,0,Blue) == false)
                             {
                                Sleep(1000);
                             }
                         }
                   }          
} 
 
anthor:

is Bool, true and false...my pending function have a loop until ordermodify return TRUE....

This is the code from your previous post . . .

ticket=OrderModify(OrderTicket(),Price,0,Price-MarketInfo(Symbol(),MODE_POINT)*PipsTP,0,Blue)

 How is that meant to work ?

 
anthor:

is Bool, true and false...my pending function have a loop until ordermodify return TRUE....

And if your OrderModify() fails you have no idea why . . .  you have no information in the log.  And if the OrderModify() continually fails your code ends up in an infinite loop and does nothing . . .   do you like the idea of that ?
Reason: