public override decimal GetTradeFee(CoinPair coinPair) { using (var client = new BinanceClient()) { return(client.GetTradeFee().Data.Single(s => s.Symbol == coinPair.ToString()).MakerFee); } }
public override decimal GetPrice(CoinPair coinPair) { decimal marketPrice = _prices[_currentIteration++].Open; Portfolio.UpdateCoinMarketPrice(coinPair.Pair1, marketPrice); return(marketPrice); }
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 override decimal GetTradeFee(CoinPair coinPair) { return(0.001m); }
public virtual decimal GetTradeFee(CoinPair coinPair) { throw new NotImplementedException(); }
public string ToStringPriceCheck() { return($"ID={ID} CoinPair={CoinPair.ToString()} BuyPriceAfterFees={BuyPriceAfterFees} MarketPrice={Price} Change={PriceChangePercentage}%"); }
public TradingData(CoinPair coinPair) { CoinPair = coinPair; }