Exemplo n.º 1
0
    def _init_cells_(self):
        online_label_div = MyHTML.div(self.my_search_online_label_div,
                                      'Online Search', True)
        online_value_div = MyHTML.div(self.my_search_online_value_div, '',
                                      False)

        found_label_div = MyHTML.div(self.my_search_found_label_div, 'Found:',
                                     True)
        found_valid_value_div = MyHTML.div(
            self.my_search_found_valid_value_div, '0')
        found_all_value_div = MyHTML.div(self.my_search_found_all_value_div,
                                         '0')

        found_div = MyHTML.div_embedded([
            found_label_div,
            MyHTML.span(' '), found_valid_value_div,
            MyHTML.span('/'), found_all_value_div
        ],
                                        inline=True)

        self.set_value(
            1, 1,
            MyHTML.div_embedded(
                [online_label_div,
                 MyHTML.span(' '), online_value_div]))
        self.set_value(1, 2, MyDCC.markdown(self.my_search_markdown))
        self.set_value(1, 3, MyHTML.div_embedded([found_div,
                                                  MyHTML.span(' ')]))
Exemplo n.º 2
0
    def _init_cells_(self):
        id_label_div = MyHTML.div(self.my_sales_id_label_div, 'Sale ID:', True)
        id_value_div = MyHTML.div(self.my_sales_id_value_div, '', False)

        found_label_div = MyHTML.div(self.my_sales_found_label_div,
                                     'Available:', True)
        found_valid_value_div = MyHTML.div(self.my_sales_found_valid_value_div,
                                           '0')
        found_all_value_div = MyHTML.div(self.my_sales_found_all_value_div,
                                         '0')

        found_div = MyHTML.div_embedded([
            found_label_div,
            MyHTML.span(' '), found_valid_value_div,
            MyHTML.span('/'), found_all_value_div
        ],
                                        inline=True)

        self.set_value(
            1, 1,
            MyHTML.div_embedded([id_label_div,
                                 MyHTML.span(' '), id_value_div]))
        self.set_value(1, 2, MyDCC.markdown(self.my_sales_markdown))
        self.set_value(1, 3, MyHTML.div_embedded([found_div,
                                                  MyHTML.span(' ')]))
 def _init_cells_(self):
     chart_label_div = MyHTML.div('my_pattern_statistics_chart_label_div',
                                  'Chart:', True)
     chart_div = MyHTML.div('my_pattern_statistics_chart_type_div', '',
                            False)
     statistics_label_div = MyHTML.div('my_pattern_statistics_label_div',
                                       'Pattern:', True)
     statistics_div = MyHTML.div('my_pattern_statistics_div', '0')
     statistics_summary_div = MyHTML.div_embedded(
         [statistics_label_div,
          MyHTML.span(' '), statistics_div])
     statistics_detail_label_div = MyHTML.div(
         'my_pattern_statistics_detail_label_div', 'Type:', True)
     statistics_detail_div = MyHTML.div('my_pattern_statistics_detail_div',
                                        '0')
     statistics_detail_summary_div = MyHTML.div_embedded([
         statistics_detail_label_div,
         MyHTML.span(' '), statistics_detail_div
     ])
     self.set_value(
         1, 1,
         MyHTML.div_embedded([chart_label_div,
                              MyHTML.span(' '), chart_div]))
     self.set_value(1, 2, MyDCC.markdown('my_pattern_statistics_markdown'))
     self.set_value(
         1, 3,
         MyHTML.div_embedded(
             [statistics_summary_div, statistics_detail_summary_div]))
Exemplo n.º 4
0
 def __get_embedded_div_for_last_run_and_start_job_button__(self):
     label_div = MyHTML.div(self._my_jobs_last_check_label_div,
                            'Last check:', True)
     value_div = MyHTML.div(self._my_jobs_last_check_value_div, '', False)
     button_start = MyHTML.button_submit(self._my_jobs_start_job_button,
                                         'Start selected job')
     button_activate = MyHTML.button_submit(
         self._my_jobs_activate_job_button, 'Deactivate selected job')
     return MyHTML.div_embedded([
         label_div,
         MyHTML.span(' '), value_div,
         MyHTML.span(' '), button_start, button_activate
     ],
                                inline=True)
    def _init_cells_(self):
        crypto_client_label_div = MyHTML.div(
            'my_models_crypto_client_label_div', 'Bitfinex:', bold=True)
        crypto_client_value_div = MyHTML.div('my_models_crypto_client_div',
                                             '0',
                                             bold=False)
        crypto_client_div = MyHTML.div_embedded([
            crypto_client_label_div,
            MyHTML.span(' '), crypto_client_value_div
        ])

        stock_client_label_div = MyHTML.div('my_models_stock_client_label_div',
                                            'IKBR:',
                                            bold=True)
        stock_client_value_div = MyHTML.div('my_models_stock_client_div',
                                            '0',
                                            bold=False)
        stock_client_div = MyHTML.div_embedded(
            [stock_client_label_div,
             MyHTML.span(' '), stock_client_value_div])

        crypto_client_trades_label_div = MyHTML.div(
            'my_models_crypto_client_trades_label_div',
            'Trades (Bitfinex):',
            bold=True)
        crypto_client_trades_value_div = MyHTML.div(
            'my_models_crypto_client_trades_div', '0', bold=False)
        crypto_client_trades_div = MyHTML.div_embedded([
            crypto_client_trades_label_div,
            MyHTML.span(' '), crypto_client_trades_value_div
        ])

        stock_client_trades_label_div = MyHTML.div(
            'my_models_stock_client_trades_label_div',
            'Trades (IBKR):',
            bold=True)
        stock_client_trades_value_div = MyHTML.div(
            'my_models_stock_client_trades_div', '0', bold=False)
        stock_client_trades_div = MyHTML.div_embedded([
            stock_client_trades_label_div,
            MyHTML.span(' '), stock_client_trades_value_div
        ])

        self.set_value(
            1, 1, MyHTML.div_embedded([crypto_client_div, stock_client_div]))
        self.set_value(1, 2, MyDCC.markdown('my_models_statistics_markdown'))
        self.set_value(
            1, 3,
            MyHTML.div_embedded(
                [crypto_client_trades_div, stock_client_trades_div]))
    def _init_cells_(self):
        ticker_label_div = MyHTML.div('my_trade_ticker_label_div', 'Ticker:', True)
        ticker_div = MyHTML.div('my_trade_ticker_div', '', False)

        self.set_value(1, 1, MyHTML.div_embedded([ticker_label_div, MyHTML.span(' '), ticker_div]))
        self.set_value(1, 2, MyDCC.markdown('my_trade_markdown'))
        self.set_value(1, 3, MyDCC.markdown('my_trade_news_markdown'))
    def _init_cells_(self):
        ticker_label_div = MyHTML.div('my_recommender_position_label_div', 'Position:', True)
        ticker_div = MyHTML.div('my_recommender_position_div', '', False)

        self.set_value(1, 1, MyHTML.div_embedded([ticker_label_div, MyHTML.span(' '), ticker_div]))
        self.set_value(1, 2, MyDCC.markdown('my_recommender_markdown'))
        self.set_value(1, 3, MyDCC.markdown('my_recommender_news_markdown'))
    def _init_cells_(self):
        user_label_div = MyHTML.div('my_user_label_div', 'Username:'******'my_user_name_div', 'Josef Sertl', False)
        time_str = MyDate.get_time_from_datetime(datetime.now())

        login_label_div = MyHTML.div('my_login_label_div', 'Last login:'******'my_login_div', '{}'.format(time_str), False)

        http_connection_label_div = MyHTML.div('my_http_connection_label_div', 'Connection:', True, True)
        http_connection_div = MyHTML.div('my_http_connection_div', MyHttpClient.get_status_message(), False)

        my_user_div = MyHTML.div_embedded([user_label_div, MyHTML.span(' '), user_div])
        my_login_div = MyHTML.div_embedded([login_label_div, MyHTML.span(' '), login_time_div])
        my_http_connection_div = MyHTML.div_embedded([http_connection_label_div, MyHTML.span(' '), http_connection_div])

        dash_board_title_div = MyHTML.div('my_dashboard_title_div', 'Salesman Dashboard', inline=False)
        dash_board_sub_title_div = MyHTML.div('my_dashboard_sub_title_div', '', bold=False, color='red')

        time_label_div = MyHTML.div('my_time_label_div', 'Time:', True)
        time_value_div = MyHTML.div('my_time_div', '', False)
        time_div = MyHTML.div_embedded([time_label_div, MyHTML.span(' '), time_value_div])

        last_refresh_label_div = MyHTML.div('my_last_refresh_label_div', 'Last refresh:', True)
        last_refresh_time_div = MyHTML.div('my_last_refresh_time_div', time_str)
        last_refresh_div = MyHTML.div_embedded([last_refresh_label_div, MyHTML.span(' '), last_refresh_time_div])

        next_refresh_label_div = MyHTML.div('my_next_refresh_label_div', 'Next refresh:', True)
        next_refresh_time_div = MyHTML.div('my_next_refresh_time_div', time_str)
        next_refresh_div = MyHTML.div_embedded([next_refresh_label_div, MyHTML.span(' '), next_refresh_time_div])

        sales_label_div = MyHTML.div('my_sales_label_div', 'My Sales:', True)
        sales_active_div = MyHTML.div('my_sales_active_div', '0')
        sales_all_div = MyHTML.div('my_sales_all_div', '0')

        similar_sales_label_div = MyHTML.div('my_similar_sales_label_div', 'Similar Sales:', True)
        similar_sales_div = MyHTML.div('my_similar_sales_div', '0')

        trade_div = MyHTML.div_embedded([similar_sales_label_div, MyHTML.span(' '), similar_sales_div])

        online_div = MyHTML.div_embedded([
            sales_label_div, MyHTML.span(' '),
            sales_active_div, MyHTML.span('/'), sales_all_div], inline=True)

        self.set_value(1, 1, MyHTML.div_embedded([my_user_div, my_login_div, my_http_connection_div]))
        self.set_value(1, 2, MyHTML.div_embedded([dash_board_title_div, dash_board_sub_title_div]))
        self.set_value(1, 3, MyHTML.div_embedded([time_div, next_refresh_div, last_refresh_div]))
        self.set_value(2, 1, self.__get_timer__())
        self.set_value(2, 2, MyDCC.markdown('my_dashboard_markdown'))
        self.set_value(2, 3, MyHTML.div_embedded([online_div, trade_div]))
    def _init_cells_(self):
        chart_label_div = MyHTML.div('my_trade_statistics_chart_type_label_div', 'Chart:', True)
        chart_div = MyHTML.div('my_trade_statistics_chart_type_div', '', False)

        statistics_label_div = MyHTML.div('my_trade_statistics_label_div', 'Trades:', True)
        statistics_div = MyHTML.div('my_trade_statistics_div', '0 (+0/-0)')
        statistics_summary_div = MyHTML.div_embedded([statistics_label_div, MyHTML.span(' '), statistics_div])

        my_trades_number_label_div = MyHTML.div('my_trades_number_label_div', 'Trades (R/S):', True)
        my_trades_number_div = MyHTML.div('my_trades_number_div', '0/0 0/0')
        my_trades_number_summary_div = MyHTML.div_embedded(
            [my_trades_number_label_div, MyHTML.span(' '), my_trades_number_div])

        my_trades_mean_label_div = MyHTML.div('my_trades_mean_label_div', '...(mean %):', True)
        my_trades_mean_div = MyHTML.div('my_trades_mean_div', '0/0 0/0')
        my_trades_mean_summary_div = MyHTML.div_embedded(
            [my_trades_mean_label_div, MyHTML.span(' '), my_trades_mean_div])

        self.set_value(1, 1, MyHTML.div_embedded([chart_label_div, MyHTML.span(' '), chart_div]))
        self.set_value(1, 2, MyDCC.markdown('my_trade_statistics_markdown'))
        self.set_value(1, 3, MyHTML.div_embedded([statistics_summary_div, my_trades_number_summary_div,
                                                 my_trades_mean_summary_div]))
 def get_div_for_tab(self):
     children_list = [
         MyHTML.div_with_dcc_drop_down(
             **self._dd_handler.get_drop_down_parameters(
                 DBDD.TABLE, default_value=self._selected_table_name)),
         MyHTML.div_with_dcc_drop_down(
             **self._dd_handler.get_drop_down_parameters(DBDD.LIMIT)),
         MyHTML.div_with_dcc_drop_down(
             **self._dd_handler.get_drop_down_parameters(DBDD.DATE_RANGE)),
         MyHTML.span('', margin_left=10),
         MyHTML.div_with_input(element_id=self._my_db_where_clause_input,
                               placeholder='Please enter where clause...',
                               size=500,
                               height=27),
         MyHTML.div(element_id=self._my_db_query),
         MyHTML.div_with_table(self._data_table_div,
                               self.__get_table_for_db__()),
         MyDCC.markdown(self._my_db_entry_markdown)
     ]
     return MyHTML.div('my_db_div', children_list)
    def _init_cells_(self):
        user_label_div = MyHTML.div('my_user_label_div', 'Username:'******'my_user_name_div', 'Josef Sertl', False)
        date_str = MyDate.get_date_str_from_datetime(datetime.now())
        time_str = MyDate.get_time_from_datetime(datetime.now())
        login_label_div = MyHTML.div('my_login_label_div', 'Last login:'******'my_login_div', '{} {}'.format(date_str, time_str), False)
        sound_label_div = MyHTML.div('my_sound_label_div', 'Sound:', True, True)
        sound_div = MyHTML.div('my_sound_div', '', False)
        mode_label_div = MyHTML.div('my_mode_label_div', 'Mode:', True, True)
        mode_div = MyHTML.div('my_mode_div', '', False)
        max_buy_label_div = MyHTML.div('my_max_buy_label_div', 'Max buy value:', True, True)
        max_buy_div = MyHTML.div('my_max_buy_div', '', False)
        small_profit_label_div = MyHTML.div('my_small_profit_label_div', 'Small profit taking:', True, True)
        small_profit_div = MyHTML.div('my_small_profit_div', '', False)

        my_user_div = MyHTML.div_embedded([user_label_div, MyHTML.span(' '), user_div])
        my_login_div = MyHTML.div_embedded([login_label_div, MyHTML.span(' '), login_date_time_div])
        my_sound_div = MyHTML.div_embedded([sound_label_div, MyHTML.span(' '), sound_div])
        my_mode_div = MyHTML.div_embedded([mode_label_div, MyHTML.span(' '), mode_div])
        my_max_buy_div = MyHTML.div_embedded([max_buy_label_div, MyHTML.span(' '), max_buy_div])
        my_small_profit_div = MyHTML.div_embedded([small_profit_label_div, MyHTML.span(' '), small_profit_div])

        dash_board_title_div = MyHTML.div('my_dashboard_title_div', 'Pattern Detection Dashboard', inline=False)
        dash_board_sub_title_div = MyHTML.div('my_dashboard_sub_title_div', '', bold=False, color='red')

        time_label_div = MyHTML.div('my_time_label_div', 'Time:', True)
        time_value_div = MyHTML.div('my_time_div', '', False)
        time_div = MyHTML.div_embedded([time_label_div, MyHTML.span(' '), time_value_div])

        last_refresh_label_div = MyHTML.div('my_last_refresh_label_div', 'Last refresh:', True)
        last_refresh_time_div = MyHTML.div('my_last_refresh_time_div', time_str)
        next_refresh_label_div = MyHTML.div('my_next_refresh_label_div', 'Next refresh:', True)
        next_refresh_time_div = MyHTML.div('my_next_refresh_time_div', time_str)
        last_refresh_div = MyHTML.div_embedded([last_refresh_label_div, MyHTML.span(' '), last_refresh_time_div])
        next_refresh_div = MyHTML.div_embedded([next_refresh_label_div, MyHTML.span(' '), next_refresh_time_div])

        http_connection_label_div = MyHTML.div('my_http_connection_label_div', 'Connection:', True, True)
        http_connection_div = MyHTML.div('my_http_connection_div', MyHttpClient.get_status_message(), False)
        my_http_connection_div = MyHTML.div_embedded([http_connection_label_div, MyHTML.span(' '), http_connection_div])

        online_trade_label_div = MyHTML.div('my_online_trade_label_div', 'Trades - Online:', True)
        online_trade_active_div = MyHTML.div('my_online_trade_active_div', '0')
        online_trade_all_div = MyHTML.div('my_online_trade_all_div', '0')

        stored_trade_label_div = MyHTML.div('my_stored_trade_label_div', 'Trades - Replay:', True)
        stored_trade_div = MyHTML.div('my_stored_trade_div', '0')

        stored_pattern_label_div = MyHTML.div('my_stored_pattern_label_div', 'Pattern - Replay:', True)
        stored_pattern_div = MyHTML.div('my_stored_pattern_div', '0')

        trade_div = MyHTML.div_embedded([stored_trade_label_div, MyHTML.span(' '), stored_trade_div])
        pattern_div = MyHTML.div_embedded([stored_pattern_label_div, MyHTML.span(' '), stored_pattern_div])

        real_online_trade_label_div = MyHTML.div('my_real_online_trade_label_div', 'Trades - real:', True)
        real_online_trade_div = MyHTML.div('my_real_online_trade_div', '')
        simulation_online_trade_label_div = MyHTML.div('my_simulation_online_trade_label_div', 'Trades - simul.:', True)
        simulation_online_trade_div = MyHTML.div('my_simulation_online_trade_div', '')

        online_div = MyHTML.div_embedded([
            online_trade_label_div, MyHTML.span(' '),
            online_trade_active_div, MyHTML.span('/'), online_trade_all_div], inline=True)
        real_online_trade_div = MyHTML.div_embedded(
            [real_online_trade_label_div, MyHTML.span(' '), real_online_trade_div])
        simulation_online_trade_div = MyHTML.div_embedded(
            [simulation_online_trade_label_div, MyHTML.span(' '), simulation_online_trade_div])

        self.set_value(1, 1, MyHTML.div_embedded([my_user_div, my_login_div, my_sound_div,
                                                  my_mode_div, my_max_buy_div, my_small_profit_div]))
        self.set_value(1, 2, MyHTML.div_embedded([dash_board_title_div, dash_board_sub_title_div]))
        self.set_value(1, 3, MyHTML.div_embedded([time_div, next_refresh_div, last_refresh_div, my_http_connection_div]))
        self.set_value(2, 1, MyDCC.markdown('my_position_markdown'))
        self.set_value(2, 2, MyDCC.markdown('my_dashboard_markdown'))
        self.set_value(2, 3, MyHTML.div_embedded(
            [online_div, trade_div, pattern_div, real_online_trade_div, simulation_online_trade_div]))