،،،اختيار اخر صفقه تم فتحها يتم عن طريق وقت افتتاح الصفقة،،،
كود:
if(OrdersTotal()!=0) { OrderSelect(0, SELECT_BY_POS); TicketDate=OrderOpenTime(); StartTime=TicketDate; TicketNumber=OrderTicket(); TicketType=OrderType(); //OP_BUY OP_SELL if (TicketType == OP_BUY) {TicketTypeStr = "Buy";} else if (TicketType == OP_SELL) {TicketTypeStr = "Sell";} Comment ("Found Existing Open Order ",TicketTypeStr,"#",TicketNumber," ", TimeToStr(TicketDate,TIME_DATE)," , ",TimeToStr(TicketDate,TIME_MINUTES)); //your additional code here } else { Comment ("No Open Orders"); }
،،،تحياتى،،،