StockETFHistoricalData 1.0.0
See the version list below for details.
dotnet add package StockETFHistoricalData --version 1.0.0
NuGet\Install-Package StockETFHistoricalData -Version 1.0.0
<PackageReference Include="StockETFHistoricalData" Version="1.0.0" />
paket add StockETFHistoricalData --version 1.0.0
#r "nuget: StockETFHistoricalData, 1.0.0"
// Install StockETFHistoricalData as a Cake Addin #addin nuget:?package=StockETFHistoricalData&version=1.0.0 // Install StockETFHistoricalData as a Cake Tool #tool nuget:?package=StockETFHistoricalData&version=1.0.0
Stock & ETF Historical Data README
The term asset will be used throughout the README file to describe both Stock and ETF (Exchange Traded Fund). The difference between the two is substancial, however for the purpose of the use of this software the term asset will apply to both.
The goal of this software is to provide the developer with a resource that gives free access to historical asset data. The software provides simplified classes that allow the developer to easily obtain daily historical asset prices with the Nasdaq, WallStreet Journal and Yahoo Finance APIs. The Nasdaq Api is used to obtain biographical information. Through the use of multiple sources the developer should be able to "clean" the data and use it with a reasonable degree of certainty that the data being used in calculations is accurate. Of the three data sources provided it is the author's opinion that the Nasdaq data should be regarded as the most reliable. Although Yahoo Finance is most often used as a source of free historical data, it is widely known that the data provided is not cleaned or checked for accuracy.
Package Stucture
Namespace: HistoricalData public class Asset { /// <summary> /// Date element of the Historical quote /// </summary> public DateTime Date { get; set; } /// <summary> /// Price at offical market open /// </summary> public decimal Open { get; set; } /// <summary> /// High price of the day /// </summary> public decimal High { get; set; } /// <summary> /// Low price of the day /// </summary> public decimal Low { get; set; } /// <summary> /// Price at offical market close /// </summary> public decimal Close { get; set; } /// <summary> /// Adjusted close price adjusted for both dividends and splits. /// </summary> public decimal AdjClose { get; set; } /// <summary> /// Number of shares traded during market session /// </summary> public ulong Volume { get; set; } } Namespace: HistoricalData.Biographical public class AssetInfo { internal AssetInfo() { } /// <summary> /// Biographical information based on Nasdaq data. /// </summary> /// <param name="symbol">Ticker ID for the desired asset.</param> public AssetInfo(string symbol)
private string Info { get; set; }
/// <summary>
/// Ticker symbol for the Asset
/// </summary>
public string Symbol { get; set; }
/// <summary>
/// Formal company name of the Asset.
/// </summary>
public string CompanyName { get; }
/// <summary>
/// Asset equity type.
/// </summary>
public string StockType { get; }
/// <summary>
/// Primary Exchange the Asset is traded.
/// </summary>
public string Exchange { get; }
/// <summary>
/// Asset is list on the Nasdaq exchange.
/// </summary>
public bool IsNasdaqListed { get; }
/// <summary>
/// Asset is part of the Nasdaq 100 Index.
/// </summary>
public bool IsNasdaq100 { get; }
/// <summary>
/// Last sale price in USD for Asset, current price if IsRealTime == True.
/// </summary>
public decimal LastSalePrice { get; }
/// <summary>
/// Absolute value change of Asset in USD during the trading session.
/// </summary>
public decimal NetChange { get; }
/// <summary>
/// Percentage change of Asset value (absolute) during the trading session.
/// </summary>
public decimal PercentChange { get; }
/// <summary>
/// Delta is the ratio that compares the change in the price of an asset, usually a marketable security, to the corresponding change in the price of its derivative.
/// </summary>
public string Delta { get; }
/// <summary>
/// DateTime object of the last recorded trade.
/// </summary>
public DateTime LastTradeTime { get; }
/// <summary>
/// Returns true if the data is being actively updated at present.
/// </summary>
public bool IsRealTime { get; }
/// <summary>
/// Defines the Asset. ie. Stocks or ETF
/// </summary>
public string AssetClass { get; }
/// <summary>
/// retrieves the Json file with biographical info via API call to Nasdaq.
/// </summary>
/// <returns>API results</returns>
internal string GetInfo()
}
Namespace: Historical Data.Source
The Nasdaq, WallStreetJournal, and Yahoo have the same parameters and properties with the exception of Yahoo which provides the AdjCloseArray property. The Adjusted Close is suppose to factor stock splits and dividend payouts.
public class Nasdaq : AssetInfo
{
/// <summary>
/// Returns up to 10 years (from current date) of historical data from Nasdaq API
/// </summary>
/// <param name="symbol">"Ticker ID for the desired asset."</param>
/// <param name="start">Beginning of query date range.</param>
/// <param name="end">End of query date range.</param>
public Nasdaq(string symbol, DateTime start, DateTime end) : base(symbol)
// start date for class internal
private DateTime StartDate { get; set; }
// end date for class internal
private DateTime EndDate { get; set; }
/// <summary>
/// Array of Asset objects returned from query.
/// </summary>
public Asset[] Assets { get; }
/// <summary>
/// Array of the Datetime objects
/// </summary>
public DateTime[] DateArray { get; }
/// <summary>
/// Array of the Open price values
/// </summary>
public decimal[] OpenArray { get; }
/// <summary>
/// Array of the High price values
/// </summary>
public decimal[] HighArray { get; }
/// <summary>
/// Array of the Low price values
/// </summary>
public decimal[] LowArray { get; }
/// <summary>
/// Array of the Close price values
/// </summary>
public decimal[] CloseArray { get; }
/// <summary>
/// Array of the Volume values
/// </summary>
public ulong[] VolumeArray { get; }
// makes the API call to NASDAQ server for historical data
private Asset[] GetHistoricalData()
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- Newtonsoft.Json (>= 12.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.