double Openprice; OrderSelect(OrderHistoryTotal() - 1, SELECT_BY_POS, MODE_HISTORY); Openprice = OrderOpenPrice();