Fetch Historical Data using fyers api v3

import datetime import pandas as pd def fetch_historical_data(symbol, start_date, end_date, interval=”3″): def historical_bydate(symbol, sd, ed, interval=”3″): data = { “symbol”: symbol, “resolution”: interval, “date_format”: “1”, “range_from”: str(sd), “range_to”: str(ed), “cont_flag”: “1” } nx = fyers.history(data) cols = [‘date’, ‘open’, ‘high’,…

Fetch Live Option Chain Using Kotak Neo API

Option chain using kotak neo api

import neo_api_client from neo_api_client import NeoAPI def create_exchange_tokens_live(df, custom_segment_name): exch_tokens = [] for index, row in df.iterrows(): # Use the custom_segment_name provided and add it to the end token_dict = { “instrument_token”: str(row[‘pSymbol’]), “exchange_segment”: custom_segment_name.lower() } exch_tokens.append(token_dict) return exch_tokens def…