Любой вопрос новичка, чтоб не захламлять форум. Профи, не проходите мимо. Без вас никуда - 6. - страница 782

 
Leonid123456:
в тестере ничего...
OrderSelect() где прописан?
 

выше 

for(int d=0; d<OrdersTotal(); d++)

if(OrderSelect(d,SELECT_BY_POS))      

 
полностью код надо, так непонятно, кусок здесь, кусок там...
 
Leonid123456:

выше 

for(int d=0; d<OrdersTotal(); d++)

if(OrderSelect(d,SELECT_BY_POS))      

писал и в функции, без измененеий
 

там бордак )

еще сложнее будет понять что к чему 

 
if(New_Bar)
{
OrderSend(Symbol(),OP_BUYSTOP,Lotpers,Ask+step,100,0,0,NULL,MagicNumber,0,DarkTurquoise);
OrderSend(Symbol(),OP_SELLSTOP,Lotpers,Bid-step,100,0,0,NULL,MagicNumber,0,Yellow);
}

 for(int b=0; b<OrdersTotal(); b++)
if(OrderSelect(b,SELECT_BY_POS)){
         
         lastlot = OrderLots();
              
         }
         for(int c=0; c<OrdersTotal(); c++)
         {
if(OrderSelect(c,SELECT_BY_POS)){
if (OrderType() == OP_BUYSTOP||OrderType() == OP_BUY)
         orderprisebuy= OrderOpenPrice();
     }
for(int d=0; d<OrdersTotal(); d++)
if(OrderSelect(d,SELECT_BY_POS))     
    if (OrderType() == OP_SELLSTOP||OrderType() == OP_SELL)
    
         orderprisecell= OrderOpenPrice(); 
         }
SL_VirtualCell = orderprisecell+step1*Point;
SL_VirtualBuy = orderprisebuy-step1*Point;

                          /*  if(Mas_Tip[0] >0|| Mas_Tip[1] >0)
                                               {
if (New_Bar&&/*valsar1<Ask &&  osma0>0&&osma1<0    /*&& Volume[1]>VolumeFiltr)

OrderSend(Symbol(),OP_BUY,NormalizeDouble( lastlot*Marti,2),Ask,100,0,0,NULL,MagicNumber,0,DarkTurquoise);

if (New_Bar&& /*valsar1>Bid && osma0<0&&osma1>0    /* && Volume[1]>VolumeFiltr)

OrderSend(Symbol(),OP_SELL,NormalizeDouble( lastlot*Marti,2),Bid,100,0,0,NULL,MagicNumber,0,Yellow);       
         
}*/
CheckEvents( MagicNumber );
/*if ( eventSellClosed_SL >0|| eventBuyClosed_SL >0)
{        as();
                

 }
  /* ///   if ( eventBuyClosed_TP > 0 )
   //     Alert( Symbol(), ": Buy-позиция закрыта по ТейкПрофиту!" );

   */
    if ( eventBuyStopOpened > 0 ){
    
          
 OrderSend(Symbol(),OP_SELLSTOP,NormalizeDouble( Lotpers,5),orderprisecell,0,0,0,NULL,MagicNumber,0,clrKhaki); 
 }
 if( eventBuyStopOpened > 0 ) 
 
  if (OrderType() == OP_SELL){
  OrderClose(OrderTicket(),OrderLots(), Ask, 3,clrIvory );  
 }
 ///

  if ( eventSellStopOpened > 0 )
  {
  OrderSend(Symbol(),OP_BUYSTOP,NormalizeDouble( Lotpers,5),orderprisebuy,0,0,0,NULL,MagicNumber,0,clrPlum);
 }
 if ( eventSellStopOpened > 0 )
 
if (OrderType() == OP_BUY){
  OrderClose(OrderTicket(),OrderLots(), Bid, 3,clrIvory );  
}
 
ужас...
 
evillive:
ужас...
))
 

варианты перебираю... более менее рабочее /* 

*/ 

 
вот повсюду где надо и не надо OrderSelect() натыкано, а там где действительно нужно его прописать, перед закрытием, там его нету.
Причина обращения: