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