public override decimal GetTradeFee(CoinPair coinPair) { using (var client = new BinanceClient()) { return(client.GetTradeFee().Data.Single(s => s.Symbol == coinPair.ToString()).MakerFee); } }
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); }
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); } } }
public string ToStringPriceCheck() { return($"ID={ID} CoinPair={CoinPair.ToString()} BuyPriceAfterFees={BuyPriceAfterFees} MarketPrice={Price} Change={PriceChangePercentage}%"); }