public void RaisePriceChanged(Price price) { PriceCurrent.AddOrUpdate(price.Pair, price, (k, v) => price); if(PriceChanged != null) { var args = new PriceChangedEventArgs(price, GetAccount(), GetTrades()); PriceChanged(this, args); } }
public string[] toStringArray(FinanceStrategies strategy = FinanceStrategies.Google) { List <string> result = new List <string>(); result.Add(name); result.Add(symbol); result.Add(FinanceUnifier.getExchangeFullTitle(exch)); result.Add((type != null) ? type : typeDisp); result.Add(Quantity.ToString()); result.Add(((double)PricePurchase).ToString("0.00") + " " + Currency.Symbol); result.Add(PriceCurrent.ToString("0.00") + " " + Currency.Symbol); result.Add(ChangePercentage); result.Add(CurrentValue.ToString("0.00") + " " + Currency.Symbol); result.Add(CurrentValueChange.ToString("+0.00%;-0.00%")); result.Add((CurrentValue - ((double)Quantity * (double)PricePurchase)).ToString("+0.00;-0.00") + " " + Currency.Symbol); if (strategy == FinanceStrategies.Yahoo) { result.Add(BookValue.ToString() + " " + Currency.Symbol); result.Add(MarketCapitalization); result.Add(FiftydayMovingAverage.ToString()); result.Add(TwoHundreddayMovingAverage.ToString()); } return(result.ToArray()); }