ordermodify error 1

ALI AMRIOUI  
  • some one can plz help to (ordermodify error 1)
        //+------------------------------------------------------------------+
    //|                                                      ProjectName |
    //|                                      Copyright 2018, CompanyName |
    //|                                       http://www.companyname.net |
    //+------------------------------------------------------------------+
    
    double priceNew3,priceNew30,priceNew300 ;
    bool Trade =True;
    extern double lot = 0.01 ;
    extern double TP = 0 ;
    extern double SL = 0 ;
    extern int MagicNumber1 = 1917 ;
    input string EaName = "ATLAS" ;
    double MyPoint, Buyt, Buys, Sellt, Sells   ;
    int Ticket4,Ticket3,  cnt,Decimal;
    
    //+------------------------------------------------------------------+
    //|                                                                  |
    //+------------------------------------------------------------------+
    int OnInit()
      {
    
       if(Digits ==4 || Digits <=2)
          MyPoint=Point ;
       if(Digits ==3 || Digits ==5)
          MyPoint=Point*10 ;
    
       if(MarketInfo(Symbol(),MODE_MINLOT)<0.1)
          Decimal =2;
       else
          Decimal=1;
       return(INIT_SUCCEEDED);
      }
    
    //+------------------------------------------------------------------+
    //|                                                                  |
    //+------------------------------------------------------------------+
    void OnDeinit(const int reason)
      {
    
    
      }
    //+------------------------------------------------------------------+
    //| Expert tick function                                             |
    //+------------------------------------------------------------------+
    void OnTick()
    
      {
    
       if(TP == 0)
          Buyt = 0;
       else
          Buyt= Ask+TP*MyPoint;
       if(SL == 0)
          Buys = 0;
       else
          Buys= Ask-SL*MyPoint;
    
       if(TP == 0)
          Sellt = 0;
       else
          Sellt= Bid-TP*MyPoint;
       if(SL == 0)
          Sells = 0;
       else
          Sells= Bid+SL*MyPoint;
    
       double bolingbandlower2= iBands(NULL,0,20,2,0,PRICE_TYPICAL,MODE_LOWER,0);
    
       if(Trade)
         {
    //SELLSTOP3
          if(TS()<1 && TB()<1 && Total(OP_SELLSTOP)<1    &&Low[0]<(Close[1]-8*MyPoint) && Ask< bolingbandlower2 &&   Bid> bolingbandlower2-2*MyPoint)
    
            {
    
             priceNew3= bolingbandlower2-10*MyPoint ;
             priceNew30=priceNew3 +SL*MyPoint;
             priceNew300 =priceNew3 -TP*MyPoint;
    
             Ticket3= OrderSend(Symbol(),OP_SELLSTOP,lot,priceNew3,1, priceNew30,priceNew300,EaName,MagicNumber1,0,clrRed);
    
             Comment("last error", GetLastError());
    
            }
         }
    
    
     int total=OrdersTotal();
    for(int i=0; i<total; i++)
         {
          if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
     {
    
             //SELLSTOP3
    
             if(OrderType()==OP_SELLSTOP && OrderSymbol()==Symbol()&&OrderMagicNumber()==MagicNumber1)
               {
    
                priceNew3=bolingbandlower2-10*MyPoint   ;
    
                priceNew30 =priceNew3 +SL*MyPoint;
    
                priceNew300 =priceNew3 -TP*MyPoint;
    
                bool modify3 = OrderModify(OrderTicket(),priceNew3, priceNew30,  priceNew300,0,clrRed);
    
               }
    
            }
    
         }
    
      }
    
    
    
    
    //+------------------------------------------------------------------+
    //|                                                                  |
    //+------------------------------------------------------------------+
    int TS()
      {
    
       int s=0,i;
       for(i =0 ; i < OrdersTotal() ; i++)
         {
          if(OrderSelect(i,SELECT_BY_POS, MODE_TRADES))
             if(Symbol()== OrderSymbol()&& OrderMagicNumber() == MagicNumber1&& OrderType() == OP_SELL)
               {
                s++ ;
    
               }
         }
       return (s) ;
      }
    
    
    
    //+------------------------------------------------------------------+
    //|                                                                  |
    //+------------------------------------------------------------------+
    int TB()
      {
       int b = 0, i ;
       for(i=0; i < OrdersTotal() ; i++)
         {
    
          if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
             if(Symbol() == OrderSymbol() && OrderMagicNumber() == MagicNumber1 && OrderType() == OP_BUY)
               {
                b++;
               }
         }
       return (b);
    
      }
    
    // pending order
    //+------------------------------------------------------------------+
    //|                                                                  |
    //+------------------------------------------------------------------+
    int Total(int type=-1)
      {
       int total =0,i;
       for(i=0; i<OrdersTotal(); i++)
         {
          if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
             if(Symbol()==OrderSymbol()&& OrderMagicNumber()==MagicNumber1    && (OrderType()==type||type==-1))
               {
                total++;
               }
         }
       return (total);
      }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    .. i have all time this message in journal 
Keith Watford  
ALI AMRIOUI:
  • some one can plz help to (ordermodify error 1)
    .. i have all time this message in journal 

I have deleted your code.

Please edit your post and insert the code without the massive white spaces.

1 or 2 empty lines between sections is enough.

ALI AMRIOUI  
Keith Watford #:

I have deleted your code.

Please edit your post and insert the code without the massive white spaces.

1 or 2 empty lines between sections is enough.

ok

William Roeder  
ALI AMRIOUI: some one can plz help to (ordermodify error 1)
ERR_NO_RESULT
You Server
Change the SL to X It is at X!
Change the SL to X It is at X!
Change the SL to X You are insane
Insanity: doing the same thing over and over again and expecting different results.
          Unknown

Compute the new value, then check that you are moving the existing value at least a tick.
          What is a TICK? - MQL4 programming forum (2014)

ALI AMRIOUI  
William Roeder #:
ERR_NO_RESULT
You Server
Change the SL to X It is at X!
Change the SL to X It is at X!
Change the SL to X You are insane

Compute the new value, then check that you are moving the existing value at least a tick.
          What is a TICK? - MQL4 programming forum (2014)

thanks for u help .. but i have question  .. how one PIP equal for the TICK in mt4 ??