MQL5 ReferenceStandard LibraryTrade ClassesCHistoryOrderInfoPositionId TimeSetupTimeSetupMscOrderTypeTypeDescriptionStateStateDescriptionTimeExpirationTimeDoneTimeDoneMscTypeFillingTypeFillingDescriptionTypeTimeTypeTimeDescriptionMagicPositionIdVolumeInitialVolumeCurrentPriceOpenStopLossTakeProfitPriceCurrentPriceStopLimitSymbolCommentInfoIntegerInfoDoubleInfoStringTicketSelectByIndex PositionId Gets the ID of position. long PositionId() const Return Value ID of position, in which the order was involved. Note The historical order should be selected using the Ticket (by ticket) or SelectByIndex (by index) methods. Magic VolumeInitial