Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in and Co-Creator of Algomojo (Algorithmic Trading Platform for DIY Traders)

Fetch Intraday Data from Google and Plot using Python

47 sec read

Here is an yet another interesting python tutorial to fetch intraday data using Google Finance API , store the data in csv format and also plot the intraday data as candlestick format. We are using plotly library for plotting candlestick charts and pandas to manage time-series data. Luckily found and interesting python code which fetches google intraday data and store in csv format. Done some little modification in the code (exchange added to the Google API) so that one can fetch data for any exchange.

In our example we try to retrieve the data (Date,Time,Symbol,Open,High,Low,Close,Volume data) for RCOM (Reliance Communication) and plot as candlesticks using plotly library. Download the sample RCOM CSV file fetched from Google Finance
[wp_ad_camp_5]

 

Sample IPython Notebook using Plotly and pandas to plot Interactive Intraday Candlestick Charts using Google Finance API :

In the next tutorial we will be discussing how to push intraday data to Amibroker software using python .

Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in and Co-Creator of Algomojo (Algorithmic Trading Platform for DIY Traders)

Nifty Daily Returns – Distribution Statistics – Python Code

The Nifty index is one of the most popular stock market indices in India among traders and investors, and it tracks the performance of...
Rajandran R
3 min read

Supertrend Algomojo Trading Strategy using Algomojo and yfinance

Supertrend is a simple ATR-based trend-following strategy that identifies the current trend and mages the risk dynamically with ATR-based trailing stoploss. In this blog,...
Rajandran R
6 min read

Build a Correlation Matrix using Python Pandas and Seaborn

In finance, a correlation matrix is a matrix that shows the correlation between different variables. It is a powerful tool for analyzing the relationships...
Rajandran R
2 min read

10 Replies to “Fetch Intraday Data from Google and Plot using Python”

  1. Hello Rajendran,

    Thanks for this tutorial. One question though, Is there in value addition in learning python if one is already well versed in AFL? What are the benefits of python over AFL?

    Thanks,
    Snehil

  2. Any pointer on how I can display these python processed graph on html webpage.? Secondly, Can python script be ran dynamically according to action on my dynamic webpage. I am not aware of Python yet and always use JavaScript, you guide may push me to learn Python.

  3. Any thing that we can cut and paste and use for illiterate’s like me? If you have any such thing please put it up. thanks.

  4. Dear Rajendran,

    Is there any limitation of no of scripts to fetch the data from google and feed in ami broker.

  5. Dear Rajendran,
    I have a query if you support it will be very much useful
    In the above code i would like to plot the candle for 1hr 2 hour how to do that? is there a way.
    I want 1hr starts from 9.15AM 10.15AM 11.15AM like this not from 10AM 11AM etc.

    Please feedback what parameter i would need to change to get the same

  6. Hello Rajendran,
    The code has stopped fetching data since last 2-3 days. It returns a 0kb file. Can you please look into it?

  7. This doesnt work any longer. The URL must have changed. Am getting HTTP 403 error.

Leave a Reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More