Skip to content

Commit

Permalink
Release 1.1.0.0
Browse files Browse the repository at this point in the history
Add another API functions
Readme added
The proxy part has been rewritten
  • Loading branch information
AlexeyZheltov committed Feb 2, 2022
1 parent 3439a01 commit 647a2d1
Show file tree
Hide file tree
Showing 133 changed files with 6,315 additions and 71 deletions.
379 changes: 375 additions & 4 deletions EODHistoricalData.Wrapper.Tests/APITest.cs

Large diffs are not rendered by default.

1,252 changes: 1,231 additions & 21 deletions EODHistoricalData.Wrapper/API.cs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions EODHistoricalData.Wrapper/APIs/Abstract/BaseAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ internal abstract class BaseAPI : IDisposable
private readonly HttpClient _httpClient;


public BaseAPI(string apiToken, bool useProxy = false)
public BaseAPI(string apiToken, IWebProxy? proxy = null)
{
_apiToken = apiToken;

if (useProxy)
if (proxy != null)
{
HttpClientHandler myHandler = new();
myHandler.DefaultProxyCredentials = CredentialCache.DefaultCredentials;
myHandler.Proxy = proxy;
_httpClient = new HttpClient(myHandler);
}
else
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using EOD.Model.BondsFundamentalData;

namespace EOD.APIs.Abstract
{
internal interface IBondsFundamentalsAndHistoricalAPI
{
/// <summary>
/// To get the full list of supported exchanges with names, codes, operating MICs, country, and currency
/// </summary>
Task<BondsFundamentalData> GetBondsFundamendalDataAsync(string cusip);

/// <summary>
/// To get the full list of supported exchanges with names, codes, operating MICs, country, and currency
/// </summary>
Task<List<BondHistoricalData>> GetBondHistoricalDataAsync(string code, DateTime? from = null, DateTime? to = null, string? order = null, string? period = null);
}
}
17 changes: 17 additions & 0 deletions EODHistoricalData.Wrapper/APIs/Abstract/IBulkAPI.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using EOD.Model.Bulks;

namespace EOD.APIs.Abstract
{
internal interface IBulkAPI
{
/// <summary>
/// To get the full list of supported exchanges with names, codes, operating MICs, country, and currency
/// </summary>
Task<List<Bulk>> GetBulksAsync(string code, string? type, DateTime? date, string? symbols);

/// <summary>
/// To get the full list of supported exchanges with names, codes, operating MICs, country, and currency
/// </summary>
Task<List<ExtendedBulk>> GetExtendedBulksAsync(string code, string? type, DateTime? date, string? symbols);
}
}
15 changes: 15 additions & 0 deletions EODHistoricalData.Wrapper/APIs/Abstract/ICalendarAPI.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using EOD.Model.EarningTrends;
using EOD.Model.IPOs;
using EOD.Model.UpcomingEarnings;
using EOD.Model.UpcomingSplits;

namespace EOD.APIs.Abstract
{
internal interface ICalendarAPI
{
Task<UpcomingEarning> GetUpcomingEarningsAsync(DateTime? from, DateTime? to, string? ticker);
Task<EarningTrend> GetEarningTrendsAsync(string ticker);
Task<UpcomingIPO> GetUpcomingIPOsAsync(DateTime? from = null, DateTime? to = null);
Task<UpcomingSplit> GetUpcomingSplitsAsync(DateTime? from = null, DateTime? to = null);
}
}
11 changes: 11 additions & 0 deletions EODHistoricalData.Wrapper/APIs/Abstract/IEconomicEventDataAPI.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace EOD.APIs.Abstract
{
internal interface IEconomicEventDataAPI
{
/// <summary>
/// To get the full list of supported exchanges with names, codes, operating MICs, country, and currency
/// </summary>
Task<List<EconomicEventData>> GetEconomicEventsDataAsync(DateTime? from = null, DateTime? to = null,
string? country = null, string? comparison = null, int? offset = null, int? limit = null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ internal interface IEndOfDayHistoricalDataAPI
/// <summary>
/// To get historical stock price data
/// </summary>
/// <param name="tiker">consists of two parts: {SYMBOL_NAME}.{EXCHANGE_ID}, then you can use, for example, MCD.MX for Mexican Stock Exchange. or MCD.US for NYSE</param>
/// <param name="ticker">consists of two parts: {SYMBOL_NAME}.{EXCHANGE_ID}, then you can use, for example, MCD.MX for Mexican Stock Exchange. or MCD.US for NYSE</param>
/// <param name="from">date from</param>
/// <param name="to">date to</param>
/// <param name="period">use ‘d’ for daily, ‘w’ for weekly, ‘m’ for monthly prices. By default, daily prices will be shown.</param>
/// <returns></returns>
Task<List<HistoricalStockPrice>> GetDataAsync(string tiker, DateTime from, DateTime to, string period);
Task<List<HistoricalStockPrice>> GetDataAsync(string ticker, DateTime from, DateTime to, string period);
}
}
12 changes: 12 additions & 0 deletions EODHistoricalData.Wrapper/APIs/Abstract/IExchangeDetailsAPI.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using EOD.Model.ExchangeDetails;

namespace EOD.APIs.Abstract
{
internal interface IExchangeDetailsAPI
{
/// <summary>
/// To get details on each exchange
/// </summary>
Task<ExchangeDetail> GetExchangeDetailsAsync(string code, DateTime? from = null, DateTime? to = null);
}
}
10 changes: 10 additions & 0 deletions EODHistoricalData.Wrapper/APIs/Abstract/IExchangeSymbolsAPI.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace EOD.APIs.Abstract
{
internal interface IExchangeSymbolsAPI
{
/// <summary>
/// To get a list of symbols for exchange
/// </summary>
Task<List<ExchangeSymbol>> GetExchangeSymbolsAsync(string code);
}
}
10 changes: 10 additions & 0 deletions EODHistoricalData.Wrapper/APIs/Abstract/IExchangesAPI.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace EOD.APIs.Abstract
{
internal interface IExchangesAPI
{
/// <summary>
/// To get the full list of supported exchanges with names, codes, operating MICs, country, and currency
/// </summary>
Task<List<Exchange>> GetExchangeAsync();
}
}
11 changes: 11 additions & 0 deletions EODHistoricalData.Wrapper/APIs/Abstract/IFinancialNewsAPI.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace EOD.APIs.Abstract
{
/// <summary>
/// Financial news API
/// </summary>
internal interface IFinancialNewsAPI
{
Task<List<FinancialNews>> GetFinancialNewsAsync(string? s = null, string? t = null,
DateTime? from = null, DateTime? to = null, int? limit = null, int? offset = null);
}
}
12 changes: 7 additions & 5 deletions EODHistoricalData.Wrapper/APIs/Abstract/IFundamentalDataAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ internal interface IFundamentalDataAPI
/// <summary>
/// To get fundamental data feed
/// </summary>
/// <param name="tiker">consists of two parts: {SYMBOL_NAME}.{EXCHANGE_ID},
/// then you can use, for example, AAPL.MX for Mexican Stock Exchange.
/// Or AAPL.US for NASDAQ.</param>
/// <returns></returns>
Task<FundamentalData> GetFundamentalsDataAsync(string tiker);
Task<FundamentalData> GetFundamentalsDataAsync(string ticker, string? filters = null);

/// <summary>
/// Bulk Fundamentals Output
/// </summary>
Task<BulkFundamental> GetBulkFundamentalsDataAsync(string ticker, int? offset = null,
int? limit = null, string? symbols = null);
}
}
12 changes: 12 additions & 0 deletions EODHistoricalData.Wrapper/APIs/Abstract/IHistoricalDividendsAPI.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace EOD.APIs.Abstract
{
/// <summary>
/// Historical Dividends API
/// </summary>
internal interface IHistoricalDividendsAPI
{
Task<List<HistoricalDividend>> GetDataAsync(string ticker, DateTime from, DateTime to);

Task<List<HistoricalSplit>> GetHistoricalSplitsAsync(string ticker, DateTime from, DateTime to);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace EOD.APIs.Abstract
{
internal interface IInsiderTransactionsAPI
{
Task<List<InsiderTransaction>> GetInsiderTransactionsAsync(int? limit = null, DateTime? from = null, DateTime? to = null, string? ticker = null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
/// </summary>
internal interface IIntradayHistoricalDataAPI
{
Task<List<IntradayHistoricalStockPrice>> GetDataAsync(string tiker, DateTime from, DateTime to, string interval);
Task<List<IntradayHistoricalStockPrice>> GetDataAsync(string ticker, DateTime from, DateTime to, string interval);
}
}
10 changes: 10 additions & 0 deletions EODHistoricalData.Wrapper/APIs/Abstract/ILiveStockPricesAPI.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace EOD.APIs.Abstract
{
/// <summary>
/// Intraday Historical Data API
/// </summary>
internal interface ILiveStockPricesAPI
{
Task<LiveStockPrice> GetLiveStockPricesAsync(string ticker);
}
}
11 changes: 11 additions & 0 deletions EODHistoricalData.Wrapper/APIs/Abstract/IMacroeconomicsDataAPI.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace EOD.APIs.Abstract
{
/// <summary>
/// Intraday Historical Data API
/// </summary>
internal interface IMacroIndicatorsAPI
{
Task<List<MacroIndicator>> GetDataAsync(string country, string indicator);
Task<List<MacroeconomicsData>> GetMacroeconomicsDataAsync(string ticker);
}
}
24 changes: 24 additions & 0 deletions EODHistoricalData.Wrapper/APIs/Abstract/IOptionsDataAPI.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using EOD.Model.OptionsData;

namespace EOD.APIs.Abstract
{
/// <summary>
/// Stock options data
/// </summary>
internal interface IOptionalDataAPI
{
/// <summary>
/// Get stock options data
/// </summary>
/// <param name="ticker">Consists of two parts: {SYMBOL_NAME}.{EXCHANGE_ID},
/// then you can use, for example, AAPL.MX for Mexican Stock Exchange.
/// Or AAPL.US for NASDAQ.</param>
/// <param name="from">filters OPTIONS by expirationDate. Default value: today.</param>
/// <param name="to">filters OPTIONS by expirationDate. Default value: '2100-01-01'.</param>
/// <param name="trade_date_from">filters OPTIONS by lastTradeDateTime. Default value: NONE.</param>
/// <param name="trade_date_to">filters OPTIONS by lastTradeDateTime. Default value: NONE.</param>
/// <param name="contract_name">returns only the data for particular contract.</param>
/// <returns></returns>
Task<OptionsData> GetOptionsDataAsync(string ticker, DateTime? from = null, DateTime? to = null, DateTime? trade_date_from = null, DateTime? trade_date_to = null, string? contract_name = null);
}
}
13 changes: 13 additions & 0 deletions EODHistoricalData.Wrapper/APIs/Abstract/IStockMarketScreenerAPI.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using EOD.Model.Screener;

namespace EOD.APIs.Abstract
{
internal interface IStockMarketScreenerAPI
{
/// <summary>
///
/// </summary>
Task<StockMarkerScreener> GetStockMarketScreenerAsync(string? filters = null, string? signals = null,
string? sort = null, int? limit = null, int? offset = null);
}
}
123 changes: 123 additions & 0 deletions EODHistoricalData.Wrapper/APIs/Abstract/ITechnicalIndicatorsAPI.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
using EOD.Model.TechnicalIndicators;

using static EOD.API;

namespace EOD.APIs.Abstract
{
internal interface ITechnicalIndicatorAPI
{
/// <summary>
/// This function returns the Simple Moving Average indicator
/// </summary>
Task<List<SMA>> GetSMAAsync(string ticker, int? period = null, DateTime? from = null, DateTime? to = null, string? order = null, int? splitAdjustedOnly = null);

/// <summary>
/// This function returns the Exponential Moving Average indicator
/// </summary>
Task<List<EMA>> GetEMAAsync(string ticker, int? period = null, DateTime? from = null, DateTime? to = null, string? order = null, int? splitAdjustedOnly = null);

/// <summary>
/// This function returns the Weighted Moving Average indicator
/// </summary>
Task<List<WMA>> GetWMAAsync(string ticker, int? period = null, DateTime? from = null, DateTime? to = null, string? order = null, int? splitAdjustedOnly = null);

/// <summary>
/// It’s not a technical indicator itself, but we added this function to our API.
/// By default Open, High, Low and Close values (OHLC) provided in raw values and adjust neither for splits nor for dividends.
/// </summary>
Task<List<SplitAdjustedData>> GetSplitAdjustedDataAsync(string ticker, int? period = null, DateTime? from = null, DateTime? to = null,
string? order = null, HistoricalPeriod? historicalPeriod = null);


/// <summary>
/// This function returns the Average Trading Volume.
/// </summary>
Task<List<AverageVolume>> GetAverageVolumeAsync(string ticker, int? period = null, DateTime? from = null, DateTime? to = null,
string? order = null);

/// <summary>
/// This function returns the Average Trading Volume.
/// </summary>
Task<List<AverageVolumebyPrice>> GetAverageVolumebyPriceAsync(string ticker, int? period = null, DateTime? from = null, DateTime? to = null,
string? order = null);

/// <summary>
/// This function returns the Volatility, a statistical measure of the dispersion of returns for a given security or market index.
/// </summary>
Task<List<Volatility>> GetVolatilityAsync(string ticker, int? period = null, DateTime? from = null, DateTime? to = null,
string? order = null, int? splitAdjustedOnly = null);

/// <summary>
/// This function returns the Volatility, a statistical measure of the dispersion of returns for a given security or market index.
/// </summary>
Task<List<Stochastic>> GetStochasticAsync(string ticker, int? period = null, DateTime? from = null, DateTime? to = null,
string? order = null, int? fast_kperiod = null, int? slow_kperiod = null, int? slow_dperiod = null);

/// <summary>
/// This function returns the Relative Strength Index (RSI) technical indicator.
/// </summary>
Task<List<RelativeStrengthIndex>> GetRelativeStrengthIndexAsync(string ticker, int? period = null, DateTime? from = null, DateTime? to = null,
string? order = null, int? splitAdjustedOnly = null);

/// <summary>
/// This function returns the Standard Deviation (stddev) technical indicator.
/// </summary>
Task<List<StandardDeviation>> GetStandardDeviationAsync(string ticker, int? period = null, DateTime? from = null, DateTime? to = null,
string? order = null);

/// <summary>
/// This function returns Stochastic Relative Strength Index values.
/// </summary>
Task<List<StochasticRelativeStrengthIndex>> GetStochasticRelativeStrengthIndexAsync(string ticker, int? period = null, DateTime? from = null, DateTime? to = null,
string? order = null, int? fast_kperiod = null, int? fast_dperiod = null);

/// <summary>
/// This function returns the Linear Regression Slope.
/// </summary>
Task<List<Slope>> GetSlopeAsync(string ticker, int? period = null, DateTime? from = null, DateTime? to = null,
string? order = null, int? splitAdjustedOnly = null);

/// <summary>
/// This function returns the Directional Movement Index.
/// </summary>
Task<List<DirectionalMovementIndex>> GetDirectionalMovementIndexAsync(string ticker, int? period = null, DateTime? from = null, DateTime? to = null,
string? order = null);

/// <summary>
/// This function returns the Average Directional Movement Index.
/// </summary>
Task<List<AverageDirectionalMovementIndex>> GetAverageDirectionalMovementIndexAsync(string ticker, int? period = null, DateTime? from = null,
DateTime? to = null, string? order = null);

/// <summary>
/// This function returns Moving Average Convergence/Divergence values.
/// </summary>
Task<List<MovingAverageConvergence>> GetMovingAverageConvergenceAsync(string ticker, int? period = null, DateTime? from = null, DateTime? to = null,
string? order = null, int? splitAdjustedOnly = null, int? fast_period = null, int? slow_period = null, int? signal_period = null);

/// <summary>
/// This function returns the average of true ranges over the specified period.
/// </summary>
Task<List<AverageTrueRange>> GetAverageTrueRangeAsync(string ticker, int? period = null, DateTime? from = null, DateTime? to = null,
string? order = null);

/// <summary>
/// This function returns the CCI data. The Commodity Channel Index​ (CCI) is a momentum-based oscillator used to help determine when
/// an investment vehicle is reaching a condition of being overbought or oversold.
/// </summary>
Task<List<CommodityChannelIndex>> GetCommodityChannelIndexAsync(string ticker, int? period = null, DateTime? from = null, DateTime? to = null,
string? order = null);

/// <summary>
/// This function returns the Parabolic SAR values.
/// </summary>
Task<List<ParabolicSAR>> GetParabolicSARAsync(string ticker, int? period = null, DateTime? from = null, DateTime? to = null,
string? order = null, double? acceleration = null, double? maximum = null);

/// <summary>
/// This file format returns the data in AmiBroker File format to import the data into AmiBroker software.
/// </summary>
Task<List<AmiBrokerData>> GetAmiBrokerDataAsync(string ticker, int? period = null, DateTime? from = null, DateTime? to = null,
string? order = null);
}
}
Loading

0 comments on commit 647a2d1

Please sign in to comment.