Example #1
0
 def on_finish(self):
     # show the result
     import plotly.io as pio
     pio.renderers.default = "browser"
     reader = AccountReader(trader_names=[self.trader_name])
     drawer = Drawer(main_data=NormalData(
         reader.data_df.copy()[['trader_name', 'timestamp', 'all_value']],
         category_field='trader_name'))
     drawer.draw_line()
Example #2
0
File: trader.py Project: zone21/zvt
 def on_finish(self, timestmap):
     self.on_trading_finish(timestmap)
     # show the result
     if self.draw_result:
         import plotly.io as pio
         pio.renderers.default = "browser"
         reader = AccountStatsReader(trader_names=[self.trader_name])
         df = reader.data_df
         drawer = Drawer(main_data=NormalData(df.copy()[['trader_name', 'timestamp', 'all_value']],
                                              category_field='trader_name'))
         drawer.draw_line(show=True)
 def draw_line(self, show=True):
     drawer = Drawer(main_data=NormalData(
         self.data_df.copy()[['trader_name', 'timestamp', 'all_value']],
         category_field='trader_name'))
     return drawer.draw_line(show=show)
                self.filters += filter
            else:
                self.filters = filter

        super().__init__(Order,
                         None,
                         None,
                         None,
                         None,
                         None,
                         None,
                         the_timestamp,
                         start_timestamp,
                         end_timestamp,
                         columns,
                         self.filters,
                         order,
                         None,
                         level,
                         category_field='trader_name',
                         time_field='timestamp',
                         computing_window=None)


if __name__ == '__main__':
    reader = AccountStatsReader(trader_names=['000338_ma_trader'])
    drawer = Drawer(main_data=NormalData(
        reader.data_df.copy()[['trader_name', 'timestamp', 'all_value']],
        category_field='trader_name'))
    drawer.draw_line()