Python Charting Stocks/Forex for Technical Analysis Part 3 - Free intra-day stock data



Charting Stocks in Python playlist: http://www.youtube.com/watch?v=u6Xd3kRHhJI&feature=share&list=PLQVvvaa0QuDcR-u9O8LyLR7URiKuW-XZq This is the third video in the series for stock price analysis, showing how to get higher granularity data. The purpose of the videos in this series is to teach you how to program your own charting and analysis of stocks or Forex. This is beneficial for you if you plan to do any sort of algorithmic, high-frequency, or any sort of automated trading. Sentdex.com Facebook.com/sentdex Twitter.com/sentdex

Comments

  1. Why you don't save data to SQL database, like MySQL? Do you have tutorial for pulling stocks to MySQL? .txt files has many restrictions and are not suitable for financial models, especially big data models. Tutorial are very good. Thanks.
  2. what is purpose of using time.sleep() here?
  3. sentdex amazing video Ive learned a lot in the past 3 videos. Hopefully I will end up doing my own algorithm! :)
  4. If the DB aspect of this was not done, I would love you if you could do a small tutorial on that :)
  5. program ran fine, now i cant find the files. where should I look?
  6. you've taught me more in three weeks than I've learned in 4 years of university.
  7. Can i Do this with currency's using : http://finance.yahoo.com/echarts?s=audusd=X#{"allowChartStacking":true}
  8. if there a script to pull stock data into excel?
  9. I really don't understand why you can import 'stock' variable in the function when you assigned stocksToPull and it still bring up AAPL.... i mean does it try to find any variable close to stock and it finds that? or is there something I am missing? thanks for replying!
  10. Hi. If I'm programming in IPython, any idea where the .txt files are written, or how to find out? Thanks!
  11. I  cant seem to run it in 3.5 any ideas would help alot
    thanks
  12. Thanks for the video very helpful. Using this code how would I go about printing out if a stock I have imported has hit a new day high. For example if stockPrice > last 20 days print stock. Very new to programming any help would be very much appreciated. Thanks.
  13. Thanks for this! Really Helpful!
  14. Hey know this is a old video but i have just startet programming in Python and thought this could be fun, but I seem to have some problems.

    I use Python 2.7.8.

    my code:
    import urllib2
    import time

    stocksToPull = 'AAPL','GOOG','MSFT','CMG','AMZN','EBAY','TSLA'

    def pullData(stock):
        try:
            fillLine = stock+'.txt'
            urlToVisit = 'http://chartapi.finance.yahoo.com/instrument/1.0/'+stock+'chartdata;type=quote;range=1y/csv'
            sourceCode = urllib2.urlopen(urlToVisit).read()
            splitSource = sourceCode.split('\n')

            for eachLine in splitSource:
                splitLine = eachline.split(',')
                if len (splitLine) ==6:
                    if 'values' not in eachLine:
                        saveFile = open(fileLine,'a')
                        lineToWrite = eachLine+'\n'
                        saveLine.write(lineToWrite)

            print 'Pulled',stock
            print 'sleeping'
            time.sleep(1)

            
        except Exception,e:
            print 'main loop',str(e)


    for eachStock in stocksToPull:
        pullData(eachStock)

    but all i get is:
    main loop HTTP Error 404: Not Found
    main loop HTTP Error 404: Not Found
    main loop HTTP Error 404: Not Found
    main loop HTTP Error 404: Not Found
    main loop HTTP Error 404: Not Found
    main loop HTTP Error 404: Not Found
    main loop HTTP Error 404: Not Found

    Thank you,
    TT
  15. How can I pull this into excel where the data is pulled correctly into the cells?
  16. any idea on how to extract data from malaysian stock market?
  17. I go this error at the end of running my program

    main loop can only concatenate tuple (not "str") to tuple

    Is this an issue? All the files were created properly
  18. Thank you for all the tutorials you have published. It seems like yahoo has discontinued chartapi. I found that the url now is http://ichart.finance.yahoo.com/table.csv?s=AAPL&a=00&b=1&c=2013&d=11&e=31&f=2013&g=d&ignore=.csv but it keeps giving me error. I did try to add headers but no luck.

    Thank you,
    pk
  19. thanks. simple and smart. 
  20. Impossible to know without seeing the source code. I could also make some print outs identically to that showing me making epic profit. Machine learning stock data is of course a possibility. I am currently working on a tutorial series for it, actually :P


Additional Information:

Visibility: 14716

Duration: 7m 10s

Rating: 62