def start(self): if self.running == 0: log.dbg("robot starting...") self.running = 1 self.bbands.start() self.macd.start() self.stoch.start() mkt.register_handle('depth', self.handle_depth) else: log.dbg("robot already running!")
def layout(self, parent): self.fig = plt.figure() #self.fig,self.ta_axes = plt.subplots(3,1,sharex=True) self.ta_canva =FigureCanvasTkAgg(self.fig, master=parent) self.ta_canva.get_tk_widget().pack(fill=BOTH, expand=YES) self.ta_canva._tkcanvas.pack(fill=BOTH, expand=YES) toolbar = NavigationToolbar2TkAgg(self.ta_canva, parent) toolbar.update() ###data graphic self.bbands = Bbands() self.macd = Macd() self.stoch = Stoch() self.bbands.start() self.macd.start() self.stoch.start() #mkt.register_handle('depth', win.handle_depth) mkt.register_handle('kline', self.handle_kline) sslot.register_trade_history(self.handle_trade_history) ###options handle sslot.register_indicator_select(self.indicator_select) sslot.register_plat_select(self.plat_select) sslot.register_pair_select(self.pair_select) sslot.register_future_or_spot_select(self.future_or_spot_select)
def start(self): mkt.register_handle('kline', self.handle_data)
def __init__(self): self.reg = list() self.r_i_history = list() #contain the region index number of past 10m self._n_r_i_his = 600 #max number of the region index history mkt.register_handle('price', self.update_region)