Hi, I downloaded historical data (5 min interval) for many equities. Found issue with INFY data for 2015-06-12, the OHLC prices are double that of 2015-06-11 or 2015-06-15. Looks like the adjustment for stock split is not done.
I have two questions - 1. How and when the adjustment is done for splits, bonuses, dividends, corporate actions etc 2. Is this a temporary glitch or do we need to build a mechanism to catch such cases ?
@rakeshr Thanks for the reply. If adjustment is done only on day-candle, does that mean we have to do this ourselves on intraday candle ? If yes, then is there any API call which will give split ratios date wise ? And in kite charts, the data is adjusted for all time frames. Why not here ?
Thanks for the reply.
If adjustment is done only on day-candle, does that mean we have to do this ourselves on intraday candle ? If yes, then is there any API call which will give split ratios date wise ?
And in kite charts, the data is adjusted for all time frames. Why not here ?
Regards
Ajay
Excel does not support datetimes with timezones. Please ensure that datetimes are timezone unaware before writing to Excel.
For the info my current timezone is India right now as per my system
I have subscribed "Historical API"
import pdb
import datetime
import pandas as pd
from kiteconnect import KiteConnect
import openpyxl
import xlsxwriter
api_key = "***"
api_secret = "***"
# request_token = "**"
access_token = ""
kite = KiteConnect(api_key=api_key)
print("[*] Generate Access Token :", kite.login_url())
request_token = input("[*] Enter Your Request Token here: ")
data = kite.generate_session(request_token, api_secret=api_secret)
kite.set_access_token(data["access_token"])
trd_portfolio = {"HDFCBANK": {'token': 341249}}
token = 341249
to_date = datetime.datetime.now()
from_date = to_date - datetime.timedelta(days=30)
interval = "15minute"
records = kite.historical_data(token, from_date, to_date, interval)
df = pd.DataFrame(records)
df.to_excel("zerodhastocks.xlsx")
pdb.set_trace()
You can have look to this thread.
Also, don't hijack the thread, try creating a new thread for different queries.