MQL5 ReferenceStandard LibraryTrade ClassesCHistoryOrderInfoMagic TimeSetupTimeSetupMscOrderTypeTypeDescriptionStateStateDescriptionTimeExpirationTimeDoneTimeDoneMscTypeFillingTypeFillingDescriptionTypeTimeTypeTimeDescriptionMagicPositionIdVolumeInitialVolumeCurrentPriceOpenStopLossTakeProfitPriceCurrentPriceStopLimitSymbolCommentInfoIntegerInfoDoubleInfoStringTicketSelectByIndex Magic Gets the ID of the Expert Advisor, that placed the order. long Magic() const Return Value ID of the Expert Advisor, that placed the order. Note The historical order should be selected using the Ticket (by ticket) or SelectByIndex (by index) methods. TypeTimeDescription PositionId