Пример #1
0
 def updateButtonClicked(self):
     QA_SU_save_index_day('tdx')
     QA_SU_save_index_list('tdx')
     QA_SU_save_stock_block('tdx')
     QA_SU_save_stock_day('tdx')
     QA_SU_save_stock_info('tdx')
     QA_SU_save_stock_list('tdx')
     QA_SU_save_stock_xdxr('tdx')
Пример #2
0
def info_update(update_list):
    remove_list = []
    for update in update_list:
        if update == 'stock_info':
            QA_SU_save_stock_info('tdx')
            remove_list.append(update)
        elif update == 'stock_xdxr':
            QA_SU_save_stock_xdxr('tdx')
            remove_list.append(update)
        elif update == 'stock_block':
            QA_SU_save_stock_block('tdx')
            remove_list.append(update)
        elif update == 'save_financialfiles':
            QA_SU_save_financialfiles()
            remove_list.append(update)
    return update_list, remove_list
Пример #3
0
 def save_X_func():
     """
     QUANTAXIS的save X,建议每天下午四~五点收盘后执行
     """
     QA_SU_save_stock_day('tdx')
     QA_SU_save_stock_xdxr('tdx')
     QA_SU_save_stock_min('tdx')
     QA_SU_save_index_day('tdx')
     QA_SU_save_index_min('tdx')
     QA_SU_save_etf_list('tdx')
     QA_SU_save_etf_day('tdx')
     QA_SU_save_etf_min('tdx')
     QA_SU_save_stock_list('tdx')
     QA_SU_save_index_list('tdx')
     QA_SU_save_stock_block('tdx')
     QA_SU_save_future_list('tdx')
     pass
Пример #4
0
# SOFTWARE.
"""对应于save all"""

from QUANTAXIS.QASU.main import (
    QA_SU_save_etf_day, QA_SU_save_etf_min, QA_SU_save_financialfiles,
    QA_SU_save_index_day, QA_SU_save_index_min, QA_SU_save_stock_block,
    QA_SU_save_stock_day, QA_SU_save_stock_info, QA_SU_save_stock_info_tushare,
    QA_SU_save_stock_list, QA_SU_save_stock_min, QA_SU_save_stock_xdxr)
from QUANTAXIS.QASU.save_binance import (QA_SU_save_binance_symbol,
                                         QA_SU_save_binance_1hour,
                                         QA_SU_save_binance_1day,
                                         QA_SU_save_binance_1min,
                                         QA_SU_save_binance)
from QUANTAXIS.QASU.save_bitmex import (QA_SU_save_bitmex_symbol,
                                        QA_SU_save_bitmex_day)
from QUANTAXIS.QASU.save_huobi import (QA_SU_save_huobi_symbol,
                                       QA_SU_save_huobi_1hour,
                                       QA_SU_save_huobi_1day,
                                       QA_SU_save_huobi_1min, QA_SU_save_huobi)

QA_SU_save_stock_day('tdx')
QA_SU_save_stock_xdxr('tdx')
# QA_SU_save_stock_min('tdx')
QA_SU_save_index_day('tdx')
# QA_SU_save_index_min('tdx')
# QA_SU_save_etf_day('tdx')
# QA_SU_save_etf_min('tdx')
QA_SU_save_stock_list('tdx')
QA_SU_save_stock_block('tdx')
# QA_SU_save_stock_info('tdx')
Пример #5
0
 def do_save(self, arg):
     # 仅仅是为了初始化才在这里插入用户,如果想要注册用户,要到webkit底下注册
     if arg == '':
         print("Usage: \n\
             save all  : save stock_day/xdxr/ index_day/ stock_list \n\
             save X|x  : save stock_day/xdxr/min index_day/min etf_day/min stock_list/block \n\
             save day  : save stock_day/xdxr index_day etf_day stock_list \n\
             save min  : save stock_min/xdxr index_min etf_min stock_list \n\
             ------------------------------------------------------------ \n\
             save stock_day  : save stock_day \n\
             save stock_xdxr : save stock_xdxr \n\
             save stock_min  : save stock_min \n\
             save index_day  : save index_day \n\
             save index_min  : save index_min \n\
             save etf_day    : save etf_day \n\
             save etf_min    : save etf_min \n\
             save stock_list : save stock_list \n\
             save stock_block: save stock_block \n\
             save stock_info : save stock_info \n\
             ----------------------------------------------------------\n\
             if you just want to save daily data just\n\
                 save all+ save stock_block+save stock_info, it about 1G data \n\
             if you want to save save the fully data including min level \n\
                 save x + save stock_info \n \n\
             @yutiansut\n\
             @QUANTAXIS\n\
             ")
     else:
         arg = arg.split(' ')
         if len(arg) == 1 and arg[0] == 'all':
             if QA_Setting().client.quantaxis.user_list.find({
                     'username':
                     '******'
             }).count() == 0:
                 QA_Setting().client.quantaxis.user_list.insert({
                     'username':
                     '******',
                     'password':
                     '******'
                 })
             QA_SU_save_stock_day('tdx')
             QA_SU_save_stock_xdxr('tdx')
             # QA_SU_save_stock_min('tdx')
             QA_SU_save_index_day('tdx')
             # QA_SU_save_index_min('tdx')
             # QA_SU_save_etf_day('tdx')
             # QA_SU_save_etf_min('tdx')
             QA_SU_save_stock_list('tdx')
             # QA_SU_save_stock_block('tdx')
             # QA_SU_save_stock_info('tdx')
         elif len(arg) == 1 and arg[0] == 'day':
             if QA_Setting().client.quantaxis.user_list.find({
                     'username':
                     '******'
             }).count() == 0:
                 QA_Setting().client.quantaxis.user_list.insert({
                     'username':
                     '******',
                     'password':
                     '******'
                 })
             QA_SU_save_stock_day('tdx')
             QA_SU_save_stock_xdxr('tdx')
             # QA_SU_save_stock_min('tdx')
             QA_SU_save_index_day('tdx')
             # QA_SU_save_index_min('tdx')
             QA_SU_save_etf_day('tdx')
             # QA_SU_save_etf_min('tdx')
             QA_SU_save_stock_list('tdx')
             QA_SU_save_stock_block('tdx')
         elif len(arg) == 1 and arg[0] == 'min':
             if QA_Setting().client.quantaxis.user_list.find({
                     'username':
                     '******'
             }).count() == 0:
                 QA_Setting().client.quantaxis.user_list.insert({
                     'username':
                     '******',
                     'password':
                     '******'
                 })
             # QA_SU_save_stock_day('tdx')
             QA_SU_save_stock_xdxr('tdx')
             QA_SU_save_stock_min('tdx')
             # QA_SU_save_index_day('tdx')
             QA_SU_save_index_min('tdx')
             # QA_SU_save_etf_day('tdx')
             QA_SU_save_etf_min('tdx')
             QA_SU_save_stock_list('tdx')
             # QA_SU_save_stock_block('tdx')
         elif len(arg) == 1 and arg[0] in ['X', 'x']:
             if QA_Setting().client.quantaxis.user_list.find({
                     'username':
                     '******'
             }).count() == 0:
                 QA_Setting().client.quantaxis.user_list.insert({
                     'username':
                     '******',
                     'password':
                     '******'
                 })
             QA_SU_save_stock_day('tdx')
             QA_SU_save_stock_xdxr('tdx')
             QA_SU_save_stock_min('tdx')
             QA_SU_save_index_day('tdx')
             QA_SU_save_index_min('tdx')
             QA_SU_save_etf_day('tdx')
             QA_SU_save_etf_min('tdx')
             QA_SU_save_stock_list('tdx')
             QA_SU_save_stock_block('tdx')
             # QA_SU_save_stock_info('tdx')
         else:
             for i in arg:
                 if i == 'insert_user':
                     if QA_Setting().client.quantaxis.user_list.find({
                             'username':
                             '******'
                     }).count() == 0:
                         QA_Setting().client.quantaxis.user_list.insert({
                             'username':
                             '******',
                             'password':
                             '******'
                         })
                 else:
                     eval("QA_SU_save_%s('tdx')" % (i))
Пример #6
0
    def do_save(self, arg):
        # 仅仅是为了初始化才在这里插入用户,如果想要注册用户,要到webkit底下注册
        if arg == '':
            self.print_save_usage()
        else:
            arg = arg.split(' ')

            if len(arg) == 1 and arg[0] == 'all':
                if QA_Setting().client.quantaxis.user_list.find(
                    {'username': '******'}).count() == 0:
                    QA_Setting().client.quantaxis.user_list.insert(
                        {
                            'username': '******',
                            'password': '******'
                        }
                    )
                # TODO: 将ts还是tdx作为命令传入
                # QA_SU_save_stock_day('ts')
                QA_SU_save_stock_day('tdx')
                QA_SU_save_stock_xdxr('tdx')
                # QA_SU_save_stock_min('tdx')
                QA_SU_save_index_day('tdx')
                # QA_SU_save_index_min('tdx')
                QA_SU_save_etf_list('tdx')
                # QA_SU_save_etf_day('tdx')
                # QA_SU_save_etf_min('tdx')
                QA_SU_save_index_list('tdx')
                QA_SU_save_stock_list('tdx')
                QA_SU_save_stock_block('tdx')
                # QA_SU_save_stock_info('tdx')
                # QA_SU_save_report_calendar_his()
                # QA_SU_save_stock_divyield_his()

            elif len(arg) == 1 and arg[0] == 'day':
                if QA_Setting().client.quantaxis.user_list.find(
                    {'username': '******'}).count() == 0:
                    QA_Setting().client.quantaxis.user_list.insert(
                        {
                            'username': '******',
                            'password': '******'
                        }
                    )
                QA_SU_save_stock_day('tdx')
                QA_SU_save_stock_xdxr('tdx')
                # QA_SU_save_stock_min('tdx')
                QA_SU_save_index_day('tdx')
                # QA_SU_save_index_min('tdx')
                QA_SU_save_etf_list('tdx')
                QA_SU_save_etf_day('tdx')
                # QA_SU_save_etf_min('tdx')
                QA_SU_save_index_list('tdx')
                QA_SU_save_stock_list('tdx')
                QA_SU_save_stock_block('tdx')
                # QA_SU_save_stock_divyield_day()
                # QA_SU_save_report_calendar_day()

            elif len(arg) == 1 and arg[0] == 'min':
                if QA_Setting().client.quantaxis.user_list.find(
                    {'username': '******'}).count() == 0:
                    QA_Setting().client.quantaxis.user_list.insert(
                        {
                            'username': '******',
                            'password': '******'
                        }
                    )
                # QA_SU_save_stock_day('tdx')
                QA_SU_save_stock_xdxr('tdx')
                QA_SU_save_stock_min('tdx')
                # QA_SU_save_index_day('tdx')
                QA_SU_save_index_min('tdx')
                QA_SU_save_etf_list('tdx')
                # QA_SU_save_etf_day('tdx')
                QA_SU_save_etf_min('tdx')
                QA_SU_save_stock_list('tdx')
                QA_SU_save_index_list('tdx')
                # QA_SU_save_stock_block('tdx')
            elif len(arg) == 1 and arg[0] == 'transaction':
                if QA_Setting().client.quantaxis.user_list.find(
                    {'username': '******'}).count() == 0:
                    QA_Setting().client.quantaxis.user_list.insert(
                        {
                            'username': '******',
                            'password': '******'
                        }
                    )
                QA_SU_save_index_transaction('tdx')
                QA_SU_save_stock_transaction('tdx')
                # QA_SU_save_stock_day('tdx')
                # QA_SU_save_stock_xdxr('tdx')
                # QA_SU_save_stock_min('tdx')
                # QA_SU_save_index_day('tdx')
                # QA_SU_save_index_min('tdx')
                # QA_SU_save_etf_list('tdx')
                # QA_SU_save_etf_day('tdx')
                # QA_SU_save_etf_min('tdx')
                # QA_SU_save_stock_list('tdx')
                # QA_SU_save_index_list('tdx')
                # QA_SU_save_stock_block('tdx')

            elif len(arg) == 1 and arg[0] in ['X', 'x']:
                if QA_Setting().client.quantaxis.user_list.find(
                    {'username': '******'}).count() == 0:
                    QA_Setting().client.quantaxis.user_list.insert(
                        {
                            'username': '******',
                            'password': '******'
                        }
                    )
                QA_SU_save_stock_day('tdx')
                QA_SU_save_stock_xdxr('tdx')
                QA_SU_save_stock_min('tdx')
                QA_SU_save_index_day('tdx')
                QA_SU_save_index_min('tdx')
                QA_SU_save_etf_list('tdx')
                QA_SU_save_etf_day('tdx')
                QA_SU_save_etf_min('tdx')
                QA_SU_save_stock_list('tdx')
                QA_SU_save_index_list('tdx')
                QA_SU_save_stock_block('tdx')
                QA_SU_save_future_list('tdx')
                # QA_SU_save_stock_info('tdx')
            elif len(arg) == 1 and arg[0] == "binance":
                QA_SU_save_binance_symbol()
                QA_SU_save_binance_1day()
                QA_SU_save_binance_1hour()
                QA_SU_save_binance_1min()
            elif len(arg) == 2 and arg[0] == "binance":
                if (arg[1] == 'all'):
                    QA_SU_save_binance_symbol()
                    QA_SU_save_binance_1day()
                    QA_SU_save_binance_1hour()
                    QA_SU_save_binance('30m')
                    QA_SU_save_binance('15m')
                    QA_SU_save_binance('5m')
                    QA_SU_save_binance_1min()
                else:
                    frequency = arg[1]
                    QA_SU_save_binance(frequency)
            elif len(arg) == 1 and arg[0] == "bitfinex":
                QA_SU_save_bitfinex_symbol()
                QA_SU_save_bitfinex_1day()
                QA_SU_save_bitfinex_1hour()
                QA_SU_save_bitfinex_1min()
            elif len(arg) == 2 and arg[0] == "bitfinex":
                if (arg[1] == 'all'):
                    QA_SU_save_bitfinex_symbol()
                    QA_SU_save_bitfinex_1day()
                    QA_SU_save_bitfinex_1hour()
                    QA_SU_save_bitfinex('30m')
                    QA_SU_save_bitfinex('15m')
                    QA_SU_save_bitfinex('5m')
                    QA_SU_save_bitfinex_1min()
                else:
                    frequency = arg[1]
                    QA_SU_save_bitfinex(frequency)
            elif len(arg) == 1 and arg[0] == "bitmex":
                QA_SU_save_bitmex_symbol()
                QA_SU_save_bitmex('1d')
                QA_SU_save_bitmex('1h')
                QA_SU_save_bitmex('1m')
            elif len(arg) == 1 and arg[0] == "huobi":
                QA_SU_save_huobi_symbol()
                QA_SU_save_huobi_1day()
                QA_SU_save_huobi_1hour()
                QA_SU_save_huobi_1min()
            elif len(arg) == 2 and arg[0] == "huobi":
                if (arg[1] == 'realtime'):
                    QA_SU_save_huobi_realtime()
                elif (arg[1] == 'all'):
                    QA_SU_save_huobi_symbol()
                    QA_SU_save_huobi_1day()
                    QA_SU_save_huobi_1hour()
                    QA_SU_save_huobi('30min')
                    QA_SU_save_huobi('15min')
                    QA_SU_save_huobi('5min')
                    QA_SU_save_huobi_1min()
                else:
                    frequency = arg[1]
                    QA_SU_save_huobi(frequency)
            elif len(arg) == 1 and arg[0] == "okex":
                QA_SU_save_okex_symbol()
                QA_SU_save_okex_1day()
                QA_SU_save_okex_1hour()
                QA_SU_save_okex_1min()
            elif len(arg) == 2 and arg[0] == "okex":
                if (arg[1] == 'all'):
                    QA_SU_save_okex_symbol()
                    QA_SU_save_okex_1day()
                    QA_SU_save_okex_1hour()
                    QA_SU_save_okex('1800')
                    QA_SU_save_okex('900')
                    QA_SU_save_okex('300')
                    QA_SU_save_okex_1min()
                else:
                    frequency = arg[1]
                    QA_SU_save_okex(frequency)
            elif len(arg) == 1 and arg[0] == "financialfiles":
                QA_SU_save_financialfiles()

            elif len(arg) == 1 and arg[0] == "future":
                QA_SU_save_future_day('tdx')
                QA_SU_save_future_min('tdx')
                QA_SU_save_future_list('tdx')

            elif len(arg) == 1 and arg[0] == "future_all":
                QA_SU_save_future_day_all('tdx')
                QA_SU_save_future_min_all('tdx')
                QA_SU_save_future_list('tdx')

            elif len(arg) == 1 and arg[0] == '50etf_option_day':
                QA_SU_save_option_50etf_day('tdx')

            elif len(arg) == 1 and arg[0] == '50etf_option_min':
                QA_SU_save_option_50etf_min('tdx')

            elif len(arg) == 1 and arg[0] == '300etf_option_day':
                QA_SU_save_option_300etf_day('tdx')

            elif len(arg) == 1 and arg[0] == '300etf_option_min':
                QA_SU_save_option_300etf_min('tdx')

            elif len(arg) == 1 and arg[0] == 'option_commodity_day':
                QA_SU_save_option_commodity_day('tdx')
            elif len(arg) == 1 and arg[0] == 'option_commodity_min':
                QA_SU_save_option_commodity_min('tdx')
            elif len(arg) == 1 and arg[0] in ['ox', 'OX', 'oX', 'Ox']:
                QA_SU_save_option_contract_list('tdx')
                QA_SU_save_option_50etf_day('tdx')
                QA_SU_save_option_50etf_min('tdx')
                QA_SU_save_option_300etf_day('tdx')
                QA_SU_save_option_300etf_min('tdx')
                QA_SU_save_option_commodity_day('tdx')
                QA_SU_save_option_commodity_min('tdx')
            elif len(arg) == 2 and arg[0] == 'single_stock_day':
                QA_SU_save_single_stock_day(arg[1], 'tdx')
            elif len(arg) == 2 and arg[0] == 'single_index_day':
                QA_SU_save_single_index_day(arg[1], 'tdx')
            elif len(arg) == 2 and arg[0] == 'single_etf_day':
                QA_SU_save_single_etf_day(arg[1], 'tdx')
            elif len(arg) == 2 and arg[0] == 'single_stock_min':
                QA_SU_save_single_stock_min(arg[1], 'tdx')
            elif len(arg) == 2 and arg[0] == 'single_index_min':
                QA_SU_save_single_index_min(arg[1], 'tdx')
            elif len(arg) == 2 and arg[0] == 'single_etf_min':
                QA_SU_save_single_etf_min(arg[1], 'tdx')
            elif len(arg) == 2 and arg[0] == 'single_bond_day':
                QA_SU_save_single_bond_day(arg[1], 'tdx')
            elif len(arg) == 2 and arg[0] == 'single_bond_min':
                QA_SU_save_single_bond_min(arg[1], 'tdx')
            else:
                for i in arg:
                    if i == 'insert_user':
                        if QA_Setting().client.quantaxis.user_list.find(
                            {'username': '******'}).count() == 0:
                            QA_Setting().client.quantaxis.user_list.insert(
                                {
                                    'username': '******',
                                    'password': '******'
                                }
                            )
                    else:
                        try:
                            eval("QA_SU_save_%s('tdx')" % (i))
                        except:
                            print("❌命令格式不正确!")
                            self.print_save_usage()
Пример #7
0
def sub_l1_from_sina():
    """
    从新浪获取L1数据,3秒更新一次,建议mongodb数据库存放在企业级SSD上面
    (我用Intel DC P3600 800GB SSD,锐龙 3900X,每个tick 保存时间 < 0.6s)
    """
    def collections_of_today():
        database = DATABASE.get_collection('realtime_{}'.format(datetime.date.today()))
        database.create_index([('code', QA_util_sql_mongo_sort_ASCENDING)])
        database.create_index([('datetime', QA_util_sql_mongo_sort_ASCENDING)])
        database.create_index(
            [
                ("code",
                    QA_util_sql_mongo_sort_ASCENDING),
                ("datetime",
                    QA_util_sql_mongo_sort_ASCENDING)
            ],
            #unique=True,
        )
        return database

    def save_X_func():
        """
        QUANTAXIS的save X,建议每天下午四~五点收盘后执行
        """

        pass

    quotation = easyquotation.use('sina') # 新浪 ['sina'] 腾讯 ['tencent', 'qq']

    sleep_time = 2.0
    sleep = int(sleep_time)
    _time1 = datetime.datetime.now()
    database = collections_of_today()
    get_once = True
    # 开盘/收盘时间
    end_time = datetime.datetime.strptime(str(datetime.datetime.now().date())+' 16:30', '%Y-%m-%d %H:%M')
    start_time = datetime.datetime.strptime(str(datetime.datetime.now().date()) + ' 09:15', '%Y-%m-%d %H:%M')
    day_changed_time = datetime.datetime.strptime(str(datetime.datetime.now().date()) + ' 01:00', '%Y-%m-%d %H:%M')
    while (datetime.datetime.now() < end_time):
        # 开盘/收盘时间
        end_time = datetime.datetime.strptime(str(datetime.datetime.now().date()) + ' 16:30', '%Y-%m-%d %H:%M')
        start_time = datetime.datetime.strptime(str(datetime.datetime.now().date()) + ' 09:15', '%Y-%m-%d %H:%M')
        day_changed_time = datetime.datetime.strptime(str(datetime.datetime.now().date()) + ' 01:00', '%Y-%m-%d %H:%M')
        _time = datetime.datetime.now()

        if (datetime.datetime.now() < day_changed_time):
            # 日期变更,写入表也会相应变更,这是为了防止用户永不退出一直执行
            print(u'当前日期更新~! {} '.format(datetime.date.today()))
            database = collections_of_today()

        if QA_util_if_tradetime(_time) or \
            (get_once):  # 如果在交易时间
            l1_ticks = quotation.market_snapshot(prefix=False)
            l1_ticks_data = formater_l1_ticks(l1_ticks)

            if (datetime.datetime.now() < start_time):
                print(u'Not Trading time 现在是中国A股收盘时间 {}'.format(_time))
                timer.sleep(sleep)
                continue

            # 查询是否新 tick
            query_id = {
                "code": [l1_tick['code'] for l1_tick in l1_ticks_data],
                "datetime": {
                    '$in': [l1_tick['datetime'] for l1_tick in l1_ticks_data]
                }
            }
            refcount = database.count_documents(query_id)
            if refcount > 0:
                if (len(l1_ticks_data) > 1):
                    # 删掉重复数据
                    database.delete_many(query_id)
                    database.insert_many(l1_ticks_data)
                else:
                    # 持续更新模式,更新单条记录
                    database.replace_one(query_id, l1_ticks_data[0])
            else:
                # 新 tick,插入记录
                database.insert_many(l1_ticks_data)
            if (get_once != True):
                print(u'Trading time now 现在是中国A股交易时间 {}\nProcessing ticks data cost:{:.3f}s'.format(datetime.datetime.now(),
                    (datetime.datetime.now() - _time).total_seconds()))
            timer.sleep(sleep)
            print('Program Last Time {:.3f}s'.format(
                (datetime.datetime.now() - _time1).total_seconds()))
            get_once = False
        else:
            print(u'Not Trading time 现在是中国A股收盘时间 {}'.format(_time))
            timer.sleep(sleep)

    # 每天下午5点,代码就会执行到这里,如有必要,再次执行收盘行情下载,也就是 QUANTAXIS/save X
    save_time = datetime.datetime.strptime(str(datetime.datetime.now().date()) + ' 17:00', '%Y-%m-%d %H:%M')
    if (datetime.datetime.now() > end_time) and \
        (datetime.datetime.now() < save_time):
        # 收盘时间 下午16:00到17:00 更新收盘数据
        QA_SU_save_stock_day('tdx')
        QA_SU_save_stock_xdxr('tdx')
        QA_SU_save_stock_min('tdx')
        QA_SU_save_index_day('tdx')
        QA_SU_save_index_min('tdx')
        QA_SU_save_etf_list('tdx')
        QA_SU_save_etf_day('tdx')
        QA_SU_save_etf_min('tdx')
        QA_SU_save_stock_list('tdx')
        QA_SU_save_index_list('tdx')
        QA_SU_save_stock_block('tdx')
        QA_SU_save_future_list('tdx')

    # While循环每天下午5点自动结束,在此等待13小时,大概早上六点结束程序自动重启
    print(u'While循环每天下午5点自动结束,在此等待13小时,大概早上六点结束程序自动重启,这样只要窗口不关,永远每天自动收取 tick')
    timer.sleep(30000)
Пример #8
0
    def do_save(self, arg):
        # 仅仅是为了初始化才在这里插入用户,如果想要注册用户,要到webkit底下注册
        if arg == "":
            self.print_save_usage()
        else:
            arg = arg.split(" ")

            if len(arg) == 1 and arg[0] == "all":
                if (QA_Setting().client.quantaxis.user_list.find({
                        "username":
                        "******"
                }).count() == 0):
                    QA_Setting().client.quantaxis.user_list.insert({
                        "username":
                        "******",
                        "password":
                        "******"
                    })
                # TODO: 将ts还是tdx作为命令传入
                # QA_SU_save_stock_day('ts')
                QA_SU_save_stock_day("tdx")
                QA_SU_save_stock_xdxr("tdx")
                # QA_SU_save_stock_min('tdx')
                QA_SU_save_index_day("tdx")
                # QA_SU_save_index_min('tdx')
                QA_SU_save_etf_list("tdx")
                QA_SU_save_etf_day('tdx')
                QA_SU_save_etf_xdxr("tdx")
                # QA_SU_save_etf_min('tdx')
                QA_SU_save_index_list("tdx")
                QA_SU_save_stock_list("tdx")
                QA_SU_save_stock_block("tdx")
                # QA_SU_save_stock_info('tdx')
                # QA_SU_save_report_calendar_his()
                # QA_SU_save_stock_divyield_his()

            elif len(arg) == 1 and arg[0] == "day":
                if (QA_Setting().client.quantaxis.user_list.find({
                        "username":
                        "******"
                }).count() == 0):
                    QA_Setting().client.quantaxis.user_list.insert({
                        "username":
                        "******",
                        "password":
                        "******"
                    })
                QA_SU_save_stock_day("tdx")
                QA_SU_save_stock_xdxr("tdx")
                # QA_SU_save_stock_min('tdx')
                QA_SU_save_index_day("tdx")
                # QA_SU_save_index_min('tdx')
                QA_SU_save_etf_list("tdx")
                QA_SU_save_etf_day("tdx")
                QA_SU_save_etf_xdxr("tdx")
                # QA_SU_save_etf_min('tdx')
                QA_SU_save_index_list("tdx")
                QA_SU_save_stock_list("tdx")
                QA_SU_save_stock_block("tdx")
                # QA_SU_save_stock_divyield_day()
                # QA_SU_save_report_calendar_day()

            elif len(arg) == 1 and arg[0] == "min":
                if (QA_Setting().client.quantaxis.user_list.find({
                        "username":
                        "******"
                }).count() == 0):
                    QA_Setting().client.quantaxis.user_list.insert({
                        "username":
                        "******",
                        "password":
                        "******"
                    })
                # QA_SU_save_stock_day('tdx')
                QA_SU_save_stock_xdxr("tdx")
                QA_SU_save_stock_min("tdx")
                # QA_SU_save_index_day('tdx')
                QA_SU_save_index_min("tdx")
                QA_SU_save_etf_list("tdx")
                # QA_SU_save_etf_day('tdx')
                QA_SU_save_etf_min("tdx")
                QA_SU_save_etf_xdxr("tdx")
                QA_SU_save_stock_list("tdx")
                QA_SU_save_index_list("tdx")
                # QA_SU_save_stock_block('tdx')
            elif len(arg) == 1 and arg[0] == "transaction":
                if (QA_Setting().client.quantaxis.user_list.find({
                        "username":
                        "******"
                }).count() == 0):
                    QA_Setting().client.quantaxis.user_list.insert({
                        "username":
                        "******",
                        "password":
                        "******"
                    })
                QA_SU_save_index_transaction("tdx")
                QA_SU_save_stock_transaction("tdx")
                # QA_SU_save_stock_day('tdx')
                # QA_SU_save_stock_xdxr('tdx')
                # QA_SU_save_stock_min('tdx')
                # QA_SU_save_index_day('tdx')
                # QA_SU_save_index_min('tdx')
                # QA_SU_save_etf_list('tdx')
                # QA_SU_save_etf_day('tdx')
                # QA_SU_save_etf_min('tdx')
                # QA_SU_save_stock_list('tdx')
                # QA_SU_save_index_list('tdx')
                # QA_SU_save_stock_block('tdx')

            elif len(arg) == 1 and arg[0] in ["X", "x"]:
                if (QA_Setting().client.quantaxis.user_list.find({
                        "username":
                        "******"
                }).count() == 0):
                    QA_Setting().client.quantaxis.user_list.insert({
                        "username":
                        "******",
                        "password":
                        "******"
                    })
                QA_SU_save_stock_day("tdx")
                QA_SU_save_stock_xdxr("tdx")
                QA_SU_save_stock_min("tdx")
                QA_SU_save_index_day("tdx")
                QA_SU_save_index_min("tdx")
                QA_SU_save_etf_list("tdx")
                QA_SU_save_etf_day("tdx")
                QA_SU_save_etf_min("tdx")
                QA_SU_save_etf_xdxr("tdx")
                QA_SU_save_stock_list("tdx")
                QA_SU_save_index_list("tdx")
                QA_SU_save_stock_block("tdx")
                QA_SU_save_future_list("tdx")
                # QA_SU_save_stock_info('tdx')
            elif len(arg) == 1 and arg[0] == "ts_all":
                if (QA_Setting().client.quantaxis.user_list.find({
                        "username":
                        "******"
                }).count() == 0):
                    QA_Setting().client.quantaxis.user_list.insert({
                        "username":
                        "******",
                        "password":
                        "******"
                    })
                QA_ts_update_inc()
                QA_ts_update_stock_basic()
                QA_ts_update_namechange()
                QA_ts_update_industry()
                QA_ts_update_daily_basic()
            elif len(arg) == 1 and arg[0] == "ts_financial":
                if (QA_Setting().client.quantaxis.user_list.find({
                        "username":
                        "******"
                }).count() == 0):
                    QA_Setting().client.quantaxis.user_list.insert({
                        "username":
                        "******",
                        "password":
                        "******"
                    })
                QA_ts_update_inc()
            elif len(arg) == 1 and arg[0] == "ts_stock_basic":
                if (QA_Setting().client.quantaxis.user_list.find({
                        "username":
                        "******"
                }).count() == 0):
                    QA_Setting().client.quantaxis.user_list.insert({
                        "username":
                        "******",
                        "password":
                        "******"
                    })
                QA_ts_update_stock_basic()
            elif len(arg) == 1 and arg[0] == "ts_industry":
                if (QA_Setting().client.quantaxis.user_list.find({
                        "username":
                        "******"
                }).count() == 0):
                    QA_Setting().client.quantaxis.user_list.insert({
                        "username":
                        "******",
                        "password":
                        "******"
                    })
                QA_ts_update_industry()
            elif len(arg) == 1 and arg[0] == "ts_daily":
                if (QA_Setting().client.quantaxis.user_list.find({
                        "username":
                        "******"
                }).count() == 0):
                    QA_Setting().client.quantaxis.user_list.insert({
                        "username":
                        "******",
                        "password":
                        "******"
                    })
                QA_ts_update_daily_basic()
            elif len(arg) == 1 and arg[0] == "ts_namechange":
                if (QA_Setting().client.quantaxis.user_list.find({
                        "username":
                        "******"
                }).count() == 0):
                    QA_Setting().client.quantaxis.user_list.insert({
                        "username":
                        "******",
                        "password":
                        "******"
                    })
                QA_ts_update_namechange()
            elif len(arg) == 1 and arg[0] == 'ts_stock_day':
                QA_SU_save_stock_day('ts')
            elif len(arg) == 1 and arg[0] == 'ts_index_basic':
                QA_SU_save_index_basic('ts')
            elif len(arg) == 1 and arg[0] == 'ts_index_weight':
                QA_SU_save_index_weight('ts')
            elif len(arg) == 1 and arg[0] == "binance":
                QA_SU_save_binance_symbol()
                QA_SU_save_binance_1day()
                QA_SU_save_binance_1hour()
                QA_SU_save_binance_1min()
            elif len(arg) == 2 and arg[0] == "binance":
                if arg[1] == "all":
                    QA_SU_save_binance_symbol()
                    QA_SU_save_binance_1day()
                    QA_SU_save_binance_1hour()
                    QA_SU_save_binance("30m")
                    QA_SU_save_binance("15m")
                    QA_SU_save_binance("5m")
                    QA_SU_save_binance_1min()
                else:
                    frequency = arg[1]
                    QA_SU_save_binance(frequency)
            elif len(arg) == 1 and arg[0] == "bitfinex":
                QA_SU_save_bitfinex_symbol()
                QA_SU_save_bitfinex_1day()
                QA_SU_save_bitfinex_1hour()
                QA_SU_save_bitfinex_1min()
            elif len(arg) == 2 and arg[0] == "bitfinex":
                if arg[1] == "all":
                    QA_SU_save_bitfinex_symbol()
                    QA_SU_save_bitfinex_1day()
                    QA_SU_save_bitfinex_1hour()
                    QA_SU_save_bitfinex("30m")
                    QA_SU_save_bitfinex("15m")
                    QA_SU_save_bitfinex("5m")
                    QA_SU_save_bitfinex_1min()
                else:
                    frequency = arg[1]
                    QA_SU_save_bitfinex(frequency)
            elif len(arg) == 1 and arg[0] == "bitmex":
                QA_SU_save_bitmex_symbol()
                QA_SU_save_bitmex("1d")
                QA_SU_save_bitmex("1h")
                QA_SU_save_bitmex("1m")
            elif len(arg) == 1 and arg[0] == "huobi":
                QA_SU_save_huobi_symbol()
                QA_SU_save_huobi_1day()
                QA_SU_save_huobi_1hour()
                QA_SU_save_huobi_1min()
            elif len(arg) == 2 and arg[0] == "huobi":
                if arg[1] == "realtime":
                    QA_SU_save_huobi_realtime()
                elif arg[1] == "all":
                    QA_SU_save_huobi_symbol()
                    QA_SU_save_huobi_1day()
                    QA_SU_save_huobi_1hour()
                    QA_SU_save_huobi("30min")
                    QA_SU_save_huobi("15min")
                    QA_SU_save_huobi("5min")
                    QA_SU_save_huobi_1min()
                else:
                    frequency = arg[1]
                    QA_SU_save_huobi(frequency)
            elif len(arg) == 1 and arg[0] == "okex":
                QA_SU_save_okex_symbol()
                QA_SU_save_okex_1day()
                QA_SU_save_okex_1hour()
                QA_SU_save_okex_1min()
            elif len(arg) == 2 and arg[0] == "okex":
                if arg[1] == "all":
                    QA_SU_save_okex_symbol()
                    QA_SU_save_okex_1day()
                    QA_SU_save_okex_1hour()
                    QA_SU_save_okex("1800")
                    QA_SU_save_okex("900")
                    QA_SU_save_okex("300")
                    QA_SU_save_okex_1min()
                else:
                    frequency = arg[1]
                    QA_SU_save_okex(frequency)
            elif len(arg) == 1 and arg[0] == "financialfiles":
                QA_SU_save_financialfiles()

            elif len(arg) == 1 and arg[0] == "future":
                QA_SU_save_future_day("tdx")
                QA_SU_save_future_min("tdx")
                QA_SU_save_future_list("tdx")

            elif len(arg) == 1 and arg[0] == "future_all":
                QA_SU_save_future_day_all("tdx")
                QA_SU_save_future_min_all("tdx")
                QA_SU_save_future_list("tdx")

            elif len(arg) == 1 and arg[0] == "50etf_option_day":
                QA_SU_save_option_50etf_day("tdx")

            elif len(arg) == 1 and arg[0] == "50etf_option_min":
                QA_SU_save_option_50etf_min("tdx")

            elif len(arg) == 1 and arg[0] == "300etf_option_day":
                QA_SU_save_option_300etf_day("tdx")

            elif len(arg) == 1 and arg[0] == "300etf_option_min":
                QA_SU_save_option_300etf_min("tdx")

            elif len(arg) == 1 and arg[0] == "option_commodity_day":
                QA_SU_save_option_commodity_day("tdx")
            elif len(arg) == 1 and arg[0] == "option_commodity_min":
                QA_SU_save_option_commodity_min("tdx")

            elif len(arg) == 1 and arg[0] in ["option"]:
                QA_SU_save_option_contract_list("tdx")
                QA_SU_save_option_day_all("tdx")
                QA_SU_save_option_min_all("tdx")

            elif len(arg) == 1 and arg[0] in ["option_contract_list"]:
                QA_SU_save_option_contract_list("tdx")

            elif len(arg) == 1 and arg[0] in ["option_day_all"]:
                QA_SU_save_option_day_all("tdx")
            elif len(arg) == 1 and arg[0] in ["option_min_all"]:
                QA_SU_save_option_min_all("tdx")
            elif len(arg) == 2 and arg[0] == "single_stock_day":
                QA_SU_save_single_stock_day(arg[1], "tdx")
            elif len(arg) == 2 and arg[0] == "single_future_day":
                QA_SU_save_single_future_day(arg[1], "tdx")
            elif len(arg) == 2 and arg[0] == "single_index_day":
                QA_SU_save_single_index_day(arg[1], "tdx")
            elif len(arg) == 2 and arg[0] == "single_etf_day":
                QA_SU_save_single_etf_day(arg[1], "tdx")
            elif len(arg) == 2 and arg[0] == "single_stock_min":
                QA_SU_save_single_stock_min(arg[1], "tdx")
            elif len(arg) == 2 and arg[0] == "single_future_min":
                QA_SU_save_single_future_min(arg[1], "tdx")
            elif len(arg) == 2 and arg[0] == "single_index_min":
                QA_SU_save_single_index_min(arg[1], "tdx")
            elif len(arg) == 2 and arg[0] == "single_etf_min":
                QA_SU_save_single_etf_min(arg[1], "tdx")
            elif len(arg) == 2 and arg[0] == "single_bond_day":
                QA_SU_save_single_bond_day(arg[1], "tdx")
            elif len(arg) == 2 and arg[0] == "single_bond_min":
                QA_SU_save_single_bond_min(arg[1], "tdx")
            else:
                for i in arg:
                    if i == "insert_user":
                        if (QA_Setting().client.quantaxis.user_list.find({
                                "username":
                                "******"
                        }).count() == 0):
                            QA_Setting().client.quantaxis.user_list.insert({
                                "username":
                                "******",
                                "password":
                                "******"
                            })
                    else:
                        try:
                            eval("QA_SU_save_%s('tdx')" % (i))
                        except:
                            print("❌命令格式不正确!")
                            self.print_save_usage()
        self.lastcmd = ""
Пример #9
0
    def do_save(self, arg):
        # 仅仅是为了初始化才在这里插入用户,如果想要注册用户,要到webkit底下注册
        if arg == '':
            self.print_save_usage()
        else:
            arg = arg.split(' ')

            if len(arg) == 1 and arg[0] == 'all':
                if QA_Setting().client.quantaxis.user_list.find({'username': '******'}).count() == 0:
                    QA_Setting().client.quantaxis.user_list.insert(
                        {'username': '******', 'password': '******'})
                QA_SU_save_stock_day('tdx')
                QA_SU_save_stock_xdxr('tdx')
                # QA_SU_save_stock_min('tdx')
                QA_SU_save_index_day('tdx')
                # QA_SU_save_index_min('tdx')
                # QA_SU_save_etf_day('tdx')
                # QA_SU_save_etf_min('tdx')
                QA_SU_save_stock_list('tdx')
                QA_SU_save_stock_block('tdx')
                # QA_SU_save_stock_info('tdx')
            elif len(arg) == 1 and arg[0] == 'day':
                if QA_Setting().client.quantaxis.user_list.find({'username': '******'}).count() == 0:
                    QA_Setting().client.quantaxis.user_list.insert(
                        {'username': '******', 'password': '******'})
                QA_SU_save_stock_day('tdx')
                QA_SU_save_stock_xdxr('tdx')
                # QA_SU_save_stock_min('tdx')
                QA_SU_save_index_day('tdx')
                # QA_SU_save_index_min('tdx')
                QA_SU_save_etf_day('tdx')
                # QA_SU_save_etf_min('tdx')
                QA_SU_save_stock_list('tdx')
                QA_SU_save_stock_block('tdx')
            elif len(arg) == 1 and arg[0] == 'min':
                if QA_Setting().client.quantaxis.user_list.find({'username': '******'}).count() == 0:
                    QA_Setting().client.quantaxis.user_list.insert(
                        {'username': '******', 'password': '******'})
                # QA_SU_save_stock_day('tdx')
                QA_SU_save_stock_xdxr('tdx')
                QA_SU_save_stock_min('tdx')
                # QA_SU_save_index_day('tdx')
                QA_SU_save_index_min('tdx')
                # QA_SU_save_etf_day('tdx')
                QA_SU_save_etf_min('tdx')
                QA_SU_save_stock_list('tdx')
                # QA_SU_save_stock_block('tdx')
            elif len(arg) == 1 and arg[0] in ['X', 'x']:
                if QA_Setting().client.quantaxis.user_list.find({'username': '******'}).count() == 0:
                    QA_Setting().client.quantaxis.user_list.insert(
                        {'username': '******', 'password': '******'})
                QA_SU_save_stock_day('tdx')
                QA_SU_save_stock_xdxr('tdx')
                QA_SU_save_stock_min('tdx')
                QA_SU_save_index_day('tdx')
                QA_SU_save_index_min('tdx')
                QA_SU_save_etf_day('tdx')
                QA_SU_save_etf_min('tdx')
                QA_SU_save_stock_list('tdx')
                QA_SU_save_stock_block('tdx')
                # QA_SU_save_stock_info('tdx')
            elif len(arg) == 1 and arg[0] == "binance":
                QA_SU_save_binance_symbol()
                QA_SU_save_binance_1day()
                QA_SU_save_binance_1hour()
                QA_SU_save_binance_1day()
                QA_SU_save_binance_1min()
            elif len(arg) == 2 and arg[0] == "binance":
                frequency = arg[1]
                QA_SU_save_binance(frequency)
            elif len(arg) == 1 and arg[0] == "huobi":
                pass
            elif len(arg) == 1 and arg[0] == "financialfiles":
                QA_SU_save_financialfiles()
            else:
                for i in arg:
                    if i == 'insert_user':
                        if QA_Setting().client.quantaxis.user_list.find({'username': '******'}).count() == 0:
                            QA_Setting().client.quantaxis.user_list.insert(
                                {'username': '******', 'password': '******'})
                    else:
                        '''
                        save stock_day  : save stock_day 
                        save stock_xdxr : save stock_xdxr 
                        save stock_min  : save stock_min 
                        save index_day  : save index_day 
                        save index_min  : save index_min 
                        save etf_day    : save etf_day 
                        save etf_min    : save etf_min 
                        save stock_list : save stock_list
                        save stock_block: save stock_block
                        save stock_info : save stock_info
                        '''
                        try:
                            eval("QA_SU_save_%s('tdx')" % (i))
                        except:
                            print("❌命令格式不正确!")
                            self.print_save_usage()
Пример #10
0
    def do_save(self, arg):
        # 仅仅是为了初始化才在这里插入用户,如果想要注册用户,要到webkit底下注册
        if arg == '':
            self.print_save_usage()
        else:
            arg = arg.split(' ')

            if len(arg) == 1 and arg[0] == 'all':
                if QA_Setting().client.quantaxis.user_list.find({
                        'username':
                        '******'
                }).count() == 0:
                    QA_Setting().client.quantaxis.user_list.insert({
                        'username':
                        '******',
                        'password':
                        '******'
                    })
                QA_SU_save_stock_day('tdx')
                QA_SU_save_stock_xdxr('tdx')
                # QA_SU_save_stock_min('tdx')
                QA_SU_save_index_day('tdx')
                # QA_SU_save_index_min('tdx')
                # QA_SU_save_etf_day('tdx')
                # QA_SU_save_etf_min('tdx')
                QA_SU_save_index_list('tdx')
                QA_SU_save_stock_list('tdx')
                QA_SU_save_stock_block('tdx')
                # QA_SU_save_stock_info('tdx')
                # QA_SU_save_report_calendar_his()
                # QA_SU_save_stock_divyield_his()

            elif len(arg) == 1 and arg[0] == 'day':
                if QA_Setting().client.quantaxis.user_list.find({
                        'username':
                        '******'
                }).count() == 0:
                    QA_Setting().client.quantaxis.user_list.insert({
                        'username':
                        '******',
                        'password':
                        '******'
                    })
                QA_SU_save_stock_day('tdx')
                QA_SU_save_stock_xdxr('tdx')
                # QA_SU_save_stock_min('tdx')
                QA_SU_save_index_day('tdx')
                # QA_SU_save_index_min('tdx')
                QA_SU_save_etf_day('tdx')
                # QA_SU_save_etf_min('tdx')
                QA_SU_save_index_list('tdx')
                QA_SU_save_stock_list('tdx')
                QA_SU_save_stock_block('tdx')
                # QA_SU_save_stock_divyield_day()
                # QA_SU_save_report_calendar_day()

            elif len(arg) == 1 and arg[0] == 'min':
                if QA_Setting().client.quantaxis.user_list.find({
                        'username':
                        '******'
                }).count() == 0:
                    QA_Setting().client.quantaxis.user_list.insert({
                        'username':
                        '******',
                        'password':
                        '******'
                    })
                # QA_SU_save_stock_day('tdx')
                QA_SU_save_stock_xdxr('tdx')
                QA_SU_save_stock_min('tdx')
                # QA_SU_save_index_day('tdx')
                QA_SU_save_index_min('tdx')
                # QA_SU_save_etf_day('tdx')
                QA_SU_save_etf_min('tdx')
                QA_SU_save_stock_list('tdx')
                QA_SU_save_index_list('tdx')
                # QA_SU_save_stock_block('tdx')
            elif len(arg) == 1 and arg[0] in ['X', 'x']:
                if QA_Setting().client.quantaxis.user_list.find({
                        'username':
                        '******'
                }).count() == 0:
                    QA_Setting().client.quantaxis.user_list.insert({
                        'username':
                        '******',
                        'password':
                        '******'
                    })
                QA_SU_save_stock_day('tdx')
                QA_SU_save_stock_xdxr('tdx')
                QA_SU_save_stock_min('tdx')
                QA_SU_save_index_day('tdx')
                QA_SU_save_index_min('tdx')
                QA_SU_save_etf_day('tdx')
                QA_SU_save_etf_min('tdx')
                QA_SU_save_stock_list('tdx')
                QA_SU_save_index_list('tdx')
                QA_SU_save_stock_block('tdx')
                QA_SU_save_future_list('tdx')
                # QA_SU_save_stock_info('tdx')
            elif len(arg) == 1 and arg[0] == "binance":
                QA_SU_save_binance_symbol()
                QA_SU_save_binance_1day()
                QA_SU_save_binance_1hour()
                QA_SU_save_binance_1day()
                QA_SU_save_binance_1min()
            elif len(arg) == 2 and arg[0] == "binance":
                frequency = arg[1]
                QA_SU_save_binance(frequency)
            elif len(arg) == 1 and arg[0] == "bitmex":
                QA_SU_save_bitmex_symbol()
                QA_SU_save_bitmex('1m')
                QA_SU_save_bitmex('1h')
                QA_SU_save_bitmex('1d')
            elif len(arg) == 1 and arg[0] == "huobi":
                pass
            elif len(arg) == 1 and arg[0] == "financialfiles":
                QA_SU_save_financialfiles()

            elif len(arg) == 1 and arg[0] == "future":
                QA_SU_save_future_day('tdx')
                QA_SU_save_future_min('tdx')
                QA_SU_save_future_list('tdx')

            elif len(arg) == 1 and arg[0] == "future_all":
                QA_SU_save_future_day_all('tdx')
                QA_SU_save_future_min_all('tdx')
                QA_SU_save_future_list('tdx')
            else:
                for i in arg:
                    if i == 'insert_user':
                        if QA_Setting().client.quantaxis.user_list.find({
                                'username':
                                '******'
                        }).count() == 0:
                            QA_Setting().client.quantaxis.user_list.insert({
                                'username':
                                '******',
                                'password':
                                '******'
                            })
                    else:
                        '''
                        save stock_day  :对应输入命令 save stock_day 
                        save stock_xdxr :对应输入命令 save stock_xdxr 
                        save stock_min  :对应输入命令 save stock_min 
                        save index_day  :对应输入命令 save index_day 
                        save index_min  :对应输入命令 save index_min 
                        save etf_day    :对应输入命令 save etf_day 
                        save etf_min    :对应输入命令 save etf_min 
                        save stock_list :对应输入命令 save stock_list
                        save stock_block:对应输入命令 save stock_block
                        save stock_info :对应输入命令 save stock_info
                        save index_list :对应输入命令 save index_list
                        save future_list :对应输入命令 save future_list
                        save future_day  : 对应输入命令  save future_day
                        save future_min  : 对应输入命令  save future_min
                        save future_day_all : 对应输入命令 save future_day_all
                        save future_min_all : 对应输入命令 save future_min_all
                        save option_day :对应输入命令 save option day
                        save option_min :对应输入命令 save option_min
                        save option_commodity_day :对应输入命令 save commodity_option_day
                        save option_commodity_min :对应输入命令 save commodity_option_min
                        save option_contract_list :对应输入命令 save option_contract_list
                        '''
                        try:
                            eval("QA_SU_save_%s('tdx')" % (i))
                        except:
                            print("❌命令格式不正确!")
                            self.print_save_usage()