Posts

Showing posts from March, 2022

How to create a free stock screener in python

Image
 FREE STOCK SCREENER in PYTHON from tkinter import * from tkinter import ttk from tkinter.ttk import * import sqlite3 import math import threading import time import datetime from datetime import date from datetime import timedelta from fyers_api import fyersModel from fyers_api import accessToken root = Tk() style= ttk.Style() style.theme_use('winnative') #style.configure("TCombobox", fieldbackground= "black", background= "white") #style.configure("TListbox", fieldbackground= "black", background= "yellow") count=0 indicator=[] condition=[] value=[] andOr=[] stockEl=[] stopThread=False def clearWidgets():     global count     for widgets in midFrame.winfo_children():         widgets.destroy()     indicator.clear()     condition.clear()     value.clear()     andOr.clear()     count=0     count=(len(StockstoScan['values']))      i=0     while(i<count):         StockstoScan['values']={}         i+=1 def

How to create Option Strategy Builder for free in python?

Image
 Option Strategy Builder import tkinter as tk from tkinter import ttk from fyers_api import fyersModel from fyers_api import accessToken import threading root=tk.Tk() style=ttk.Style() style.theme_use('winnative') i=1 allStrikes=[] def optionStrikes(evt):     global slider     slider.destroy()     indexType=(evt["text"])     Lb1.delete(0,"end")     if(indexType=="NIFTY 50"):         price = {"symbols":"NSE:NIFTY50-INDEX"}         ltp=(fyers.quotes(price)["d"][0]["v"]["lp"])         value=int(ltp)         spot.delete(0,"end")         spot.insert(0,value)         value=value-value%100         price=value-1000         start=0         while(start<40):             Lb1.insert(start, price)             price+=50             start+=1         slider = tk.Scale(         frame3,         from_=value-1000,         to=value+1000,tickinterval=200,         orient='horizontal',command=all_profit

How to access live NSE data using python?

Image
Code to access NSE DATA using python import tkinter as tk from tkinter import ttk import threading from fyers_api import fyersModel from fyers_api import accessToken #create Window root=tk.Tk() style=ttk.Style() style.theme_use('winnative') def allThread(): t1=threading.Thread(target=liveData) t1.start() def clearWidgets(): for widgets in scrollableFrame.winfo_children(): widgets.destroy() def connect_fyers(): global fyers session=accessToken.SessionModel(client_id="CLIENT ID", secret_key="SECRET KEY",redirect_uri="https://trade.fyers.in/",  response_type="code", grant_type="authorization_code", state="abcdefg",scope="",nonce="") response = session.generate_authcode() #https://api.fyers.in/api/v2/generate-authcode?client_id=CLIENT_ID&redirect_uri=https://trade.fyers.in/&response_type=code&state=sample_state&nonce=sample_nonce   auth_code="eyJ0eXAiOiJKV1Q