takeprofit 30 pips but error 130? - page 2

 
i have no idea, i clear all Take Profit, but still Error 130...what is the problem!?!?
 
RaptorUK:
Well follow the link,  read,  learn,  change your code and be happy.  If you need it doing for you go here and pay:  MT4 & MT5 coding

ECN  <----- click this
 
anthor:

dude,i have followed the coding...if any mistake..pls advice.

ticket=OrderSend(Symbol(),1,Size,Bid,3* pips2points,0,Bid *  pips2dbl,"",Green);
Have you ???   Check this line again....
 
deVries:

Have you ???   Check this line again....
What he means is that he has copied and pasted the code . . . .  he doesn't actually follow it because he hasn't taken the time to read it,  understand it  or learn from it.  


He just wants code he can copy and paste . . . 
 
RaptorUK:
What he means is that he has copied and pasted the code . . . .  he doesn't actually follow it because he hasn't taken the time to read it,  understand it  or learn from it.  


He just wants code he can copy and paste . . . 


I just wanted pointed out the same by asking him ....   Giving the correct code is not my way teaching someone else so he get his own code to correct
 
RaptorUK:
What he means is that he has copied and pasted the code . . . .  he doesn't actually follow it because he hasn't taken the time to read it,  understand it  or learn from it.  


He just wants code he can copy and paste . . . 


ticket=OrderSend(Symbol(),1,Size,Bid,3* pips2points,0,Bid-30*pips2dbl,"",Green);
Take Profit 30 pips...still same the problem, only sometimes have problem..not always

2012.11.08 19:50:01    2012.10.10 14:10  Bar GBPUSD,H1: OrderModify error 130
 
anthor:

Take Profit 30 pips...still same the problem, only sometimes have problem..not always

2012.11.08 19:50:01    2012.10.10 14:10  Bar GBPUSD,H1: OrderModify error 130

Order Modify ?  show your code . . .
 
int     pips2points=3;    // slippage  3 pips    3=points    30=points
double  pips2dbl=30;       // Stoploss 15 pips    0.015      0.0150
int     Digits.pips;    // DoubleToStr(dbl/pips2dbl, Digits.pips)
int init()
  {
//----
   if (Digits % 2 == 1){      // DE30=1/JPY=3/EURUSD=5 forum.mql4.com/43064#515262
                pips2dbl    = Point*10; pips2points = 10;   Digits.pips = 1;
    } else {    pips2dbl    = Point;    pips2points =  1;   Digits.pips = 0; }
//----
   return(0);
  }

void OrderSell(double Size)
{
       int ticket=0;
                  while (ticket <= 0)
                  {   
                  Print("waiting");  
                  Print(3* pips2points);
                  ticket=OrderSend(Symbol(),OP_SELL,Size,Bid,3* pips2points,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(),OrderOpenPrice(),0,MarketInfo(Symbol(),MODE_BID)-PipsTP*pips2dbl,0,Blue) == false)
                             {
                                Sleep(1000);
                             }
                         }        
                  }
} 

void PendingSell(double Size,double Price)
{
       int ticket=0;
                  while (ticket <= 0)
                  {   
                  Print("Pending waiting"); 
                  ticket=OrderSend(Symbol(),OP_SELLSTOP,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-MarketInfo(Symbol(),MODE_POINT)*PipsTP,0,Blue) == false)
                             {
                                Sleep(1000);
                             }
                         } 
                  }          
} 
i think all the problem are solved...

thanks RaptorUK..
 
anthor:

all problem Solved...

I doubt it very much . . .   you don't want to know if your OrderModify() fails ?  and if it did fail why it failed ?  and what the value of key variables were at the time ?
 
RaptorUK:
I doubt it very much . . .   you don't want to know if your OrderModify() fails ?  and if it did fail why it failed ?  and what the value of key variables were at the time ?


u mean set like this?

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

to get the error code?

Reason: