int total=OrdersTotal();
int Kol=0,X_order,tip;
double Y_order;
ArrayInitialize(orders,0);
if (ObjectFind("")==0)
{
}
else {X_order =20;Y_order=110+10*Kol;}
for (int pos=1; pos<=25; pos++)
{ N_order="ОРДЕР "+pos; // РАБОТАЕТ
ObjectDelete(N_order);
N_orderCL="ZAKRUTIE"+pos; // ЭТО НЕ РАБОТАЕТ...
ObjectDelete(N_orderCL);
N_orderCLPull="PULLZAKRUT"+pos; // ЭТО НЕ РАБОТАЕТ...
ObjectDelete(N_orderCLPull);
}
for( pos=0;pos<total;pos++)
{ if (OrderSelect(pos, SELECT_BY_POS)==true)
{ if (OrderSymbol()==Symbol())
{ tip=OrderType();
if (tip == OP_BUY || tip == OP_SELL|| tip == OP_BUYLIMIT|| tip == OP_SELLLIMIT|| tip == OP_BUYSTOP|| tip == OP_SELLSTOP)
{ Kol++; // Считаем общее количество ордеров
orders[Kol][1] = OrderOpenPrice(); // Курс открытия ордеров
orders[Kol][2] = ((OrderOpenPrice() - OrderStopLoss())!=0) ; // SL
orders[Kol][4] = OrderTicket();
orders[Kol][5] = OrderLots();
if (tip == OP_BUY) {orders[Kol][6] = 1; текст = "Buy"; }
else {orders[Kol][6] =-1; текст = "Sell";}
if (tip == OP_BUYLIMIT) {orders[Kol][6] = 1; текст = "BLimit"; }
if (tip == OP_SELLLIMIT) {orders[Kol][6] = 1; текст = "SLimit"; }
if (tip == OP_BUYSTOP) {orders[Kol][6] = 1; текст = "BStop"; }
if (tip == OP_SELLSTOP) {orders[Kol][6] = 1; текст = "SStop"; }
//--------------------- Вывод текущих ордеров на экран
if (UGOL<4){N_order="ОРДЕР "+Kol;
if (orders[Kol][6]==1)
ObjectDelete(N_order);
ObjectCreate(N_order, OBJ_LABEL, 0, 0, 0);
ObjectSet (N_order, OBJPROP_CORNER, UGOL);
ObjectSet (N_order, OBJPROP_XDISTANCE, X_order);
ObjectSet (N_order, OBJPROP_YDISTANCE, Y_order+21*Kol);
if (orders[Kol][2]!=0) txt = DoubleToStr((MarketInfo(OrderSymbol(),MODE_BID)
- OrderOpenPrice()) / (OrderOpenPrice() - OrderStopLoss()),2);
ObjectSetText(N_order,StringConcatenate("" ," ", текст," ","[",DoubleToStr (orders[Kol][5],2),"]",
" ", txt ),12,"Arial Black",Black);
N_orderCL="ZAKRUTIE"+Kol;
ObjectDelete("ZAKRUTIE"+Kol);
SetATL(N_orderCL+"ZAKRUTIE",23," X ",11,"Arial Black",Black,X_order-25,Y_order+21*Kol+1,0,0);
if(ObjectGet(N_orderCL+"ZAKRUTIE",OBJPROP_SELECTED)>0)
ObjectSet(N_orderCL+"ZAKRUTIE",OBJPROP_SELECTED,0);
N_orderCLPull="PULLZAKRUT"+Kol;
ObjectDelete("PULLZAKRUT"+Kol);
SetATL(N_orderCLPull+"PULLZAKRUT",23," X ",11,"Arial Black",Black,X_order+350,Y_order+21*Kol+1,0,0);
if(ObjectGet(N_orderCLPull+"PULLZAKRUT",OBJPROP_SELECTED)>0)
ObjectSet(N_orderCLPull+"PULLZAKRUT",OBJPROP_SELECTED,0);
}
}
}
}
}
void SetATL(string nm,int type,string tx,int fontsize,string font,color clr,int x,int y,int corn,int back, bool select_change=true){
if(ObjectFind(nm)!=0)
ObjectCreate(nm,type,0,0,0);
ObjectSet(nm,OBJPROP_CORNER,corn);
ObjectSet(nm,OBJPROP_COLOR,clr);
ObjectSet(nm,OBJPROP_BGCOLOR,clr);
ObjectSet(nm,OBJPROP_BACK,back);
ObjectSet(nm,OBJPROP_XDISTANCE,x);
ObjectSet(nm,OBJPROP_YDISTANCE,y);
ObjectSet(nm,OBJPROP_BORDER_COLOR,clr);
ObjectSet(nm,OBJPROP_BORDER_TYPE,BORDER_FLAT);
ObjectSet(nm,OBJPROP_HIDDEN,1);
ObjectSetText(nm,tx,fontsize,font,clr);
if(select_change) {
if(ObjectGet(name+"1",OBJPROP_SELECTED)>0)
ObjectSet(name+"1",OBJPROP_SELECTED,0);
}
}