Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error : local variable 'backtestResult' referenced before assignment #170

Open
nimasTT opened this issue Dec 3, 2018 · 4 comments
Open

Comments

@nimasTT
Copy link

nimasTT commented Dec 3, 2018

i am getting this Error after a while:
`Relative profit on evolution dataset: 469.280
Current parameters are viable.
Evaluation dataset is disabled.

 469.280 final profit ~~~~
 -- Settings for Gekko config.js --
{
  "ADX": 3.702,
  "ADX_high": 72.94,
  "ADX_low": 37.1,
  "BEAR_RSI": 17.7,
  "BEAR_RSI_high": 69.72,
  "BEAR_RSI_low": 15.2,
  "BULL_RSI": 12.82,
  "BULL_RSI_high": 60.8,
  "BULL_RSI_low": 46.68,
  "SMA_long": 760.0,
  "SMA_short": 38.0
}
 -- Settings for Gekko --ui webpage --
ADX = 3.702
ADX_high = 72.94
ADX_low = 37.1
BEAR_RSI = 17.7
BEAR_RSI_high = 69.72
BEAR_RSI_low = 15.2
BULL_RSI = 12.82
BULL_RSI_high = 60.8
BULL_RSI_low = 46.68
SMA_long = 760.0
SMA_short = 38.0

Traceback (most recent call last):
  File "japonicus-run", line 10, in <module>
    japonicus.launchJaponicus(settings, options)
  File "/mnt/c/Users/Nima/japonicus/japonicus/japonicus.py", line 181, in launchJaponicus
    EvaluationMode, settings, options, web=web_server
  File "/mnt/c/Users/Nima/japonicus/japonicus/evolution_generations.py", line 259, in gekko_generations
    promoterz.evaluationBreak.showResults(World)
  File "/mnt/c/Users/Nima/japonicus/promoterz/evaluationBreak.py", line 119, in showResults
    currentSessionBreakResults.append((backtestResult['relativeProfit'], TOMLSettings))
UnboundLocalError: local variable 'backtestResult' referenced before assignment`

Could it caused by running too many parallel Backtest?
@Gab0
Copy link
Owner

Gab0 commented Dec 3, 2018

I have never seen it, it happens only with too many parallel Backtests? How many?

@nimasTT
Copy link
Author

nimasTT commented Dec 3, 2018

I though it could be maybe because of a concurrency problem.
I have tried more runs with default options (6 parallel Backtests) on an 10 years old i5 Laptop. but i get the Failure each time after EPOCH 50.
I tried it also with 3 parallel Backtests. I get the same message.

@FA-UC-HR
Copy link

FA-UC-HR commented Jan 16, 2019

I think it's not a dependency problem.

Some rows before @nimasTT log are interesting, because I have the same issue:

Rative profit on evolution dataset: 445.165
Current parameters are viable.
**Evaluation dataset is disabled.**
~~~~~~~~~~~~~~~~~~
 445.165 final profit ~~~~
 -- Settings for Gekko config.js --
{
  "ADX": 3.432,
............................

If there is no "evaluation dataset", the var backtestresult will not be assigned at row 100 before it is referenced in row 121 (current version)

@Gab0
Copy link
Owner

Gab0 commented Jan 16, 2019

I think this is it... I never tested myself without evaluation dataset XD.
Nice catch, fix is going online soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants