コード例 #1
0
        public static PendingOrder DecoratePendingOrder(PENDING_ORDER ord)
        {
            var po = new PendingOrder
            {
                ID            = ord.ID,
                AccountID     = ord.AccountID,
                PriceSide     = (PendingOrderType)ord.PriceSide,
                PriceFrom     = (float)ord.PriceFrom,
                PriceTo       = (float?)ord.PriceTo,
                TimeFrom      = ord.TimeFrom,
                TimeTo        = ord.TimeTo,
                Symbol        = ord.Symbol,
                Volume        = ord.Volume,
                Side          = ord.Side,
                Magic         = ord.Magic,
                Comment       = ord.Comment,
                ExpertComment = ord.ExpertComment,
                StopLoss      = (float?)(ord.Stoploss == 0 ? null : ord.Stoploss),
                TakeProfit    = (float?)(ord.Takeprofit == 0 ? null : ord.Takeprofit),
                Status        = PendingOrderStatus.Создан,
                PairOCO       = ord.PairOCO,
                TrailLevel1   = (float?)ord.TrailLevel1,
                TrailLevel2   = (float?)ord.TrailLevel2,
                TrailLevel3   = (float?)ord.TrailLevel3,
                TrailLevel4   = (float?)ord.TrailLevel4,
                TrailTarget1  = (float?)ord.TrailTarget1,
                TrailTarget2  = (float?)ord.TrailTarget2,
                TrailTarget3  = (float?)ord.TrailTarget3,
                TrailTarget4  = (float?)ord.TrailTarget4
            };

            return(po);
        }
コード例 #2
0
        public static PENDING_ORDER UndecorateLiveActiveOrder(PendingOrder ord)
        {
            var po = new PENDING_ORDER
            {
                ID            = ord.ID,
                AccountID     = ord.AccountID,
                PriceSide     = (int)ord.PriceSide,
                PriceFrom     = (decimal)ord.PriceFrom,
                PriceTo       = (decimal?)ord.PriceTo,
                TimeFrom      = ord.TimeFrom,
                TimeTo        = ord.TimeTo,
                Symbol        = ord.Symbol,
                Volume        = ord.Volume,
                Side          = ord.Side,
                Magic         = ord.Magic,
                Comment       = ord.Comment,
                ExpertComment = ord.ExpertComment,
                Stoploss      = (decimal?)(ord.StopLoss == 0 ? null : ord.StopLoss),
                Takeprofit    = (decimal?)(ord.TakeProfit == 0 ? null : ord.TakeProfit),
                PairOCO       = ord.PairOCO,
                TrailLevel1   = (decimal?)ord.TrailLevel1,
                TrailLevel2   = (decimal?)ord.TrailLevel2,
                TrailLevel3   = (decimal?)ord.TrailLevel3,
                TrailLevel4   = (decimal?)ord.TrailLevel4,
                TrailTarget1  = (decimal?)ord.TrailTarget1,
                TrailTarget2  = (decimal?)ord.TrailTarget2,
                TrailTarget3  = (decimal?)ord.TrailTarget3,
                TrailTarget4  = (decimal?)ord.TrailTarget4
            };

            return(po);
        }
コード例 #3
0
 public static PENDING_ORDER UndecorateLiveActiveOrder(PendingOrder ord)
 {
     var po = new PENDING_ORDER
     {
         ID = ord.ID,
         AccountID = ord.AccountID,
         PriceSide = (int)ord.PriceSide,
         PriceFrom = (decimal)ord.PriceFrom,
         PriceTo = (decimal?)ord.PriceTo,
         TimeFrom = ord.TimeFrom,
         TimeTo = ord.TimeTo,
         Symbol = ord.Symbol,
         Volume = ord.Volume,
         Side = ord.Side,
         Magic = ord.Magic,
         Comment = ord.Comment,
         ExpertComment = ord.ExpertComment,
         Stoploss = (decimal?)(ord.StopLoss == 0 ? null : ord.StopLoss),
         Takeprofit = (decimal?)(ord.TakeProfit == 0 ? null : ord.TakeProfit),
         PairOCO = ord.PairOCO,
         TrailLevel1 = (decimal?)ord.TrailLevel1,
         TrailLevel2 = (decimal?)ord.TrailLevel2,
         TrailLevel3 = (decimal?)ord.TrailLevel3,
         TrailLevel4 = (decimal?)ord.TrailLevel4,
         TrailTarget1 = (decimal?)ord.TrailTarget1,
         TrailTarget2 = (decimal?)ord.TrailTarget2,
         TrailTarget3 = (decimal?)ord.TrailTarget3,
         TrailTarget4 = (decimal?)ord.TrailTarget4
     };
     return po;
 }
コード例 #4
0
 public static PendingOrder DecoratePendingOrder(PENDING_ORDER ord)
 {
     var po = new PendingOrder
     {
         ID = ord.ID,
         AccountID = ord.AccountID,
         PriceSide = (PendingOrderType)ord.PriceSide,
         PriceFrom = (float)ord.PriceFrom,
         PriceTo = (float?)ord.PriceTo,
         TimeFrom = ord.TimeFrom,
         TimeTo = ord.TimeTo,
         Symbol = ord.Symbol,
         Volume = ord.Volume,
         Side = ord.Side,
         Magic = ord.Magic,
         Comment = ord.Comment,
         ExpertComment = ord.ExpertComment,
         StopLoss = (float?)(ord.Stoploss == 0 ? null : ord.Stoploss),
         TakeProfit = (float?)(ord.Takeprofit == 0 ? null : ord.Takeprofit),
         Status = PendingOrderStatus.Создан,
         PairOCO = ord.PairOCO,
         TrailLevel1 = (float?)ord.TrailLevel1,
         TrailLevel2 = (float?)ord.TrailLevel2,
         TrailLevel3 = (float?)ord.TrailLevel3,
         TrailLevel4 = (float?)ord.TrailLevel4,
         TrailTarget1 = (float?)ord.TrailTarget1,
         TrailTarget2 = (float?)ord.TrailTarget2,
         TrailTarget3 = (float?)ord.TrailTarget3,
         TrailTarget4 = (float?)ord.TrailTarget4
     };
     return po;
 }