Beispiel #1
0
        private OrderResponse MakeOrder(AbstractCoinOrder order)
        {
            OrderSide type;

            if (order is BuyCoinOrder)
            {
                type = OrderSide.Buy;
            }
            else
            {
                type = OrderSide.Sell;
            }
            OrderResponse response = client.PlaceLimitOrderSync(type, productType, order.Size, order.Price);

            return(response);
        }
Beispiel #2
0
        //TODO: class invest to separate orders with diffrerent profit/risk
        private bool boAllowBuyOrder(AbstractCoinOrder order)
        {
            bool    res     = false;
            var     dayInfo = client.GetProductStatsSync(productType);
            decimal max     = dayInfo.Low + ((dayInfo.High - dayInfo.Low) * ImportantValues.buyLimitPercentageFromDayMax / 100);

            decimal predictedSellPrice = order.Price * (1 + ImportantValues.sellProfitPercentageFromBuyPrice / 100);

            if (max > predictedSellPrice)
            {
                res = true;
            }
            else
            {
                res = false;
            }
            return(res);
        }