Kite historical provide candles till daily timeframe. so for weekly and monthly candles, we have to resample them. below codes can be directly applied to historical data for getting weekly and monthly candles
I am a full time developer and have been trading since 2012. I am a Zerodha client since 2015 and have been profitably running Cloud based Intraday and Positional Trading and Investing Algorithms for Indices and Stocks since past 3 years. I design, deploy, and manage algorithms for myself, my family members and more than 15 retail clients and prop traders. Anyone needing my support can reach me at: +91-9749-521-023 [email protected]
Contact me for the best algo developed in India @ 9-8- 5-0--0-7-3-2-1-7* at [email protected] This algo is purely developed on the cash market stocks based on the preopen prices. All orders are CO Orders and are fully automated.
below codes can be directly applied to historical data for getting weekly and monthly candles
df['date'] = pd.to_datetime(df['date'])
df = df.set_index(df['date'])
logic = {'open' : 'first', 'high' : 'max', 'low' : 'min', 'close' : 'last', 'volume': 'sum'}
# Weekly resampling
df.resample('W-MON', closed= "left", label="left").apply(logic)
# Monthly resampling
mdf = df.resample('MS').apply(logic)
reference: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.resample.html
This algo is purely developed on the cash market stocks based on the preopen prices. All orders are CO Orders and are fully automated.