예제 #1
0
        public Quote GetQuote(string symbol)
        {
            string requestUrl = string.Format(this.GetIEXBaseRequestUri(IEXRequestType.Quote), symbol);
            string jsonstring = base.GetString(requestUrl).Result;

            return(SerializerHandler.DeserializeObj <Quote>(jsonstring));
        }
예제 #2
0
        public Stat GetKeyStats(string symbol)
        {
            string reportUrl  = string.Format(this.GetIEXBaseRequestUri(IEXRequestType.Stats), symbol);
            string jsonstring = base.GetString(reportUrl).Result;

            return(SerializerHandler.DeserializeObj <Stat>(jsonstring));
        }
예제 #3
0
        public Company GetCompany(string symbol)
        {
            string requestUrl = string.Format(this.GetIEXBaseRequestUri(IEXRequestType.CompanyInfo), symbol);
            string jsonstring = base.GetString(requestUrl).Result;

            return(SerializerHandler.DeserializeObj <Company>(jsonstring));
        }
예제 #4
0
        public Financials GetFinancialReport(string symbol, Period period)
        {
            string reportUrl  = string.Format(this.GetIEXBaseRequestUri(IEXRequestType.Financial), symbol, period.ToString());
            string jsonstring = base.GetString(reportUrl).Result;

            Financials result = SerializerHandler.DeserializeObj <Financials>(jsonstring);

            return(result);
        }
예제 #5
0
        /// <summary>
        /// BatchReport of financial reports as annually or quarterly
        /// </summary>
        /// <param name="symbols"></param>
        /// <param name="period"></param>
        /// <returns></returns>
        public List <Chart> GetBatchFinancials(string[] symbols, Period period = Period.Annual)
        {
            string requestUrl = string.Format(this._dictRequestUrl[IEXRequestType.BatchReportFinancialForMultiStocks], symbols, period);
            string jsonstring = base.GetString(requestUrl).Result;

            List <Chart> result = SerializerHandler.DeserializeObj <List <Chart> >(jsonstring);

            return(result);
        }
예제 #6
0
        public List <Chart> GetHistoricData(string symbol, ChartOption chartOption)
        {
            string optionStr  = chartOption.ToString().StartsWith("_") ? chartOption.ToString().Remove(0, 1) : chartOption.ToString();
            string requestUrl = string.Format(this.GetIEXBaseRequestUri(IEXRequestType.Chart), symbol, optionStr);
            string jsonstring = base.GetString(requestUrl).Result;

            List <Chart> result = SerializerHandler.DeserializeObj <List <Chart> >(jsonstring);

            return(result);
        }
예제 #7
0
        public BatchReport GetBatchReport(string symbol, IEnumerable <IEXDataType> types, ChartOption range, int itemCount)
        {
            string rangeStr       = range.ToString().StartsWith("_") ? range.ToString().Remove(0, 1) : range.ToString();
            string baseRequestUri = GetIEXBaseRequestUri(IEXRequestType.BatchReportForAStock);
            string requestUrl     = string.Format(baseRequestUri, symbol, types.ToStringDelimeter(), rangeStr, itemCount.LimitToMax());

            Console.WriteLine(requestUrl);

            string jsonstring = base.GetString(requestUrl).Result;

            return(SerializerHandler.DeserializeObj <BatchReport>(jsonstring));
        }
예제 #8
0
        public Dictionary <string, BatchReport> GetBatchReport(string[] symbols, IEnumerable <IEXDataType> types, ChartOption range, int itemCount, Period period = Period.Annual)
        {
            string rangeStr       = range.ToString().StartsWith("_") ? range.ToString().Remove(0, 1) : range.ToString();
            string baseRequestUri = GetIEXBaseRequestUri(IEXRequestType.BatchReportMarketForMultiStocks);
            string requestUrl     = string.Format(
                baseRequestUri,
                symbols.ToStringDelimeter(),
                types.ToStringDelimeter(),
                rangeStr,
                itemCount.LimitToMax());

            if (types.Contains(IEXDataType.financials))
            {
                requestUrl = requestUrl + $"&period={period}";
            }
            requestUrl = requestUrl.ToLower();
            Console.WriteLine(requestUrl);

            string jsonstring = base.GetString(requestUrl.ToLower()).Result;

            return(SerializerHandler.DeserializeObj <Dictionary <string, BatchReport> >(jsonstring));
        }