Algo Trading.How to create User Interface , Fyers, Python

Here is the code to create GUI

root=Tk()

Label(root,text="ALGO TRADING",width=20).grid(row=0,column=0)

Button(root,text="SESSION",width=20,command=session_pop).grid(row=0,column=1)

Button(root,text="STRIKES",width=20,command=create_option).grid(row=0,column=2)

Button(root,text="PRICE",width=20,command=lambda:allThreads(1)).grid(row=0,column=3)

Label(root,text="QUANTITY",width=20).grid(row=1,column=2)

qty=Entry(root,width=24)

qty.grid(row=1,column=3)

Button(text="POSITION",width=20,command=exactPosition).grid(row=2,column=2)

Button(text="START",width=20,command=lambda:allThreads(2)).grid(row=2,column=3)

Label(root,text="NAME",width=20).grid(row=3,column=2)

strikeName=Entry(root,width=24)

strikeName.grid(row=3,column=3)

Label(root,text="QUANTITY",width=20).grid(row=4,column=2)

filledQty=Entry(root,width=24)

filledQty.grid(row=4,column=3)

Label(root,text="AVERAGE",width=20).grid(row=5,column=2)

avgPrice=Entry(root,width=24)

avgPrice.grid(row=5,column=3)

Label(root,text="PROFIT",width=20).grid(row=6,column=2)

profit=Entry(root,width=24)

profit.grid(row=6,column=3)


Button(text="EXIT",width=20,command=exitOrder).grid(row=7,column=2)

Button(text="STOP",width=20,command=stopFunction).grid(row=7,column=3)

risk=IntVar()

r1=Radiobutton(root,text="INDEX",width=20,variable=risk,value=1)

r1.grid(row=8,column=2)

r2=Radiobutton(root,text="STRIKE",width=20,variable=risk,value=2)

r2.grid(row=8,column=3)


Label(root,text="INDEX",width=20).grid(row=9,column=2)

spin1=Spinbox(root,width=20,from_=15000,to=50000)

spin1.grid(row=9,column=3)

Label(root,text="LOSS",width=20).grid(row=10,column=2)

spin2=Spinbox(root,width=20,from_=0,to=200)

spin2.grid(row=10,column=3)

Label(root,text="TARGET",width=20).grid(row=11,column=2)

spin3=Spinbox(root,width=20,from_=0,to=200)

spin3.grid(row=11,column=3)

Button(text="BUY MORE",width=20).grid(row=12,column=0)


book=IntVar()

b1=Radiobutton(root,text="TRAIL",variable=book,value=1)

b1.grid(row=12,column=1)

b2=Radiobutton(root,text="EXIT",variable=book,value=2)

b2.grid(row=12,column=2)

b3=Radiobutton(root,text="HALF EXIT",variable=book,value=3)

b3.grid(row=12,column=3)

Label(root,text="CONDITIONS",width=20).grid(row=13,column=0)

trail=Entry(root)

trail.grid(row=13,column=1)

Label(root,text="COND_NAME",width=20).grid(row=14,column=0)

Label(root,text="INDICATOR",width=20).grid(row=14,column=1)

Label(root,text="CONDITION",width=20).grid(row=14,column=2)

Label(root,text="VALUE",width=20).grid(row=14,column=3)


cond_name=Entry(root,width=24)

cond_name.grid(row=15,column=0)

cond_ind=Entry(root,width=24)

cond_ind.grid(row=15,column=1)

cond=Entry(root,width=24)

cond.grid(row=15,column=2)

cond_value=Entry(root,width=24)

cond_value.grid(row=15,column=3)


Label(root,text="SYMBOL",width=20).grid(row=16,column=0)

Label(root,text="QUANTITY",width=20).grid(row=16,column=1)

symbol=Entry(root,width=24)

symbol.grid(row=17,column=0)

cond_qty=Entry(root,width=24)

cond_qty.grid(row=17,column=1)


Button(text="START",width=20).grid(row=17,column=2)

Button(text="STOP",width=20).grid(row=17,column=3)



root.mainloop()


Please watch the video below for more information!!! 😊😊😊😊



Comments

Post a Comment

Popular posts from this blog

Create Option Chain using PYTHON.

How to Place Order in Zerodha using Python

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