This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def instrument_token(data, symbol): | |
""" | |
This function will return the token number of the instrument from data | |
""" | |
return data[data.tradingsymbol == symbol].instrument_token.values[0] | |
def historical_data(symbol, from_date, to_date, interval): | |
""" | |
This function will return historical data of the instrument for specific period of days for specific interval | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################## Ticks to candles in kiteconnect python #################### | |
# Author : Arun B | |
# Reference : http://ezeetrading.in/Articles/Candles_formation_from_tick_data_zerodha.html | |
# Purpose : Convert ticks to candles by putting ticks in a queue. This redues time wasted in on_ticks function | |
################################################################################ | |
from kiteconnect import KiteTicker | |
import datetime | |
from copy import copy | |
import queue |