private async void LoadOrderTypesAsync()
        {
            OrderTypes.Clear();
            OrderTypes.Add(new OrderType()
            {
                Id = Guid.Empty, Name = ""
            });
            var types = await _typeRepository.GetAllAsync();

            foreach (var type in types)
            {
                OrderTypes.Add(type);
            }
        }
        private async void OnAddOrderTypeExecute()
        {
            var wrappedOrderType = new OrderTypeWrapper(new OrderType());

            _orderTypeRepository.Add(wrappedOrderType.Model);
            wrappedOrderType.PropertyChanged += WrappedType_PropertyChanged;

            var newTypeName = await _messageDialogService.ShowInputMessageAsync(this, "Nowy typ naprawy...", "Podaj nazwÄ™ nowego typu: ");

            if (String.IsNullOrWhiteSpace(newTypeName))
            {
                return;
            }
            wrappedOrderType.Name = newTypeName;

            OrderTypes.Add(wrappedOrderType);
        }
        private async Task LoadTypes()
        {
            foreach (var type in OrderTypes)
            {
                type.PropertyChanged -= WrappedType_PropertyChanged;
            }

            OrderTypes.Clear();
            var types = await _orderTypeRepository.GetAllAsync();

            foreach (var type in types)
            {
                var wrappedType = new OrderTypeWrapper(type);
                wrappedType.PropertyChanged += WrappedType_PropertyChanged;
                OrderTypes.Add(wrappedType);
            }
        }
Example #4
0
        public BitfinexExchange(ExchangeManager exchangeManager)
            : base(exchangeManager)
        {
            Name        = "Bitfinex";
            ExchangeAPI = new ExchangeAPI
            {
                Name = Name
            };

            PublicFunctions.Add(APIFunction.RequestOrderBook);
            PublicFunctions.Add(APIFunction.RequestTicker);
            PublicFunctions.Add(APIFunction.RequestTrades);

            AvailableFunctions.Add(APIFunction.RequestTicker);
            AvailableFunctions.Add(APIFunction.RequestBalances);
            AvailableFunctions.Add(APIFunction.RequestTrades);
            AvailableFunctions.Add(APIFunction.RequestOrderBook);
            AvailableFunctions.Add(APIFunction.RequestOpenOrders);
            AvailableFunctions.Add(APIFunction.RequestNewOrder);
            AvailableFunctions.Add(APIFunction.CancelOrder);

            OrderSides.Add(OrderSide.Buy);
            OrderSides.Add(OrderSide.Sell);

            DefaultOrderType = new OrderType("exchange limit", "exchange limit");

            OrderTypes.Add(new OrderType("exchange market", "exchange market"));
            OrderTypes.Add(DefaultOrderType);
            OrderTypes.Add(new OrderType("exchange stop", "exchange stop"));
            OrderTypes.Add(new OrderType("exchange trailing-stop", "exchange trailing-stop"));
            OrderTypes.Add(new OrderType("exchange fill-or-kill", "exchange fill-or-kill"));

            OrderTypes.Add(new OrderType("market", "market"));
            OrderTypes.Add(new OrderType("limit", "limit"));
            OrderTypes.Add(new OrderType("stop", "stop"));
            OrderTypes.Add(new OrderType("trailing-stop", "trailing-stop"));
            OrderTypes.Add(new OrderType("fill-or-kill", "fill-or-kill"));

            PairManager.AddSupportedPair(PairBase.BTCUSD, "btcusd");
            PairManager.AddSupportedPair(PairBase.LTCUSD, "ltcusd");
            PairManager.AddSupportedPair(PairBase.LTCBTC, "ltcbtc");
            PairManager.AddSupportedPair(PairBase.DRKUSD, "drkusd");
            PairManager.AddSupportedPair(PairBase.DRKBTC, "drkbtc");
        }
Example #5
0
        public KrakenExchange(ExchangeManager exchangeManager)
            : base(exchangeManager)
        {
            Name        = "Kraken";
            ExchangeAPI = new ExchangeAPI
            {
                Name = Name
            };

            PublicFunctions.Add(APIFunction.RequestOrderBook);
            PublicFunctions.Add(APIFunction.RequestTicker);
            PublicFunctions.Add(APIFunction.RequestTrades);

            AvailableFunctions.Add(APIFunction.RequestTicker);
            AvailableFunctions.Add(APIFunction.RequestOrderBook);
            AvailableFunctions.Add(APIFunction.RequestBalances);
            AvailableFunctions.Add(APIFunction.RequestOpenOrders);
            AvailableFunctions.Add(APIFunction.RequestNewOrder);

            OrderSides.Add(OrderSide.Buy);
            OrderSides.Add(OrderSide.Sell);

            DefaultOrderType = new OrderType("limit", "limit");
            OrderTypes.Add(new OrderType("market", "market"));
            OrderTypes.Add(DefaultOrderType); // limit
            OrderTypes.Add(new OrderType("stop-loss", "stop Loss"));
            OrderTypes.Add(new OrderType("take-profit", "take profit"));
            OrderTypes.Add(new OrderType("stop-loss-profit", "stop-loss-profit"));
            OrderTypes.Add(new OrderType("stop-loss-profit-limit", "stop-loss-profit-limit"));
            OrderTypes.Add(new OrderType("stop-loss-limit", "stop-loss-limit"));
            OrderTypes.Add(new OrderType("trailing-stop", "trailing-stop"));
            OrderTypes.Add(new OrderType("trailing-stop-limit", "trailing-stop-limit"));
            OrderTypes.Add(new OrderType("stop-loss-and-limit", "stop-loss-and-limit"));

            PairManager.AddSupportedPair(PairBase.BTCEUR, "XBTEUR");
            PairManager.AddSupportedPair(PairBase.LTCEUR, "LTCEUR");
            PairManager.AddSupportedPair(PairBase.BTCUSD, "XBTUSD");
            PairManager.AddSupportedPair(PairBase.LTCUSD, "LTCUSD");
            PairManager.AddSupportedPair(PairBase.BTCLTC, "XBTLTC");
            PairManager.AddSupportedPair(PairBase.BTCXRP, "XBTXRP");
        }
Example #6
0
        public List <OrderTypeEntity> GetOrderTypes(string agentid, string clientid)
        {
            if (OrderTypes.ContainsKey(clientid))
            {
                return(OrderTypes[clientid].ToList());
            }

            List <OrderTypeEntity> list = new List <OrderTypeEntity>();
            DataSet ds = SystemDAL.BaseProvider.GetOrderTypes(clientid);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                OrderTypeEntity model = new OrderTypeEntity();
                model.FillData(dr);
                model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, agentid);
                list.Add(model);
            }

            OrderTypes.Add(clientid, list);

            return(list);
        }