Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 782 1...775776777778779780781782783784785786787788789...1177 New comment Leon 2014.11.18 21:22 #7811 abovefor(int d=0; d<OrdersTotal(); d++)if(OrderSelect(d,SELECT_BY_POS)) Vitalie Postolache 2014.11.18 21:24 #7812 The whole code is needed, it's unclear, a piece here, a piece there... Leon 2014.11.18 21:24 #7813 Leonid123456: abovefor(int d=0; d<OrdersTotal(); d++)if(OrderSelect(d,SELECT_BY_POS)) wrote in the function without any changes Leon 2014.11.18 21:25 #7814 it's a mess.)It will be even harder to figure out what's what Leon 2014.11.18 21:27 #7815 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 ); } Vitalie Postolache 2014.11.18 21:30 #7816 horror... Leon 2014.11.18 21:31 #7817 evillive: horror...)) Leon 2014.11.18 21:33 #7818 I'm going through the options... more or less working /**/ Vitalie Postolache 2014.11.18 21:36 #7819 There's OrderSelect() all over the place, but there's no OrderSelect() where it really needs to be, before closing. Leon 2014.11.18 21:37 #7820 evillive: There's OrderSelect() all over the place, but there's no OrderSelect() where it really needs to be written, before closing. It doesn't help to write it before closing 1...775776777778779780781782783784785786787788789...1177 New comment
above
for(int d=0; d<OrdersTotal(); d++)
if(OrderSelect(d,SELECT_BY_POS))
above
for(int d=0; d<OrdersTotal(); d++)
if(OrderSelect(d,SELECT_BY_POS))
it's a mess.)
It will be even harder to figure out what's what
horror...
I'm going through the options... more or less working /*
*/
There's OrderSelect() all over the place, but there's no OrderSelect() where it really needs to be written, before closing.