请选择 进入手机版 | 继续访问电脑版

登录  | 立即注册

游客您好!登录后享受更多精彩

QQ登录

只需一步,快速开始

查看: 209|回复: 0

vnpy2.9.0 run_ga_optimization报错

[复制链接]

1

主题

1

帖子

9

积分

新手上路

Rank: 1

积分
9
发表于 2022-10-19 21:57:56 | 显示全部楼层 |阅读模式
Traceback (most recent call last):
  File "C:/Users/86136/Desktop/strategy2.9.0/ctpstrategy/strategy_break_price/break+turnPoint/run_opt.py", line 52, in <module>
    result = engine.run_ga_optimization(setting)
  File "D:\ProgramData\miniconda3\envs\vnpy-2.9.0\lib\site-packages\vnpy_ctastrategy\backtesting.py", line 559, in run_ga_optimization
    output=self.output
  File "D:\ProgramData\miniconda3\envs\vnpy-2.9.0\lib\site-packages\vnpy\trader\optimize.py", line 201, in run_ga_optimization
    verbose=False
  File "D:\ProgramData\miniconda3\envs\vnpy-2.9.0\lib\site-packages\deap\algorithms.py", line 316, in eaMuPlusLambda
    offspring = varOr(population, toolbox, lambda_, cxpb, mutpb)
  File "D:\ProgramData\miniconda3\envs\vnpy-2.9.0\lib\site-packages\deap\algorithms.py", line 234, in varOr
    ind1, ind2 = toolbox.mate(ind1, ind2)
  File "D:\ProgramData\miniconda3\envs\vnpy-2.9.0\lib\site-packages\deap\tools\crossover.py", line 51, in cxTwoPoint
    cxpoint2 = random.randint(1, size - 1)
  File "D:\ProgramData\miniconda3\envs\vnpy-2.9.0\lib\random.py", line 222, in randint
    return self.randrange(a, b+1)
  File "D:\ProgramData\miniconda3\envs\vnpy-2.9.0\lib\random.py", line 200, in randrange
    raise ValueError("empty range for randrange() (%d,%d, %d)" % (istart, istop, width))
ValueError: empty range for randrange() (1,1, 0)

Process finished with exit code 1
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|VNPY官方Python开源量化社区 ( 沪ICP备17025576号-16 )

GMT+8, 2023-2-5 17:59 , Processed in 0.052363 second(s), 20 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表