private async void CryptoFiatPairsGroupLoadedAsync() { try { BuyPrice buyPriceResult = await business.GetBuyPriceAsync(CryptoFiatPairs.BTCEUR); BtcEur = buyPriceResult.Amount; logger.LogInformation(BtcEur); buyPriceResult = await business.GetBuyPriceAsync(CryptoFiatPairs.BTCUSD); BtcUsd = buyPriceResult.Amount; buyPriceResult = await business.GetBuyPriceAsync(CryptoFiatPairs.ETHEUR); EthEur = buyPriceResult.Amount; buyPriceResult = await business.GetBuyPriceAsync(CryptoFiatPairs.LTCEUR); LtcEur = buyPriceResult.Amount; } catch (Exception exception) { logger.LogError(exception.Message, null); } }
public override string ToString() { string buyP = BuyPrice >= 0 ? BuyPrice.ToString() : ""; string buyQ = BuyQty >= 0 ? BuyQty.ToString() : ""; string sellP = SellPrice >= 0 ? SellPrice.ToString() : ""; string sellQ = SellQty >= 0 ? SellQty.ToString() : ""; return(Name + ", " + Shop + ", " + buyP + ", " + buyQ + ", " + sellP + ", " + sellQ); }
public override int GetHashCode() { return(17 + 31 * Id.GetHashCode() + 31 * Code.GetHashCode() + 31 * Description.GetHashCode() + 31 * BuyPrice.GetHashCode() + 31 * SellPriceFactor.GetHashCode()); }
void ReleaseDesignerOutlets() { if (btnBuy != null) { btnBuy.Dispose(); btnBuy = null; } if (btnSell != null) { btnSell.Dispose(); btnSell = null; } if (BuyPrice != null) { BuyPrice.Dispose(); BuyPrice = null; } if (ChangeValueView != null) { ChangeValueView.Dispose(); ChangeValueView = null; } if (NameValue != null) { NameValue.Dispose(); NameValue = null; } if (ResultValue != null) { ResultValue.Dispose(); ResultValue = null; } if (SellPrice != null) { SellPrice.Dispose(); SellPrice = null; } if (UserValue != null) { UserValue.Dispose(); UserValue = null; } }
public override string ToString() { string s = ""; s += ID; s += ItemType; s += Quality; s += Description; s += Capacity.ToString(); s += BuyPrice.ToString(); s += SellPrice.ToString(); s += HP.ToString(); s += MP.ToString(); return(s); }
public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) { return(false); } var sku = (SKU)obj; return(Id.Equals(sku.Id) && Code.Equals(sku.Code) && Description.Equals(sku.Description) && BuyPrice.Equals(sku.BuyPrice) && SellPriceFactor.Equals(sku.SellPriceFactor) && Timestamp.Equals(sku.Timestamp)); }
private static void BusinessQueriesToBeRequestByUI(IBusiness business) { var getCurrenciesTask = business.GetCurrenciesAsync(new string[] { Currencies.USD, Currencies.EUR }); getCurrenciesTask.Wait(); var currencies = getCurrenciesTask.Result; Console.WriteLine(currencies.FirstOrDefault()); var getCurrencyExchangeTask = business.GetExchangeRatesAsync(Currencies.EUR); var exchangeRateData = getCurrencyExchangeTask.Result; Console.WriteLine($"1 {Currencies.EUR} = {exchangeRateData.Rates[Currencies.USD]} {Currencies.USD}"); BuyPrice btcUsdBuyPrice = business.GetBuyPriceAsync(CryptoFiatPairs.BTCUSD).Result; Console.WriteLine($"1 {btcUsdBuyPrice.Base} = { btcUsdBuyPrice.Amount} {btcUsdBuyPrice.Currency}"); }
public override void Write(BgoProtocolWriter w) { base.Write(w); w.Write((byte)Category); w.Write((byte)ItemType); w.Write(Tier); w.Write((byte)Faction); w.Write((ushort)SortingNames.Length); foreach (string str in SortingNames) { w.Write(str); } w.Write((ushort)SortingWeight); BuyPrice.Write(w); UpgradePrice.Write(w); SellPrice.Write(w); w.Write(CanBeSold); }
public string ToJson() { return("{\"Time\":" + new JavaScriptSerializer().Serialize(Time) + ",\"Id\":\"" + Id.ToString() + "\",\"Security\":\"" + Security.ToString() + "\",\"BuyId\":\"" + BuyId.ToString() + "\",\"SellId\":\"" + SellId.ToString() + "\",\"Quantity\":" + Quantity.ToString() + ",\"BuyPrice\":" + BuyPrice.ToString() + ",\"SellPrice\":" + SellPrice.ToString() + "}"); }
public virtual void ForceSell() { try { if (!IsBuyed) { return; } string type = "청산"; string position = Position == "1" ? "2" : "1"; ExApi.XingApi.Order(type, ItemCode, position, Quantity.ToString(), CPrice.ToString(), BuyPrice.ToString()); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); } finally { } }
public virtual void SellBuy(string type, string position) { try { if (type == "진입") { ExApi.XingApi.Order(type, ItemCode, position, Quantity.ToString(), CPrice.ToString()); } else if (type == "청산") { ExApi.XingApi.Order(type, ItemCode, position, Quantity.ToString(), CPrice.ToString(), BuyPrice.ToString()); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); } finally { InitHighLowPrice(); } }
public string BuyPriceUrlString() { return(BuyPrice == -1 ? "" : BuyPrice.ToString()); }