Wrote an advisor, there is a problem. - page 3

 
KONDOR >> :

>> corrected on page 2.

Didn't help((.

 
Run >> :

as for sigzag, try running the following code in the tester with speed set to minimum and throwing the indicator on the chart and use F12 to see what happens to the digits

in the upper left corner i hope you get my drift

Yep... all three buffers are zero:

0

0

0


Although Print("ZigZag = ", ZZ_1); outputs normal price values.

 

Noterday писал(а) >>

int start()
  {
//----
      int bar=-1;   
   for(int i=0; i<100; i++) {      
      if( zz( i)!=0){ bar= i;break;}
                          }
 double Lot=0.1;                      
 double  spred=MarketInfo(Symbol(),MODE_SPREAD)*Point;
    
 if( bar==1)   {      
   if( zz( bar)==High[ bar] && CalculateOrders(Symbol(),1)==0) 
   OrderSend(Symbol(),OP_SELL, Lot,Bid,10,High[ bar]+ spred +(10*Point),Ask-(10*Point),"SELL",0,0,Red ); else
   
   if( zz( bar)==Low [ bar] && CalculateOrders(Symbol(),0)==0) 
   OrderSend(Symbol(),OP_BUY, Lot,Ask,10,Low [ bar]       -(10*Point),Bid+(10*Point),"BUY", 0,0,Blue);                
              }
    
//----
   return(0);
  }

//+------------------------------------------------------------------+

 
int CalculateOrders(string simbol,int type) {   int count=0;

   for(int i=0; i<OrdersTotal(); i++)
     {
      if(OrderSelect( i, SELECT_BY_POS, MODE_TRADES)==false) break;
      if(OrderSymbol()== simbol )//&& OrderMagicNumber()==mn)
        {
         if(OrderType()== type)  count++;
        
        }
     }
     
 return( count);
  }
  
 //-------------------- фнкция зигизага --------------         
   double zz(int i){
   double res=0;
   res=iCustom(NULL, 0, "ZigZag", 12, 5, 3, 0, i);
   return( res);    }


Everything works for me! EURUSD


 

What do you mean, it's zero? Then why does it show up all right for me?

 
KONDOR писал(а) >>

So you need to work on your feet.

Error 130 - Incorrect stops. From the example documentation we can see:

ticket=OrderSend(Symbol(),OP_BUY,1,Ask,3,Bid-25*Point,Ask+25*Point, "My order #"+counter,16384,0,Green);

- stops for buy are placed in Ask. You:

OrderSend(Symbol(),OP_BUY, Lot(),Ask,10,Low [ bar] -(10*Point),B i d+(10*Point),"BUY", 0,0,Blue);

- stops for BUY in B i d.

 
hope >> :

Error 130 - Incorrect stops. From the example documentation we can see:

ticket=OrderSend(Symbol(),OP_BUY,1,Ask,3,Bid-25*Point,Ask+25*Point, "My order #"+counter,16384,0,Green);

- stops for buy are placed in Ask. You:

OrderSend(Symbol(),OP_BUY, Lot(),Ask,10,Low [ bar] -(10*Point),B i d+(10*Point),"BUY", 0,0,Blue);

- stops for buy in B i d.

but at 200 pips stop it makes no difference :)

 
KONDOR >> :

Everything works for me! EURUSD


And I have an Ordersend error of 130 :))))))))))))))))))))))

 
Run >> :

>> what do you mean it's zero? Then why does it work for me?

That's what I'm saying! Can it be something wrong with my quotes or my terminal?

 
Yes, it's very strange. It's probably something wrong with the terminal.
 
Reinstalling MT :)
Reason: