Skip to content

TypeError: strptime() argument 1 must be str, not datetime.date #75

@ardeal

Description

@ardeal

请问大佬,
安装好所有的package之后,执行 python main.py, 提示下面的错误, 怎么解呢?

Traceback (most recent call last):
  File "D:\code_stock\Sequoia\main.py", line 30, in <module>
    work_flow.prepare()
  File "D:\code_stock\Sequoia\work_flow.py", line 42, in prepare
    process(stocks, strategies)
  File "D:\code_stock\Sequoia\work_flow.py", line 50, in process
    check(stocks_data, strategy, strategy_func)
  File "D:\code_stock\Sequoia\work_flow.py", line 56, in check
    results = dict(filter(m_filter, stocks_data.items()))
  File "D:\code_stock\Sequoia\work_flow.py", line 67, in end_date_filter
    return strategy_fun(stock_data[0], stock_data[1], end_date=end_date)
  File "D:\code_stock\Sequoia\strategy\backtrace_ma250.py", line 72, in check
    date_diff = datetime.date(datetime.strptime(recent_lowest_row['日期'], '%Y-%m-%d')) - \
TypeError: strptime() argument 1 must be str, not datetime.date

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions