def training(start, end):

    now = datetime.now().strftime('%Y-%m-%d')
    is_holiday = trade_date_dao.is_holiday(now)
    # 如果是假日, 跳过
    if is_holiday:
        return

    k_data_manage.training_k_data(start, end)
def predict():

    now = datetime.now().strftime('%Y-%m-%d')
    is_holiday = trade_date_dao.is_holiday(now)
    # 如果是假日, 跳过
    if is_holiday:
        return

    k_data_manage.predict_k_data()
def collect_index_china_daily():
    now = datetime.now().strftime('%Y-%m-%d')
    is_holiday = trade_date_dao.is_holiday(now)
    # 如果是假日, 跳过
    if is_holiday:
        return

    collect_single_index_daily_from_ts('000001')
    collect_single_index_daily_from_ts('399001')
    collect_single_index_daily_from_ts('000300')
    collect_single_index_daily_from_ts('000905')
示例#4
0
def collect_all_index(futu_quote_ctx):
    now = datetime.now().strftime('%Y-%m-%d')
    is_holiday = trade_date_dao.is_holiday(now)
    # 如果是假日, 跳过
    if is_holiday:
        return

    for code in INDEX_CODES:
        collect_single(code=code,
                       start='2013-01-01',
                       end=now,
                       futu_quote_ctx=futu_quote_ctx)
示例#5
0
def collect_all_index_daily(futu_quote_ctx, start=None, end=None):
    now = datetime.now().strftime('%Y-%m-%d')
    is_holiday = trade_date_dao.is_holiday(now)
    # 如果是假日, 跳过
    if is_holiday:
        return

    for code in INDEX_CODES:
        collect_single_daily(code=code,
                             futu_quote_ctx=futu_quote_ctx,
                             start=start,
                             end=end)
示例#6
0
def collect_all_daily(futu_quote_ctx, start=None, end=None):
    now = datetime.now().strftime('%Y-%m-%d')
    is_holiday = trade_date_dao.is_holiday(now)
    # 如果是假日, 跳过
    if is_holiday:
        return

    df_industry = stock_industry_dao.get_stock_code_list()
    for index, row in df_industry.iterrows():
        code = row['code']
        collect_single_daily(code=code,
                             futu_quote_ctx=futu_quote_ctx,
                             start=start,
                             end=end)
示例#7
0
 def test_is_holiday(self):
     rs = trade_date_dao.is_holiday('2018-07-08')
     print(rs)