Example #1
0
 public override decimal GetTradeFee(CoinPair coinPair)
 {
     using (var client = new BinanceClient())
     {
         return(client.GetTradeFee().Data.Single(s => s.Symbol == coinPair.ToString()).MakerFee);
     }
 }
Example #2
0
        public override decimal GetPrice(CoinPair coinPair)
        {
            decimal marketPrice = _prices[_currentIteration++].Open;

            Portfolio.UpdateCoinMarketPrice(coinPair.Pair1, marketPrice);
            return(marketPrice);
        }
Example #3
0
        public ListViewItem ToListViewItem()
        {
            ListViewItem lvi = new ListViewItem();

            lvi.Text = ID.ToString();

            if (CoinQuantity == 0)
            {
                lvi.SubItems.Add(CoinOriginalQuantity.ToString());
            }
            else
            {
                lvi.SubItems.Add(CoinQuantity.ToString());
            }

            lvi.SubItems.Add(CoinPair.ToString());
            lvi.SubItems.Add(LastAction.ToString());

            if (LastAction == OrderSide.Buy)
            {
                lvi.SubItems.Add(BuyPriceAfterFees.ToString());
            }
            else
            {
                lvi.SubItems.Add(SellPriceAfterFees.ToString());
            }

            lvi.SubItems.Add(Cost.ToString());
            lvi.SubItems.Add(Price.ToString());
            lvi.SubItems.Add(PriceChangePercentage.ToString());
            lvi.ForeColor = PriceChangePercentage > 0m ? Color.Green : Color.Red;
            return(lvi);
        }
Example #4
0
 public override decimal GetPrice(CoinPair coinPair)
 {
     using (var client = new BinanceClient())
     {
         try
         {
             decimal marketPrice = Math.Round(client.GetPrice(coinPair.ToString()).Data.Price, 2);
             Portfolio.UpdateCoinMarketPrice(coinPair.Pair1, marketPrice);
             return(marketPrice);
         }
         catch (Exception)
         {
             return(0);
         }
     }
 }
Example #5
0
 public override decimal GetTradeFee(CoinPair coinPair)
 {
     return(0.001m);
 }
Example #6
0
 public virtual decimal GetTradeFee(CoinPair coinPair)
 {
     throw new NotImplementedException();
 }
Example #7
0
 public string ToStringPriceCheck()
 {
     return($"ID={ID} CoinPair={CoinPair.ToString()} BuyPriceAfterFees={BuyPriceAfterFees} MarketPrice={Price} Change={PriceChangePercentage}%");
 }
Example #8
0
 public TradingData(CoinPair coinPair)
 {
     CoinPair = coinPair;
 }