Exemplo n.º 1
0
 public static MeNewLimitOrderModel ToNewMeModel(this StopLimitOrderModel model)
 {
     return(MeNewLimitOrderModel.CreateMeStopLimitOrder(
                model.Id,
                model.ClientId,
                model.AssetPairId,
                model.OrderAction,
                model.Volume,
                model.CancelPreviousOrders,
                model.Fee?.ToMeModel(),
                model.Fees?.Select(item => item.ToMeModel()).ToArray(),
                model.LowerLimitPrice,
                model.LowerPrice,
                model.UpperLimitPrice,
                model.UpperPrice));
 }
Exemplo n.º 2
0
        public void CreateStopLimitOrderModel_Buy()
        {
            var id                = Guid.NewGuid().ToString();
            var clientId          = Guid.NewGuid().ToString();
            var assetPairId       = "LKKEUR";
            var orderAction       = OrderAction.Buy;
            var volume            = 234.01;
            var lowerPrice        = 5432.5;
            var lowerLimitPrice   = 6432.5;
            var upperPrice        = 5432.7;
            var upperLimitPrice   = 5438.5;
            var cancelAllPrevious = true;
            var fee               = CreateFee();
            var fees              = new[]
            {
                CreateFee(),
                CreateFee()
            };

            var model = MeNewLimitOrderModel.CreateMeStopLimitOrder(
                id,
                clientId,
                assetPairId,
                orderAction,
                volume,
                cancelAllPrevious,
                fee,
                fees,
                lowerLimitPrice,
                lowerPrice,
                upperLimitPrice,
                upperPrice
                );

            Assert.Equal(id, model.Id);
            Assert.Equal(clientId, model.ClientId);
            Assert.Equal(assetPairId, model.AssetPairId);
            Assert.Equal(volume, model.Volume);
            Assert.Equal(cancelAllPrevious, model.CancelAllPreviousLimitOrders);
            Assert.Equal(fee, model.Fee);
            Assert.Equal(fees, model.Fees);
            Assert.Equal(1, model.Type);
            Assert.Equal(lowerLimitPrice, model.LowerLimitPrice);
            Assert.Equal(lowerPrice, model.LowerPrice);
            Assert.Equal(upperLimitPrice, model.UpperLimitPrice);
            Assert.Equal(upperPrice, model.UpperPrice);
        }