![]() ![]() Self.tbEntry = Entry(self, font=( '', 12), textvariable=varEntry).grid(row=0, column=1, sticky=W) Self.btnAddSymbol = ttk.Button(self, text = "Add Symbol", command=self.add_symbol).grid(row=0, column=0, sticky=W) ![]() In this video you will learn to delete a selected item in a listbox tkinter widget using Python3įrom tkinter import from tkinter import ttk ![]() VarOutsideRTH = StringVar(root, value= False) Order.m_outsideRth = outside_Rth # add order.m_outsideRth = outside_Rth return orderĪdd this to the bottom where all the variables are for your window form widgets. Self.tws_aceOrder(self.order_id, contract, order)Īdd the variable outsideRTH to the highlighted areas in the create_order() function as shown below.ĭef create_order(self, order_type, quantity, action, limit_price, outside_Rth): # add outside_Rth Order = self.create_order(order_type, quantity, buysell, limit_price, my_outsideRTH) # add here True, self.limit_price, the_outsideRTH) # add here def sell(self):įalse, self.limit_price, the_outsideRTH) # add hereĪdd the variable my_outsideRTH to the highlighted areas in the place_market_order() function as shown below.ĭef place_market_order(self, symbol, quantity, order_type, is_buy, limit_price, my_outsideRTH): # add here print (symbol, quantity, order_type, is_buy, limit_price) ace_market_order(self.symbol, self.quantity, self.order_type, Self.my_outside = varOutsideRTH.get() # add here the_outsideRTH = 0 if self.my_outside = True: the_outsideRTH = 1 Text= 'OutsideRTH', variable=varOutsideRTH)Īdd highlighted text to the buy(self): function and the sell(self): function Self.chkOutsideRTH = Checkbutton(f1, font=( '', 10), # create a check button box for outside RTH In this tutorial you will add a check box to your gui form window that will allow you to trade after hours and pre-market.Īdd this variable to hold the variable for the checkbox just above the create widgets function.Īdd this to the end of the create_widgets(self): function IB TWS Trading Platform in Python 8 outsideRTH ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |