Extract Minute Data from KiteConnect and Analyse SMA from Pandas and then Plot Graph from Matplotlib.

Simple Moving Average is one of the Techncial Indicator widely used with other technical indicators which i already explained in this post SMA.

Exactly in this one i'm extracting the price of NIFTY 50 from KiteConnect then trying to Build Simple Moving Average with the help of Pandas Dataframes and then try to Plot with the help of Matplotlib.

So let's get started,all you need in this is to set access token and api key for that you need to follow this you tube video Automate Trade-KiteConnect-Python API Trading Platform-StockMarket-Part 1 after that need to define the Simple Moving Average to Compute it and then need to set instument token which you can get from by just pasting this URL  https://api.kite.trade/instruments in your browser and after that a download will start just save the file as filename.csv then find out the instrument_token which you need to extract the minute data for it's analysis then exactly set from and to date and set the interval as per your wish for minute data you ask for as minute,5minute,10minute,15minute,30minute and 60minute you can set interval day also to fetch datas of previous day and exactly need to define which date you want in particular.

From date and to date should be in the format of yyyy-mm-dd then after call the data in a dataframe and then enjoy you built an SMA with the help of KiteConnect data.

This Post i Just Created so you actually can visualize the data with the help of KiteConnect for Further Please follow the Video for Proper Instructions then Code Input.

#import the Necessary Package module
from kiteconnect import KiteConnect
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import style
api_key= 'your_api_key'
kite = KiteConnect(api_key=api_key)
If you need access token from idle just comment out the below 2 line then afte place the access token to the 3rd line


def MA(data,n):
    return data


--End of Code Input--

Have any Doubt regarding this please do Comment and Please do Share us On Various Social Media PLatform: