Exemple #1
0
        internal static void Sell(string pair)
        {
            if (pair.StartsWith("t"))
            {
                pair = pair.Substring(1).ToLower();
            }

            float  qty = Exchange.Portfolio[pair.Substring(0, 3).ToUpper()];
            Random r   = new Random();

            BitfinexNewOrderResponse resp = SendSimpleLimitSell(pair, qty.ToString().Replace(",", "."), r.NextDouble().ToString().Replace(",", "."));

            Console.WriteLine("Sold " + resp.OriginalAmount + " " + resp.Symbol + " for " + resp.Price);
            RetrieveBalances();
        }
Exemple #2
0
        private static readonly string DefaultOrderType = "exchange market";         //Either “market” / “limit” / “stop” / “trailing-stop” / “fill-or-kill” / “exchange market” / “exchange limit” / “exchange stop” / “exchange trailing-stop” / “exchange fill-or-kill”. (type starting by “exchange ” are exchange orders, others are margin trading orders)

        internal static void Buy(string pair, float closePrice, float qty)
        {
            if (pair.StartsWith("t"))
            {
                pair = pair.Substring(1).ToLower();
            }

            float  amount = BBBullMarket.BuyQty / closePrice;
            Random r      = new Random();

            BitfinexNewOrderResponse resp = SendSimpleLimitBuy(pair, amount.ToString().Replace(",", "."), r.NextDouble().ToString().Replace(",", "."));

            Console.WriteLine("Bought " + resp.OriginalAmount + " " + resp.Symbol + " for " + resp.Price);
            RetrieveBalances();
        }
Exemple #3
0
 private void OnOrderFeedMsg(BitfinexNewOrderResponse orderResponse)
 {
 }
Exemple #4
0
 private void ApiOnOrderFeedMsg(BitfinexNewOrderResponse orderResponse)
 {
     lbLogger.Items.Add(orderResponse.ToString());
 }
 protected virtual void OnOrderFeedMsg(BitfinexNewOrderResponse orderResponse)
 {
 }
 public OrderFeedMsgEventArgs(BitfinexNewOrderResponse orderResponse)
 {
     OrderResponse = orderResponse;
 }
 protected virtual void OnOrderFeedMsg(BitfinexNewOrderResponse orderResponse)
 {
     OrderFeedMsg?.Invoke(this, new OrderFeedMsgEventArgs(orderResponse));
 }