public IEXClientFixture() { Client = new IEXClient(CredsHelper.GetIEXToken(), logger: null, useCache: false); var t = Client.GetOptions("AMD"); t.Wait(); Options = t.Result; var dt = Client.GetOptionDetails("AMD", "20210806"); dt.Wait(); OptionDetails = dt.Result; var price = Client.GetPrice("AMD"); price.Wait(); Price = price.Result.Success; var search = Client.Search("stitch", 5); search.Wait(); SearchResults = search.Result.Success; var advancedStats = Client.GetAdvancedStats("GOOGL"); advancedStats.Wait(); AdvancedStats = advancedStats.Result.Success; }
public IEXClientTests(IEXClientFixture fixture, Xunit.Abstractions.ITestOutputHelper output) { _options = fixture.Options; _optionDetails = fixture.OptionDetails.ToArray(); _price = fixture.Price; _client = fixture.Client; _output = output; _mostActive = fixture.MostActive; _search = fixture.SearchResults; _advanced = fixture.AdvancedStats; }
internal void Enrich(TickerPrice p, StockAdvancedStats d) { Apply( new NoteEnrichedWithPrice( Guid.NewGuid(), this.Id, DateTimeOffset.UtcNow, p, d ) ); }
public static object MapStockDetail( string ticker, double price, CompanyProfile profile, StockAdvancedStats stats, HistoricalResponse data, MetricsResponse metrics) { var byMonth = data?.Historical?.GroupBy(r => r.Date.ToString("yyyy-MM-01")) .Select(g => new { Date = DateTime.Parse(g.Key), Price = g.Average(p => p.Close), Volume = Math.Round(g.Average(p => p.Volume) / 1000000.0, 2), Low = g.Min(p => p.Close), High = g.Max(p => p.Close) }); var labels = byMonth?.Select(a => a.Date.ToString("MMMM")); var lowValues = byMonth?.Select(a => Math.Round(a.Low, 2)); var highValues = byMonth?.Select(a => Math.Round(a.High, 2)); var priceValues = byMonth?.Select(a => Math.Round(a.Price, 2)); var priceChartData = labels?.Zip(priceValues, (l, p) => new object[] { l, p }); var volumeValues = byMonth?.Select(a => a.Volume); var volumeChartData = labels?.Zip(volumeValues, (l, p) => new object[] { l, p }); var metricDates = metrics?.Metrics?.Select(m => m.Date.ToString("MM/yy")).Reverse(); var bookValues = metrics?.Metrics?.Select(m => m.BookValuePerShare).Reverse(); var bookChartData = metricDates?.Zip(bookValues, (l, p) => new object[] { l, p }); var peValues = metrics?.Metrics?.Select(m => m.PERatio).Reverse(); var peChartData = metricDates?.Zip(peValues, (l, p) => new object[] { l, p }); return(new { ticker, price, stats, profile, labels, priceChartData, volumeChartData, bookChartData, peChartData }); }
public RegisterPreview(CompanyProfile c, StockAdvancedStats a, Quote q) { CompanyName = c.CompanyName; IssueType = c.IssueType; Description = c.Description; Website = c.Website; Avg30Volume = a.Avg30Volume.HasValue ? a.Avg30Volume.Value : 0; Open = q.Open; Close = q.Close; High = q.High; Low = q.Low; Change = q.Change; Volume = q.Volume; Range = q.Range; }
public EmailReviewEntryGroup(IEnumerable <EmailReviewEntry> entries, Price price, StockAdvancedStats stats) { Alerts = new List <EmailReviewEntry>(); Ownership = new List <EmailReviewEntry>(); Price = price; Ticker = null; Stats = stats; foreach (var e in entries.OrderByDescending(e => e.Created)) { Ticker = e.Ticker; if (e.IsAlert) { Alerts.Add(e); } else { Ownership.Add(e); } } }
public NoteEnrichedWithPrice(Guid id, Guid aggregateId, DateTimeOffset when, Price price, StockAdvancedStats stats) : base(id, aggregateId, when) { Price = price; Stats = stats; }
public NoteEnriched(Guid id, Guid aggregateId, DateTimeOffset when, StockAdvancedStats stats) : base(id, aggregateId, when) { Stats = stats; }
public GridEntry(string ticker, TickerPrice price, StockAdvancedStats stats) { this.Price = price.Amount; this.Ticker = ticker; this.Stats = stats; }
public GridEntry(string ticker, Price price, StockAdvancedStats stats) { Price = price.Amount; Ticker = ticker; Stats = stats; }
public ReviewEntryGroup(IEnumerable <ReviewEntry> entries, TickerPrice price, StockAdvancedStats stats) { this.Notes = new List <ReviewEntry>(); this.Ownership = new List <ReviewEntry>(); this.Price = price; this.Ticker = null; this.Stats = stats; foreach (var e in entries.OrderByDescending(e => e.Created)) { this.Ticker = e.Ticker; if (e.IsNote) { this.Notes.Add(e); } else { this.Ownership.Add(e); } } }