MQL5 ReferenceStandard LibraryTrade ClassesCOrderInfoMagic TicketTimeSetupTimeSetupMscOrderTypeTypeDescriptionStateStateDescriptionTimeExpirationTimeDoneTimeDoneMscTypeFillingTypeFillingDescriptionTypeTimeTypeTimeDescriptionMagicPositionIdVolumeInitialVolumeCurrentPriceOpenStopLossTakeProfitPriceCurrentPriceStopLimitSymbolCommentInfoIntegerInfoDoubleInfoStringStoreStateCheckStateSelectSelectByIndex Magic Gets the ID of an Expert Advisor that placed the order. long Magic() const Return Value ID of an Expert Advisor that placed the order. Note The order should be selected using the Select (by ticket) or SelectByIndex (by index) methods. TypeTimeDescription PositionId