GithubHelp home page GithubHelp logo

zacmarcus / yahoofinance.net Goto Github PK

View Code? Open in Web Editor NEW
28.0 28.0 12.0 55 KB

YahooFinance.NET allows you to easily download historical end of day stock data and historical dividend data from Yahoo Finance.

License: MIT License

C# 75.87% PowerShell 24.13%

yahoofinance.net's People

Contributors

treythomascodes avatar unimatrix27 avatar zacmarcus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

yahoofinance.net's Issues

GetName possibility?

Would it be possible to get the name of the historicprice??

Im trying to get it 2 or 3 symbols in one .csv file

Parsing is bound to culture of current thread

Hi ZacMarcus,

I noticed the values returned from this package are far too big (usually x10000 of the correct value).

The reason for this is quite simple: Yahoo, of course, delivers its values in US format. My default thread culture however is German. I took a look in the source code and noticed you're using the default parse methods like decimal.Parse(values[1]) without specifying the culture explicitly.

So the problem would be solved by specifying the US format explicitly to the parse methods.

Thanks a lot,
Zacko

YahooFinance.GetRealTimeData & YahooFinance.GetHistoricalDividendData is not working

Hi ZacMarcus,

I have tried YahooFinance API, YahooFinance.GetDailyHistoricalPriceData is working to get the historical data.

However, when I call the YahooFinance.GetRealTimeData(yahoostockcode), there is WebException: The remote name could not be resolved: 'download.finance.yahoo.com'

I also tried Dim listdividendhistory As Object = YahooFinance.GetHistoricalDividendData(yahoostockcode), but no record count returns .

Here is my coding, do I need to handle the cookie and crumb ?

    Dim cookie As String = "YOUR_COOKIE"
    Dim crumb As String = "YOUR_CRUMB"

    Dim exchange As String = "HKG"
    Dim symbol As String = "0001"

    Dim YahooFinance As New YahooFinance.NET.YahooFinanceClient(cookie, crumb)  'retrieve cookies
    Dim yahoostockcode = YahooFinance.GetYahooStockCode(exchange, symbol)

Dim listhistoricalprice As Object = YahooFinance.GetDailyHistoricalPriceData(yahoostockcode)
Console.WriteLine("Historical Price")
For Each histprice In listhistoricalprice
With histprice
Console.WriteLine("Date: " & .Date & " Open: " & .Open & " High: " & .High & " Low: " & .Low & " Close: " & .Close & " AdjClose: " & .AdjClose & " Volume: " & .Volume)
End With
Next

    Dim listrealtimeprice As Object = YahooFinance.GetRealTimeData(yahoostockcode)
    Console.WriteLine("Real Time Price")
    For Each realtimeprice In listrealtimeprice

        With realtimeprice
            Console.WriteLine("Ask: " & .Ask & " Bid: " & .Bid & " Last: " & .Last & " PreviousClose: " & .PreviousClose _
                & " Open: " & .Open & " High: " & .High & " Low: " & .Low & " LastTradeTime: " & .LastTradeTime & " Volume: " & .Volume _
                & "Symbol: " & .Symbol & " Name: " & .Name)

        End With
    Next

Thanks
Davy

GetYahooStockCode method do not return expected value

Hello,

The following method do not return correct values except for US, UK & australian market (ok, the most important ones ;) )

public string GetYahooStockCode(string exchange, string code)
        {
            switch (exchange)
            {
                case "ASX":
                    return $"{code}.AX";
                default:
                    return code;
            }
        }

The complete list of suffix is available on http://finance.yahoo.com/exchanges

Maybe an enum of MarketExchange can make the use of the API easier ?

Could not install package 'YahooFinance.NET 4.0.0'

Install-Package : Could not install package 'YahooFinance.NET 4.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

My Computer W10 Prof, VS 2013 Prof

Any ideas

GetDailyHistoricalPriceData with start and end dates not working

Hi Team,

Love your work!! everything is working great except i cannot get the historical date for a given start date and end date, does this still work for you?

        Dim exchange As String = "ASX"
        Dim symbol As String = "ABC"
        Dim yahooFinance As YahooFinanceClient = New YahooFinanceClient(cookie, crumb)
        Dim yahooStockCode As String = yahooFinance.GetYahooStockCode(exchange, symbol)
        Dim yahooPriceHistory As List(Of YahooHistoricalPriceData) = yahooFinance.GetDailyHistoricalPriceData(yahooStockCode, New DateTime(2017, 12, 5), New DateTime(2017, 12, 8))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.