Posts

Showing posts from June, 2022

Live OI Data using Finvasia API.

oiData.py from tkinter import * from tkinter import ttk import sqlite3 import time import threading from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta from api_helper import ShoonyaApiPy, get_time import logging import pandas as pd import time import login root=Tk() root.geometry("680x350") api = ShoonyaApiPy() count=0 user    = login.user pwd     = login.pwd factor2 = login.factor2 vc      = login.vc app_key = login.app_key imei    = login.imei ret = api.login(userid=user, password=pwd, twoFA=factor2, vendor_code=vc, api_secret=app_key, imei=imei) niftyTokens=[] expiry="" niftyToken="" def startThread(instrument):     if(instrument=="future"):         t1=threading.Thread(target=futureOi)         t1.start()     elif(instrument=="oi"):         t1=threading.Thread(target=oiChange)         t1.start()              def optionChain():     global niftyToken     global niftyTokens     widgets= optionFrame.