public static async Task Main(string[] args) { var services = new ServiceCollection(); services.AddIEXClientWithAppSettingsConfig(); var serviceProvider = services.BuildServiceProvider(); IIEXCloudClient client = serviceProvider.GetRequiredService <IIEXCloudClient>(); await TestQuote(client); //await TestCompany(client); //await TestApiStatus(client); //await TestAccountMetadata(client); // not allowed?! //await TestSystemEvents(client); //await TestListQuotes(client); //await TestHistoricalPrices(client); //await TestBalanceSheets(client); //PaymentRequired //await TestDividends(client); //await TestDelayedQuote(client); //PaymentRequired //await TestOHLC(client); //PaymentRequired //await TestEarnings(client); // expensive 1000 //await TestMarketVolumeUS(client); //PaymentRequired //await TestLogo(client); //await TestPriceTarget(client); //PaymentRequired //await TestNews(client); //await TestSectorPerformance(client); //PaymentRequired //await TestSymbols(client); //TestSSE(client); }
private static async Task TestApiStatus(IIEXCloudClient client) { var status = await client.GetApiStatus(); Console.WriteLine("api up: " + status.StatusUp); Console.WriteLine("api time: " + status.Time); }
private void SetupSUT() { var env = IEXCloudClientOptions.IEXCloudClientOptionsEnvironment.Sandbox; var version = IEXCloudClientOptions.IEXCloudClientOptionsVersion.V1; var options = new IEXCloudClientOptions(env, version, "pk", "st"); client = new IEXCloudClient(options, httpClientFactoryMock.Object); }
private static async Task TestQuote(IIEXCloudClient client) { var aapleQuote = await client.GetQuote(Symbol); Console.WriteLine("aapl high: " + aapleQuote.High); Console.WriteLine("aapl low: " + aapleQuote.Low); Console.WriteLine("aapl close: " + aapleQuote.Close); }
private static void TestSSE(IIEXCloudClient client) { var eventSource = client.CreateTradeEventSource("aapl", "SNAP", "fb"); eventSource.Events += LogTradeEvent; Thread.Sleep(100000); eventSource.Events -= LogTradeEvent; }
private static async Task TestCompany(IIEXCloudClient client) { var companyAapl = await client.GetCompany(Symbol); //Console.WriteLine($"{Symbol} last dividend: "+companyAapl.Dividends.OrderBy(x=>x.PaymentDate).Last().Amount); Console.WriteLine($"{Symbol} website: " + companyAapl.Website); //Console.WriteLine($"{Symbol} CurrentLongTermDebt: "+companyAapl.BalanceSheets.OrderBy(x=>x.ReportDate).Last().CurrentLongTermDebt); }
public void Setup() { var services = new ServiceCollection(); services.AddIEXClientWithAppSettingsConfig(); var serviceProvider = services.BuildServiceProvider(); client = serviceProvider.GetRequiredService <IIEXCloudClient>(); }
private async static Task TestEarnings(IIEXCloudClient client) { var earnings = await client.GetEarnings(Symbol, 2); Console.WriteLine(earnings.First()); var earnings2 = await client.GetEarningsProperty(Symbol, EarningsProperties.ActualEPS); Console.WriteLine(earnings2); }
private async static Task TestSymbols(IIEXCloudClient client) { var symbols = await client.GetSymbols(); foreach (var symbol in symbols.Take(10)) { Console.WriteLine(); Console.WriteLine(symbol); } }
private static async Task TestHistoricalPrices(IIEXCloudClient client) { var prices = await client.GetHistoricalPrices(Symbol, HistoricalPricesRange.OneMonth); foreach (var price in prices) { Console.WriteLine(); Console.WriteLine(price); } }
private static async Task TestSectorPerformance(IIEXCloudClient client) { var sectorPerformances = await client.GetSectorPerformances(); foreach (var sectorPerformance in sectorPerformances) { Console.WriteLine(); Console.WriteLine(sectorPerformance); } }
private static async Task TestNews(IIEXCloudClient client) { var news = await client.GetNews(Symbol, 10); foreach (var article in news) { Console.WriteLine(); Console.WriteLine(article); } }
private static async Task TestListQuotes(IIEXCloudClient client) { var list = await client.GetList(MarketListCriteria.Gainers); foreach (var gainer in list) { Console.WriteLine(); Console.WriteLine(gainer.Symbol + " " + gainer.CompanyName); Console.WriteLine(gainer.Close + " " + gainer.ChangePercent + "%"); } }
private async static Task TestPriceTarget(IIEXCloudClient client) { var mv = await client.GetPriceTarget(Symbol); Console.WriteLine(mv); }
private async static Task TestMarketVolumeUS(IIEXCloudClient client) { var mv = await client.GetMarketVolumeUs(); Console.WriteLine(mv); }
private static async Task TestSystemEvents(IIEXCloudClient client) { var events = await client.GetSystemEvents(); Console.WriteLine(events.Type); }
private static async Task TestLogo(IIEXCloudClient client) { var logo = await client.GetLogo(Symbol); Console.WriteLine(logo); }
private static async Task TestBalanceSheets(IIEXCloudClient client) { var balanceSheets = await client.GetBalanceSheets(Symbol); Console.WriteLine(balanceSheets.First()); }
private static async Task TestDelayedQuote(IIEXCloudClient client) { var delayedQuote = await client.GetDelayedQuote(Symbol); Console.WriteLine(delayedQuote); }
private static async Task TestAccountMetadata(IIEXCloudClient client) { //var token = await client.GetSignedToken(); var account = await client.GetAccountMetadata(); }
private static async Task TestQuote(IIEXCloudClient client) { var quote = await client.GetQuote(Symbol); Console.WriteLine($"{Symbol} LatestPrice: " + quote.LatestPrice); }
private static async Task TestOHLC(IIEXCloudClient client) { var ohlc = await client.GetOHLC(Symbol); Console.WriteLine(ohlc); }
private static async Task TestDividends(IIEXCloudClient client) { var dividends = await client.GetDividends(Symbol, DividendRange.Years1); Console.WriteLine(dividends.First()); }