Closed Pascal66 closed 3 years ago
it should work if you optimize all spaces.
When using only one space (for example --spaces trailing
) - in the SwingHighToSky example, hyperopt will use:
populate_indicators
from hyperoptpopulate_buy_trend
and populate_sell_trend
from the strategyThe problem is that the strategy methods use the column 'cci-buy'
- which the hyperopt does not populate.
It's also not quite easy to do correctly, as i assume you first optimized for buy / sell spaces, and are now moving to the "next" space.
Assuming you ONLY optimize the trailing space, i'd rename the populate_indicators
method in hyperopt so it's no longer used.
This will ensure that the (previously) optimized buy / sell values will be used from the strategy.
I wouldn't know a better solution to this at the moment, as the combination of strategy / hyperopt assumes that results from buy/sell optimization are inserted into the strategy before running a reduced space.
maybe @OtenMoten as some other tips / opinions about this ... ?
Hope this helps
Hello @xmatthias and @Pascal66,
thanks for sharing your issue. I will comment this in future directly in the file, the problem is that the hyperopt uses the ranges for the indicators you define at the top of the file:
cciTimeMin = 10
cciTimeMax = 80
cciValueMin = -200
cciValueMax = 200
cciTimeRange = range(cciTimeMin, cciTimeMax)
rsiTimeMin = 10
rsiTimeMax = 80
rsiValueMin = 10
rsiValueMax = 90
rsiTimeRange = range(rsiTimeMin, rsiTimeMax)
As you can see in the method populate_indicators(...)
in the hyperopt file cciName = "cci-buy-" + str(cciTime)
that the variable name will be cci-buy-55
for example. Therefore, if you use the hyperopt together with the strategy file, then you need to change the name if your variable of the strategy file to cci-buy-55
for example, depends on what timeperiod you use on this indicator. cci-buy-55
means cci with 55 timeperiod for buy signals.
Try it, I will be sure it will work :-) Because I experienced the same issue.
Kind regards @OtenMoten
PS: In one sentence: Indicator names in strategy file must be equal to the indiactor names of the hyperopt file.
Using
--space default
is working--space all
too But--space trailing
alone give an error :