TraderShop.Financials.TdAmeritrade.PriceHistory 1.0.0-preview1

This is a prerelease version of TraderShop.Financials.TdAmeritrade.PriceHistory.
There is a newer version of this package available.
See the version list below for details.
dotnet add package TraderShop.Financials.TdAmeritrade.PriceHistory --version 1.0.0-preview1                
NuGet\Install-Package TraderShop.Financials.TdAmeritrade.PriceHistory -Version 1.0.0-preview1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TraderShop.Financials.TdAmeritrade.PriceHistory" Version="1.0.0-preview1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TraderShop.Financials.TdAmeritrade.PriceHistory --version 1.0.0-preview1                
#r "nuget: TraderShop.Financials.TdAmeritrade.PriceHistory, 1.0.0-preview1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install TraderShop.Financials.TdAmeritrade.PriceHistory as a Cake Addin
#addin nuget:?package=TraderShop.Financials.TdAmeritrade.PriceHistory&version=1.0.0-preview1&prerelease

// Install TraderShop.Financials.TdAmeritrade.PriceHistory as a Cake Tool
#tool nuget:?package=TraderShop.Financials.TdAmeritrade.PriceHistory&version=1.0.0-preview1&prerelease                

Price History Library

<img src="https://img.shields.io/github/issues/ucrengineer/TraderShop.Financials" alt = "home screen" style = "float: left"/> <img src="https://img.shields.io/github/forks/ucrengineer/TraderShop.Financials" alt = "home screen" style = "float: left"/> <img src="https://img.shields.io/github/stars/ucrengineer/TraderShop.Financials" alt = "home screen" style = "float: left"/> <img src="https://img.shields.io/github/license/ucrengineer/TraderShop.Financials.TdAmeritrade" alt = "home screen" style = "float: left"/>

<br></br> <a href="https://www.buymeacoffee.com/ucrengineer" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>

<br></br> TdAmeritrade API PriceHistory Documentation

Usage

    public class PriceHistoryProviderDemo
    {
        private readonly ITdAmeritradePriceHistoryProvider _priceHistoryProvider;

        public PriceHistoryProviderDemo(ITdAmeritradePriceHistoryProvider priceHistoryProvider)
        {
            _priceHistoryProvider = priceHistoryProvider;
        }

        public async Task Return_PriceHistory_Successfully()
        {
            var result = await _priceHistoryProvider.GetPriceHistory(new PriceHistorySpecs());

            Assert.NotNull(result);
            Assert.Contains(result, x => x.Close != 0);
        }
              
        // Input model  
        public class PriceHistorySpecs
        {
            /// Instrument symbol. Default is AAPL.
            public string Symbol { get; set; } = "AAPL";
    
            /// The type of period to show. Default is <b>day</b>.
            public PeriodType PeriodType { get; set; } = PeriodType.year;
    
            /// The number of periods to show. Valid periods by periodType (defaults marked with an asterisk):
            public int Period { get; set; } = 1;
    
            /// The type of frequency with which a new candle is formed.
            /// Valid frequencyTypes by periodType (defaults marked with an asterisk):
            public FrequecyType FrequecyType { get; set; } = FrequecyType.daily;
            /// The number of the frequencyType to be included in each candle.
            /// Valid frequencies by frequencyType (defaults marked with an asterisk):
    
            public int Frequency { get; set; } = 1;
            /// End date as milliseconds since epoch.
            /// If startDate and endDate are provided, period should not be provided.
            /// Default is previous trading day.
            public DateTimeOffset EndDate { get; set; } = DateTimeOffset.Now.AddDays(-1);
    
            /// Start date as milliseconds since epoch. If startDate and endDate are provided, period should not be provided.
            public DateTimeOffset StartDate { get; set; } = DateTimeOffset.Now.AddYears(-1);
    
            /// <b>true</b> to return <b>extended hours data</b>,<b>false</b> for <b>regular market hours</b> only.<b>Default</b>  is <b>true</b>.
            public bool NeedExtendedHoursData { get; set; } = true;
    
        }
    
        public enum PeriodType
        {
            day,
            month,
            year,
            ytd
        }
    
        public enum FrequecyType
        {
            minute,
            daily,
            weekly,
            monthly
        }
        
        // output model 
            public class Candle
        {
            public decimal Close { get; set; }
    
            public long DateTime { get; set; }
    
            public decimal High { get; set; }
    
            public decimal Low { get; set; }
    
            public decimal Open { get; set; }
    
            public long Volume { get; set; }
        }
    
        public class PriceHistoryRoot
        {
            public Candle[] Candles { get; set; } = new Candle[0];
    
            public bool Empty { get; set; }
    
            public string Symbmol { get; set; } = string.Empty;
    
        }

    }

Description

This library is in charge of returning price histories for a given instrument.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.0 373 11/21/2022
1.1.4 531 7/4/2022
1.1.3 443 6/20/2022
1.1.2 438 6/19/2022
1.0.2 440 6/10/2022
1.0.1 429 5/24/2022
1.0.0 430 5/24/2022
1.0.0-preview1 196 5/24/2022