update fix failing tests, unitest that resume hyperopt functionality works
This commit is contained in:
@@ -30,7 +30,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
# set TARGET_TRADES to suit your number concurrent trades so its realistic to 20days of data
|
||||
TARGET_TRADES = 1100
|
||||
TOTAL_TRIES = None
|
||||
TOTAL_TRIES = 0
|
||||
_CURRENT_TRIES = 0
|
||||
CURRENT_BEST_LOSS = 100
|
||||
|
||||
@@ -116,7 +116,7 @@ def read_trials(trials_path=TRIALS_FILE):
|
||||
"Read hyperopt trials file"
|
||||
logger.info('Reading Trials from \'{}\''.format(trials_path))
|
||||
trials = pickle.load(open(trials_path, 'rb'))
|
||||
# os.remove(trials_path)
|
||||
os.remove(trials_path)
|
||||
return trials
|
||||
|
||||
|
||||
@@ -125,6 +125,7 @@ def log_trials_result(trials):
|
||||
results = trials.best_trial['result']['result']
|
||||
logger.info('Best result:\n%s\nwith values:\n%s', results, vals)
|
||||
|
||||
|
||||
def log_results(results):
|
||||
""" log results if it is better than any previous evaluation """
|
||||
global CURRENT_BEST_LOSS
|
||||
@@ -242,12 +243,8 @@ def buy_strategy_generator(params):
|
||||
|
||||
|
||||
def start(args):
|
||||
<<<<<<< HEAD
|
||||
global TOTAL_TRIES, PROCESSED, SPACE
|
||||
=======
|
||||
global TOTAL_TRIES, PROCESSED, TRIALS, _CURRENT_TRIES
|
||||
global TOTAL_TRIES, PROCESSED, SPACE, TRIALS, _CURRENT_TRIES
|
||||
|
||||
>>>>>>> Hyperopt to handle SIGINT by saving/reading the trials file
|
||||
TOTAL_TRIES = args.epochs
|
||||
|
||||
exchange._API = Bittrex({'key': '', 'secret': ''})
|
||||
@@ -276,6 +273,7 @@ def start(args):
|
||||
# read trials file if we have one
|
||||
if os.path.exists(TRIALS_FILE):
|
||||
TRIALS = read_trials()
|
||||
|
||||
_CURRENT_TRIES = len(TRIALS.results)
|
||||
TOTAL_TRIES = TOTAL_TRIES + _CURRENT_TRIES
|
||||
logger.info(
|
||||
|
Reference in New Issue
Block a user