Posts

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.

Filter Overbought and Oversold Stocks using JAVA and Zerodha Kiteconnect API.

IMPORT LIBRARIES import com.zerodhatech.kiteconnect.KiteConnect; import com.zerodhatech.kiteconnect.kitehttp.exceptions.KiteException; import com.zerodhatech.models.*; import java.io.IOException; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JOptionPane; import org.json.JSONException; DECLARE VARIABLES public static KiteConnect kiteSdk; public static String instrumentToken[][]=new String[1900][2]; public static int instrumentCount=0; public static boolean stopScan=false;  CONNECTING TO KITE String req_token=JOptionPane.showInputDialog(this,"ENTER REQUEST TOKEN"); String api_key=""; String sec_key=""; kiteSdk = new KiteConnect(""); kiteSdk.setUserId("LP8865"); User users = null;          try {              users = kiteSdk.generateSession(req_token, sec_key);          }  catch (IOException ex) {                    } catch (KiteException | JSONException ex) {         Logger.getLo

Create Option Chain using PYTHON.

from tkinter import * from tkinter import ttk import sqlite3 import time import threading from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta from kiteconnect import KiteConnect root=Tk() root.geometry("680x350") root.config(background="black") style= ttk.Style() style.theme_use('winnative') stopScan=False def startThread():     t1=threading.Thread(target=optionChain)     t1.start() def connectZerodha():     global kite     kite=KiteConnect(api_key="")     request_token=entryToken.get()     data=kite.generate_session(request_token,api_secret="")     kite.set_access_token(data["access_token"])     top.destroy()     expiry()     connectButton.config(bg="palegreen",text="CONNECTED") def popup():     global top,entryToken     top=Toplevel(root)     entryToken=ttk.Entry(top)     entryToken.grid(row=0,column=0)     Button(top,text="SUBMIT",command=connectZerodha).gr

How to place order in zerodha when RSI crosses below 30? Algo Trading Python

How to place order in zerodha when RSI crosses below 30? Algo Trading Python COMPLETE CODE from tkinter import * from tkinter import ttk import sqlite3 import threading from datetime import datetime, timedelta from kiteconnect import KiteConnect root=Tk() root.geometry("720x400") root.config(background="black") style= ttk.Style() style.theme_use('winnative') stopPos=False stopStrat=False def startThread(thread):     match thread:         case 0:             t1=threading.Thread(target=pnl)             t1.start()         case 1:             t1=threading.Thread(target=addStrategy)             t1.start() def stopThread(thread):     global stopPos,stopStrat     match thread:         case 0:             stopPos=True         case 1:             stopStrat=True def connectZerodha():     global kite     kite=KiteConnect(api_key="")     request_token=entryToken.get()     data=kite.generate_session(request_token,api_secret="")     kite.set_access_tok

How to Place Order in Zerodha using Python

HOW TO PLACE ORDER IN ZERODHA USING PYTHON GUI from tkinter import * from tkinter import ttk import sqlite3 import threading from kiteconnect import KiteConnect root=Tk() root.geometry("670x200") root.config(background="black") style= ttk.Style() style.theme_use('winnative') topFrame=Frame(root) Button(topFrame,text="CONNECT",command=popup,width=20,bg="green4",fg="white",font=("Arial Black",10)).grid(row=0,column=0) username=Label(topFrame,width=20,font=("Arial Black",10)) username.grid(row=0,column=1) Button(topFrame,text="SL&QUANTITY",command=generateFields,width=20,bg="green4",fg="white",font=("Arial Black",10)).grid(row=0,column=2) orderFrame=Frame(root) Label(orderFrame,text="NAME",width=20,bg="gray10",fg="white",font=("Arial Black",10)).grid(row=0,column=0) name=Entry(orderFrame,font=("Arial Black",10)) name.gr