Bayesian Optimization of a Technical Trading Algorithm with SigOpt

Authors: Justin Lent (Quantopian), Thomas Wiecki (Quantopian), Scott Clark (SigOpt)

Parameter optimization of trading algorithms is quite different from most other optimization problems. Specifically, the optimization problem is non-convex, non-linear, stochastic, and can include a mix of integers, floats and enums as parameters. Moreover, most optimizers assume that the objective function is quick to evaluate which is definitely not the case for a trading algorithm run over multiple years of financial data. Immediately that disqualifies 95% of optimizers including those offered by scipy or cvxopt. At Quantopian we have long been interested in parameter optimization of trading algorithms (some prior blog posts on this topic can be found here, here, and here).

Bayesian optimization is a rather novel approach to the selection of parameters that is very well suited to optimize trading algorithms. This blog post will first provide a short introduction to Bayesian optimization with a focus on why it is well suited for quantitative finance. We will then show how you can use SigOpt to perform Bayesian optimization on your own trading algorithms running with zipline.

This blog post originally resulted from a collaboration with Alex Wiltschko where we used Whetlab for Bayesian optimization. Whetlab, however, has since been acquired by Twitter and the Whetlab service was discontinued. Scott Clark from SigOpt helped in porting the code to their service which is comparable in functionality and API. Scott also co-wrote the blog post.

Introduction to Bayesian optimization (Scott)

Bayesian Optimization is a powerful tool that is particularly useful when optimizing anything that is both time consuming and expensive to evaluate (like trading algorithms). At the core, Bayesian Optimization attempts to leverage historical observations to make optimal suggestions on the best variation of parameters to sample (maximizing some objective like expected returns). This field has been actively studied in academia for decades, from the seminal paper "Efficient Global Optimization of Expensive Black-Box Functions" by Jones et al. in 1998 to more recent contributions like "Practical Bayesian Optimization of Machine Learning Algorithms" by Snoek et al. in 2012.

Many of these approaches take a similar route to solving the problem: they map the observed evaluations onto a Gaussian Process (GP), fit the best possible GP model, perform optimization on this model, then return a new set of suggestions for the user to evaluate. At the core, these methods balance the tradeoff between exploration (learning more about the model, the length scales over which they vary, and how they combine to influence the overall objective) and exploitation (using the knowledge already gained to return the best possible expected result). By efficiently and automatically making these tradeoffs, Bayesian Optimization techniques can quickly find the global optima of these difficult to optimize problems, often much faster than traditional methods like brute force or localized search.

At every Bayesian Optimization iteration, the point of highest Expected Improvement is returned; this is the set of parameters that, in expectation, will most improve upon the best objective value observed thus far. SigOpt wraps these powerful optimization techniques behind a simple API so that any expert in any field can optimize their models without resorting to expensive trial and error. More information about how SigOpt works, as well as other examples of using Bayesian Optimization to perform parameter optimization, can be found on our research page.

A Generalized Framework for Evaluating Trading Signals (Justin)

Historically quant traders have used many price based signals to define an investment strategy. Many of these signals have been implemented into the popular TA-lib library, with an available Python library here. Typically, a price based signal takes in historical prices as input to compute the signal's value. For example, RSI (Relative Strength Index), is commonly used for mean-reversion and momentum trading. To compute RSI one must first choose the number of pricing days over which to compute the signal. Then, the trader chooses a range of values for determining when to enter a trade. The valid values for RSI is between 0 to 100. If a stock has undergone a sharp selloff recently, RSI values will trend towards 0, and after a strong rally, trend towards 100. A common trading strategy is going long a stock when RSI is below 20, betting on mean-reversion. Similarly, to go short when RSI is above 80. However, other groups of traders have found success betting on persistent momentum in the stock (rather than mean-reversion) when RSI reaches an extreme reading. In which case, the trader will go long when RSI is above 80 betting that the stock will continue going higher.

This poses several questions:

  • So which is right? Should we use RSI as a mean-reversion indicator or a momentum indicator?
    • What range of RSI values shall we choose to determine if the momentum or mean-reversion condition is met?
    • How many lookback days of prices should we use to compute the stock's RSI?
  • Besides RSI, can I integrate a second indicator into my investment strategy?

Each decision made regarding specifying our trading signal (e.g. RSI) or how to interpret the signal's value for making a trading decision is effectively a free parameter in our system, and depending upon the range of reasonable values each free parameter can take, it can quickly explode the total combinations of possible settings. Each signal added to the strategy can quickly increase the total combinations possible into the many millions and even billions, even with just 2 signals, as we'll see in the below example. A discussion of strategy model overfitting, and evaluating how overfit a trading backtest may be, will not be addressed here, but will be the topic of a future blog post. An excellent introduction for addressing trading strategy overfitting can be found here: .

The large parameter space of millions, or billions, of combinations over which our strategy will need to be tested in order to determine the subspace where the global maximum is likely located is why Bayesian Optimization can be so effective at quickly evaluating potentially profitable trading strategies. Brute force grid-search over a billion combination parameter space is often intractable, even if each combination only takes 30-seconds to complete. Bayesian optimization decreases the evaluation of the model over the global search space by an order of magnitude, as described in the previous section.

The trading algorithm we will implement below will create a simple structure for passing in the free parameters of any number simple price based trading signals (simplified to work more easily with ta-lib functions). Then each signal is evaluated each trading day, when all the conditions are true, a trade is entered, and held until the next signal evaluation period.

For the purposes of this optimization our objective function will be Sharpe Ratio of the strategy. A broadly accepted metric from industry for evaluating trading strategy performance. However, the framework implemented below allows for ease of swapping in any objective function desired by the analyst.

Example Zipline algorithm

To illustrate how you can use Bayesian optimization on your zipline trading algorithms and how it compares to other naive approaches (i.e. grid search) we will use a rather simple algorithm comprised of a trading trigger based on two commonly used signals from the ta-lib library, RSI (Relative Strength Index) and ROC (Rate of Change).

The trading algorithm will search for trades across these Select Sector SPDR ETF's:

  • XLV, XLF, XLP, XLE, XLK, XLB, XLU, XLI.

By running the trading logic across all of these ETF's we will be implementing a simple sector-rotation strategy.

-----------------------------------------------------------------------------------------------------
Strategy Specification

Buy the ETF only if it meets both the RSI signal and ROC signal criteria. When an ETF is bought long, then an equivalent dollar amount of SPY will be shorted, creating a hedged, dollar-neutral portfolio.

-----------------------------------------------------------------------------------------------------

By hedging all of our trades, it serves to "tease-apart" the actual usefulness provided by these signals (RSI, ROC) since it extracts upward movement in the stock simply occurring because the rest of the stock market is going up. As a result, the profit achieved by this hedged strategy can be perceived as more "pure alpha," rather than highly-correlated to the direction of the broad stock market.

The 7 free parameters of our trading strategy are as follows:

  • RSI
    • (1) Lookback window for # of prices used in the RSI calculation
    • (2) Lower_bound value defining the trade entry condition
    • (3) Range_width, which will be added to the Lower-bound
      • Lower_bound + Range_width is the range of values over which our RSI signal will be considered True
  • ROC
    • (4) Lookback window for # of prices used in the ROC calculation
    • (5) Lower_bound value defining the trade entry condition
    • (6) Range_width, which will be added to the Lower-bound
      • Lower_bound + Range_width is the range of values over which our ROC signal will be considered True
  • Signal evaluation frequency
    • (7) Number of days we wait between evaluating if our signals are valid
      • Do we evaluate them every day, every week, every month, etc.

It's worth noting that even with just 2 price based signals, we have 7 free parameters in this system!

Reasonable Ranges for each of the 7 free parameters above (assuming each is an integer, with integer steps):

  1. 115 values: 5 to 120
  2. 90 values: 0 to 90
  3. 20 values: 10 to 30
  4. 61 values: 2 to 63
  5. 30 values: 0 to 30
  6. 195 values: 5 to 200
  7. 18 values: 3 to 21

Multiplying the valid ranges of each yields a total combination count of:

  • 1,329,623,100,000 theoretical combinations
    • 115 x 90 x 20 x 61 x 30 x 195 x 18 (TODO: check with Thomas on this math)
    • Imagine how many combinations are possible if 3, 4, 5... 10 signals are added to a strategy

Obviously grid-searching through all those combinations is unreasonable, though a skilled practitioner can prune the search space significantly by only grid-searching across each parameter using wider steps based on their intuition of the model they are building. But even if the skilled practitioner can reduce the grid-search to 10,000 combinations even that number of combinations may be unwieldy if the objective function (e.g. trading strategy) takes 1-minute to evaluate, which is quite frequently the case with trading strategies. This is where the benefit of having access to a Bayesian optimizer becomes extremely helpful.

The ipython notebook below compares SigOpt's Bayesian Optimizer's results from 3 independent experiments, of only 300 trials each determined intelligently by their optimizer, to a "smart" grid-search of approximately 3500 combinations chosen intuitively from a reasonable interpretations of sensible RSI and ROC values. Only 3500 trials were chosen for the grid-search approach, because even that few combinations took 48 hours to evaluate. 300 trials were chosen for the SigOpt approach because in practice the SigOpt optimizer is able to find good optima within 10 to 20 times the dimensionality of the parameter space being optimized. This linear number of evaluations with respect to the number of parameters allows for optimization of algorithms that would otherwise be intractable using standard methods like grid search, which grow exponentially with the number of parameters.

Conclusion

The SigOpt Bayesian Optimizer discovered a better global maximum when testing only over only 300 combinations, than what was discovered by the ~3500 combination grid search.

(This was seen in 4 out of 5 runs with SigOpt, and the 1 that returned a worse value was only minor shortfall)

One Example of how quickly SigOpt discovered a maximum is shown below

Reducing model evaluation by 10x, and achieving more accurate results, while vetting the merits of a trading algorithm is beneficial on many levels, both from CPU time spent, but also with regard to human time not being wasted waiting for results during the researh process. Since so few trading hypotheses end up being viable, the faster a researcher can discard the bad ideas and spend time diving more deeply in the good ideas with further techniques (e.g. model cross-validation, out-of-sample testing, robustness and overfitting checks, etc).

-----------------------------------------------------------------------------------------

Implementing our Trading Algo & Running Optimizations

We start by importing our tools. Also note that if you want to run this yourself you need to create a file in this folder called creds.py where you place your SigOpt credentials (a free trial is avaible if you go to SigOpt.com).


In [1]:
"""
    This cell is for importing all our necessary libraries
"""
%matplotlib inline
import matplotlib
import numpy as np
import pandas as pd
import talib
import seaborn as sns
import matplotlib.pyplot as plt

from collections import OrderedDict
from collections import defaultdict
import itertools

import zipline
from zipline.utils.factory import load_bars_from_yahoo

try:
    import pyfolio as pf
except ImportError:
    print('Pyfolio not installed. Pyfolio specific plots will not be available in this notebook.')
    
try:
    import creds
except ImportError:
    raise ValueError('creds.py not found. Please create it and set user_token, client_token and client_id from https://sigopt.com/user/profile')

Next we will load in pricing data via Yahoo! finance.


In [2]:
#: Get pricing for the same dates in daily mode
data = load_bars_from_yahoo(stocks=['XLV', 'XLF', 'XLP','XLE', 'XLK', 'XLB', 'XLU', 'XLI','SPY'
                                    ],
                            start=pd.Timestamp('2004-01-01', tz='utc'),
                            end=pd.Timestamp('2010-01-01', tz='utc')
                           )

data_heldout = load_bars_from_yahoo(stocks=[ 'XLV', 'XLF', 'XLP','XLE', 'XLK', 'XLB', 'XLU', 'XLI', 'SPY'
                                            ],
                                    start=pd.Timestamp('2010-01-10', tz='utc'),
                                    end=pd.Timestamp('2016-1-7', tz='utc')
                                   )

data_all = load_bars_from_yahoo(stocks=[ 'XLV', 'XLF', 'XLP','XLE', 'XLK', 'XLB', 'XLU', 'XLI', 'SPY'
                                        ],
                                start=pd.Timestamp('2004-01-01', tz='utc'),
                                end=pd.Timestamp('2016-1-7', tz='utc')
                               )


XLV
XLF
XLP
XLE
XLK
XLB
XLU
XLI
SPY
XLV
XLF
XLP
XLE
XLK
XLB
XLU
XLI
SPY
XLV
XLF
XLP
XLE
XLK
XLB
XLU
XLI
SPY

Trading Algo: Sector Rotation, using Sector SPDR ETF's, with Hedging


In [5]:
import matplotlib
import pytz
from datetime import datetime, timedelta
import numpy as np
import pandas as pd
import talib
import seaborn as sns

import matplotlib.pyplot as plt

# Zipline imports
from zipline.utils.factory import load_bars_from_yahoo
from zipline import TradingAlgorithm
from zipline.api import (
    order_target, 
    record, 
    symbol,
    get_datetime, 
    order_target_percent
)
from zipline.api import order_target_percent, record, symbol, symbols, history, add_history
from collections import OrderedDict


def initialize_local_sigopt_rsi_roc(context, signals_input=None, 
                            rsi_timeperiod=-1, rsi_lower=29, rsi_width=27,
                            roc_timeperiod=13, roc_lower=0.00, roc_width=2.00, 
                            rebalance_freq=21, 
                            max_pos_exp=0.3, min_stocks_for_full_exp=3, 
                            use_hedge=True, 
                            debug=False):
    
    context.debug = debug
    context.use_hedge = use_hedge
    context.rebalance_freq = rebalance_freq
    
    context.max_pos_exp = max_pos_exp
    context.min_stocks_for_full_exp = min_stocks_for_full_exp
    
    # A code simplification to make the downstream optimization analysis more straigtforward
    if rsi_timeperiod > 0:
        context.signals = OrderedDict([
                                        ( 'rsi', {'func': talib.RSI, 'func_kwargs': {'timeperiod': rsi_timeperiod}, 
                                                       'lower': rsi_lower,  'width': rsi_width} ),
                                        ( 'roc', {'func': talib.ROCP, 'func_kwargs': {'timeperiod': roc_timeperiod }, 
                                                       'lower': roc_lower, 'width': roc_width, } )
                                    ])
    else:
        if signals_input is None:
            context.signals = signals
        else:
            context.signals = signals_input
    
    print "rebal freq: " + str(context.rebalance_freq)
    print context.signals
    
    context.max_timeperiod = 0
    for signal_name in context.signals.keys():
        timeperiod = context.signals[signal_name]['func_kwargs']['timeperiod']
        if timeperiod > context.max_timeperiod:
            context.max_timeperiod = timeperiod
    context.max_timeperiod+=2
    
    add_history(context.max_timeperiod, '1d', 'price')
    
    # Declare the stocks we want to trade
    context.stocks = symbols('XLV', 'XLF', 'XLP','XLE', 'XLK', 'XLB', 'XLU', 'XLI')
    if context.debug: print "(symbol,sid)" + str( [ (i.symbol, i.sid) for i in context.stocks ] )
        
    if context.use_hedge:
        context.hedge = symbol('SPY')
    
    context.i = 0

    
def handle_data_local_sigopt_rsi_roc(context, data):
    """
    handle_data() is what will be called in every iteration of our algorithm. So every bar we run, will end up running
    handle_data(). This is where orders should be placed
    """
    # Skip first N days to get full/valid windows of data for history() below
    context.i += 1
    if context.i < (context.max_timeperiod + 5):
        return
    
    # only run logic every N trading days
    if (context.i % context.rebalance_freq) > 0:
        return
    
    if context.debug:
        pv = context.portfolio.portfolio_value
        port_exp = context.portfolio.positions_value
        print "port value= " + str(pv)
        print " port net $ exposure= " + str(port_exp)
        print "leverage= " + str( context.account.leverage )
        print "current port:" + str( context.portfolio.positions.keys() )

    max_history = history(context.max_timeperiod, '1d', 'price')
    
    stocks_to_hold = []
    stocks_to_not_hold = []
    
    for stock in context.stocks:
        #print stock.symbol
        close_prices = max_history[stock].values
        
        trade_ok = False
        for signal_name in context.signals.keys():
            signal_kwargs = context.signals[signal_name]['func_kwargs']
            signal_func = context.signals[signal_name]['func']

            signal_output_ts = signal_func(close_prices, **signal_kwargs)
            signal_output = signal_output_ts[-1]

            lower_bound = context.signals[signal_name]['lower']
            upper_bound = lower_bound + context.signals[signal_name]['width']
            
            if lower_bound > upper_bound:
                temp_bound = upper_bound
                upper_bound = lower_bound
                lower_bound = temp_bound
            
            if signal_output > lower_bound and signal_output < upper_bound:
                trade_ok = True
            else:
                trade_ok = False
                break
        
        if trade_ok:
            stocks_to_hold.append(stock)
        else:
            stocks_to_not_hold.append(stock)
    
    if context.debug: print "stock to hold: " + str( [ (i.symbol, i.sid) for i in stocks_to_hold ] )
    if context.debug: print "stock to NOT hold: " + str( [ (i.symbol, i.sid) for i in stocks_to_not_hold ] )
    
    for stock in stocks_to_not_hold:
        order_target_percent(stock, 0.0)
        if context.debug: print str(max_history.index[-1]) + " " + stock.symbol + "," + str(stock.sid) + " Exposure %: 0.0 "
        
    for stock in stocks_to_hold:
        if len(stocks_to_hold) >= context.min_stocks_for_full_exp:
            exposure = 1.0 / len(stocks_to_hold)
        else:
            exposure = context.max_pos_exp    
        order_target_percent(stock, exposure)
        if context.debug: print str(max_history.index[-1]) + ' ** Entry: ' + stock.symbol + "," + str(stock.sid) + " Exposure %: " +  str(exposure) + " total stocks:" + str(len(stocks_to_hold))
        
    if context.use_hedge:
        if len(stocks_to_hold) > 0:
            hedge_exposure = -1.0 * exposure * len(stocks_to_hold)
        else:
            hedge_exposure = 0.0
        order_target_percent(context.hedge, hedge_exposure)
        if context.debug: print str(max_history.index[-1]) + ' ** HEDGE: ' + context.hedge.symbol + "," + str(context.hedge.sid) + " Exposure %: " + str(hedge_exposure) + " total stocks:" + str(len(stocks_to_hold))

Setup for the Grid-Search Optimization


In [6]:
# this just declares the 'signals' variable and populates with some dummy values
signals = OrderedDict([
    ( 'rsi', {'func': talib.RSI, 'func_kwargs': {'timeperiod': 20}, 
                   'lower': 70,  'width': 20} ),
    ( 'roc', {'func': talib.ROCP, 'func_kwargs': {'timeperiod': 5 }, 
                   'lower': 0.70, 'width': 0.20} )
    
    
    ])

# This defines all the ta-lib signal hyperparameters used in the grid-search
# Same idea as the signal definition above, just in the format required for the grid-search
hypers = OrderedDict([
    ( 'rsi', {'timeperiod': {'min': 5, 'max': 100,  'step': 30},
                   'lower':      {'min': 10,  'max': 91,  'step': 30 }, 
                   'width':      {'min': 10, 'max': 31, 'step': 10}} ), 
        
    ( 'roc', {'timeperiod': {'min': 2,  'max': 64,   'step': 20},
                   'lower':      {'min': 0.01,  'max': 0.31,   'step': 0.10},
                   'width':      {'min': 0.05, 'max': 1.06,  'step': 0.30}} ) 
    
    ])

In [7]:
# pre-compute all realistic combos defined in 'hypers'
count = 0

all_combos = OrderedDict()
for combo in hypers:
    all_combos[combo] = []

for combo in hypers:
    print combo
    
    timeperiod_min = hypers[combo]['timeperiod']['min']
    timeperiod_max = hypers[combo]['timeperiod']['max']
    timeperiod_step = hypers[combo]['timeperiod']['step']
    
    lower_min = hypers[combo]['lower']['min']
    lower_max = hypers[combo]['lower']['max']
    lower_step = hypers[combo]['lower']['step']
    
    print type(lower_step)
    
    width_min = hypers[combo]['width']['min']
    width_max = hypers[combo]['width']['max']
    width_step = hypers[combo]['width']['step']
    
    for timeperiod in range(timeperiod_min, timeperiod_max, timeperiod_step):
        
        if isinstance(lower_min, float):
            t_lower_min = int(lower_min * 100)
            t_lower_max = int(lower_max * 100)
            t_lower_step = int(lower_step * 100)
            
            t_width_min = int(width_min * 100)
            t_width_max = int(width_max * 100)
            t_width_step = int(width_step * 100)
        else:
            t_lower_min = lower_min
            t_lower_max = lower_max
            t_lower_step = lower_step
            
            t_width_min = width_min
            t_width_max = width_max
            t_width_step = width_step
            
        for lower in range(t_lower_min, t_lower_max, t_lower_step):    
        
            for width in range(t_width_min, t_width_max, t_width_step):
                signals[combo]['func_kwargs']['timeperiod'] = timeperiod
                
                if isinstance(lower_min, float):
                    signals[combo]['lower'] = lower / 100.0
                    signals[combo]['width'] = width / 100.0
                    combo_tup = (timeperiod, lower / 100.0, width / 100.0)
                else:
                    signals[combo]['lower'] = lower
                    signals[combo]['width'] = width
                    combo_tup = (timeperiod, lower, width)
                
                all_combos[combo].append( combo_tup )

                count += 1
                                      
print count


rsi
<type 'int'>
roc
<type 'float'>
84

In [8]:
# only test 5-day and 15-day rebalance frequency, rather than all days from 3-days to 21-days
all_combos['rebal'] = [5, 15]
all_combos['rebal']


Out[8]:
[5, 15]

In [9]:
# Print out total # of parameters that we'll test in our grid-search
count = 0
for i in itertools.product(*all_combos.values()):
    count = count + 1
print count


3456

In [ ]:
# Run this cell if you want to print out and view every parameter combination
print len(list(itertools.product(*all_combos.values())) )
list(itertools.product(*all_combos.values()))

Run the Grid-Search optimization


In [ ]:
# This runs the grid-search 
# WARNING: It will take approx 48 hours if run over ~3500 combinations! (on a Macbook Air)

all_combos_list = list( itertools.product(*all_combos.values()) )
print "Total combos:  " + str( len(all_combos_list) )
print hypers.keys()

all_results = {}
count = 0

for combo in all_combos_list:
    for signal_i in range(0, len(combo)-1):
        signal_name = hypers.keys()[signal_i]
        signals[signal_name]['func_kwargs']['timeperiod'] = combo[signal_i][0]
        signals[signal_name]['lower'] = combo[signal_i][1]
        signals[signal_name]['width'] = combo[signal_i][2]
    
    temp_rebal = combo[-1]
    input_params = {}
    input_params['rebalance_freq'] = temp_rebal
    input_params['signals_input'] = signals
    
    algo_obj = zipline.TradingAlgorithm(
        initialize=initialize_local_sigopt_rsi_roc, 
        handle_data=handle_data_local_sigopt_rsi_roc,
        **input_params
    )

    # Run algorithm
    perf_manual = algo_obj.run(data)
    perf_manual.index = perf_manual.index.normalize()
    if perf_manual.index.tzinfo is None:
        perf_manual.index = perf_manual.index.tz_localize('UTC')
    returns = perf_manual.returns
    returns_stats = pf.timeseries.perf_stats(returns)
    all_results[combo] = returns_stats
    
    print str(count) + ":  " + str(combo) + "  Sharpe: " + str(returns_stats.sharpe_ratio) + "  %_return: " + str(returns_stats.annual_return)
    
    count += 1

In [29]:
# Confirm how many results were computed in the grid-search
len(all_results)


Out[29]:
3456

In [32]:
# Get a look at the structure of the grid-search results
all_results_df = pd.DataFrame(all_results)
all_results_df.head()


Out[32]:
(5, 10, 10) ... (95, 70, 30)
(2, 0.01, 0.05) (2, 0.01, 0.35) (2, 0.01, 0.65) (2, 0.01, 0.95) (2, 0.11, 0.05) ... (62, 0.11, 0.95) (62, 0.21, 0.05) (62, 0.21, 0.35) (62, 0.21, 0.65) (62, 0.21, 0.95)
5 15 5 15 5 15 5 15 5 15 ... 5 15 5 15 5 15 5 15 5 15
annual_return 0.002098 -0.000396 0.002098 -0.000396 0.002098 -0.000396 0.002098 -0.000396 0 0 ... 0 0 0 0 0 0 0 0 0 0
annual_volatility 0.006387 0.006964 0.006387 0.006964 0.006387 0.006964 0.006387 0.006964 0 0 ... 0 0 0 0 0 0 0 0 0 0
sharpe_ratio 0.331424 -0.053408 0.331424 -0.053408 0.331424 -0.053408 0.331424 -0.053408 NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
calmar_ratio 0.199049 -0.017505 0.199049 -0.017505 0.199049 -0.017505 0.199049 -0.017505 NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
stability_of_timeseries 0.716698 -0.751867 0.716698 -0.751867 0.716698 -0.751867 0.716698 -0.751867 0 0 ... 0 0 0 0 0 0 0 0 0 0

5 rows × 3456 columns


In [36]:
# Transponse the dataframe. 
# Makes it easier to manipulate after saving to CSV and opening in Excel

all_results_df_T = pd.DataFrame(all_results).T
all_results_df_T.head()


Out[36]:
annual_return annual_volatility sharpe_ratio calmar_ratio stability_of_timeseries max_drawdown omega_ratio sortino_ratio skew kurtosis
(5, 10, 10) (2, 0.01, 0.05) 5 0.002098 0.006387 0.331424 0.199049 0.716698 -0.010539 1.554529 0.532182 2.000573 183.259788
15 -0.000396 0.006964 -0.053408 -0.017505 -0.751867 -0.022620 0.925752 -0.075801 1.017988 171.597375
(2, 0.01, 0.35) 5 0.002098 0.006387 0.331424 0.199049 0.716698 -0.010539 1.554529 0.532182 2.000573 183.259788
15 -0.000396 0.006964 -0.053408 -0.017505 -0.751867 -0.022620 0.925752 -0.075801 1.017988 171.597375
(2, 0.01, 0.65) 5 0.002098 0.006387 0.331424 0.199049 0.716698 -0.010539 1.554529 0.532182 2.000573 183.259788

In [37]:
# Save results to a csv
all_results_df_T.to_csv('grid_search_all_results_export_T.csv')

In [34]:
# Pickle results
pd.to_pickle(all_results_df, 'grid_search_all_results_pickle.pkl')

In [44]:
# If you previously exported a CSV of your grid-search results
# you can read the results in like this. 
# After I exported to CSV I took the liberty to break out all the parameters into seperate columns
# and then resaved as a cleaner looking CSV

grid_df = pd.read_csv('grid_search_all_results_with_labels.csv')

In [45]:
grid_df.head()


Out[45]:
rsi_timeperiod rsi_lower rsi_width roc_timeperiod roc_lower roc_width rebalance_freq rsi roc freq value
0 5 40 10 42 0.01 0.05 5 (5, 40, 10) (42, 0.01, 0.05) 5 0.331424
1 65 40 30 42 0.01 0.05 15 (65, 40, 30) (42, 0.01, 0.05) 15 -0.053408
2 95 40 30 42 0.01 0.05 5 (95, 40, 30) (42, 0.01, 0.05) 5 0.331424
3 65 40 10 62 0.11 0.05 15 (65, 40, 10) (62, 0.11, 0.05) 15 -0.053408
4 65 40 10 62 0.11 0.35 5 (65, 40, 10) (62, 0.11, 0.35) 5 0.331424

In [46]:
grid_df.value.hist()
plt.axvline(np.mean(grid_df.value), color="orange", alpha=0.8, ls='--', lw=3, label='mean')
plt.axvline(0.0, color="black", alpha=0.8, ls='--', label='0.0')
plt.legend()


Out[46]:
<matplotlib.legend.Legend at 0x114493610>

Look at the distribution of each of the parameters' values tested.


In [47]:
_=grid_df.hist(figsize=(17,10))


Grid-Search: Run the best parameter combo from through the algorithm and plot the performance


In [14]:
# Specify the values of the best parameter combo in the signals dict, and rebalance frequency

input_params = {}

input_params['rebalance_freq'] = 5

signals = OrderedDict([
    ( 'rsi', {'func': talib.RSI, 'func_kwargs': {'timeperiod': 5}, 
                   'lower': 40,  'width': 10} ),
    ( 'roc', {'func': talib.ROCP, 'func_kwargs': {'timeperiod': 42 }, 
                   'lower': 0.01, 'width': 0.05} )  
    ])

input_params['signals_input'] = signals

In [15]:
algo_obj = zipline.TradingAlgorithm(
    initialize=initialize_local_sigopt_rsi_roc,
    handle_data=handle_data_local_sigopt_rsi_roc,
    **input_params
)

# Run algorithm using the training data
perf_manual = algo_obj.run(data)


rebal freq: 5
OrderedDict([('rsi', {'width': 10, 'lower': 40, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 5}}), ('roc', {'width': 0.05, 'lower': 0.01, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 42}})])

In [16]:
daily_rets = perf_manual.portfolio_value.pct_change().dropna()
sharpe_ratio_rets = daily_rets.mean() / daily_rets.std() * np.sqrt(252)
print sharpe_ratio_rets

perf_manual.portfolio_value.plot()


0.820374098135
Out[16]:
<matplotlib.axes._subplots.AxesSubplot at 0x111dc9a90>

Now see how well the strategy performs out-of-sample using the heldout data from 2010-2016


In [18]:
# Run algorithm using the training data
perf_manual = algo_obj.run(data_heldout)

daily_rets = perf_manual.portfolio_value.pct_change().dropna()
sharpe_ratio_rets = daily_rets.mean() / daily_rets.std() * np.sqrt(252)
print sharpe_ratio_rets

perf_manual.portfolio_value.plot()


-0.857501142839
Out[18]:
<matplotlib.axes._subplots.AxesSubplot at 0x10d74f1d0>

(Above) Seeing how poorly the strategy performs out-of-sample shows how important it is to perform additional analysis (cross-validation, out-of-sample testing, etc) after using parameter optimization to discover a global maximum


In [ ]:

Using SigOpt for Optimization


In [45]:
def run_sigopt_local_rsi_roc(samples=50, experiment_id=None,
                    client_token=None, **algo_descr):

    import sigopt.interface

    if client_token is None:
        raise ValueError('No sigopt credentials passed, find them at https://sigopt.com/user/profile')

    conn = sigopt.interface.Connection(client_token=client_token)

    if experiment_id != None:
        experiment = conn.experiments(experiment_id).fetch()
    else:
        experiment = conn.experiments().create(
            name='Quantopian_POC_talib_5_hedge_width',
            parameters=[
                {
                    'name': 'rsi_timeperiod',
                    'type': 'int',
                    'bounds': { 'min': 5, 'max': 126 }
                },
                {
                    'name': 'rsi_lower',
                    'type': 'int',
                    'bounds': { 'min': 0, 'max': 90 }
                },
                {
                    'name': 'rsi_width',
                    'type': 'int',
                    'bounds': { 'min': 10, 'max': 30 }
                },
                {
                    'name': 'roc_timeperiod',
                    'type': 'int',
                    'bounds': { 'min': 2, 'max': 63 }
                },
                {
                    'name': 'roc_lower',
                    'type': 'double',
                    'bounds': { 'min': 0.00, 'max': 0.30 }
                },
                {
                    'name': 'roc_width',
                    'type': 'double',
                    'bounds': { 'min': 0.05, 'max': 2.00 }
                },
                {
                    'name': 'rebalance_freq',
                    'type': 'int',
                    'bounds': { 'min': 3, 'max': 21 }
                },
            ],
        )

    for trial in range(samples):
        print("running trial: {0}".format(trial))
        suggestion = conn.experiments(experiment.id).suggestions().create()

        # Run the Zipline Algo with the SigOpt suggestion
        params_sugg = suggestion.assignments.to_json()
        print params_sugg
        
        signals = OrderedDict([
            ( 'rsi', {'func': talib.RSI, 'func_kwargs': {'timeperiod': params_sugg['rsi_timeperiod'] }, 
                           'lower': params_sugg['rsi_lower'],  'width': params_sugg['rsi_width']} ),
            ( 'roc', {'func': talib.ROCP, 'func_kwargs': {'timeperiod': params_sugg['roc_timeperiod'] }, 
                           'lower': params_sugg['roc_lower'], 'width': params_sugg['roc_width']} )  
            ])
        
        params_sugg['signals_input'] = signals
        algo_run = TradingAlgorithm(initialize=initialize_local_sigopt_rsi_roc, 
                                    handle_data=handle_data_local_sigopt_rsi_roc,
                                    **params_sugg
                                    )
        
        perf = algo_run.run(data)
        daily_rets = perf.portfolio_value.pct_change().dropna()
        
        if daily_rets.std() > 0:
            sharpe_ratio_calc = daily_rets.mean() / daily_rets.std() * np.sqrt(252)
        else:
            sharpe_ratio_calc = -999
        obj = sharpe_ratio_calc
        print obj      

        if obj < -900:
            print "*** Flagging as failed"
            conn.experiments(experiment.id).observations().create(
              assignments=suggestion.assignments,
              failed=True,
            )
        else:
            conn.experiments(experiment.id).observations().create(
              assignments=suggestion.assignments,
              value=obj,
            )

    exp_hist = conn.experiments(experiment.id).observations().fetch()
    exp_data = exp_hist.to_json()['data']
    exp_data.reverse() # start at the beginning

    # load up dataframe
    from collections import defaultdict
    sigopt_df_dict = defaultdict(list)
    for data_point in exp_data:
        for k, v in data_point['assignments'].iteritems():
            sigopt_df_dict[k].append(v)

        try:
            sigopt_df_dict['failed'].append(data_point['failed'])
        except:
            sigopt_df_dict['failed'].append(False)

        try:
            sigopt_df_dict['objective'].append(data_point['value'])
        except:
            sigopt_df_dict['objective'].append(-999)

    sigopt_df = pd.DataFrame(sigopt_df_dict)

    return sigopt_df

In [58]:
sigopt_df = run_sigopt_local_rsi_roc(samples=300,
                             experiment_id=None,
                             user_token=creds.user_token, 
                             client_token=creds.client_token, 
                             client_id=creds.client_id 
                            )


running trial: 0
{u'roc_timeperiod': 32, u'roc_lower': 0.1148092670590023, u'rsi_width': 29, u'rsi_timeperiod': 90, u'roc_width': 1.4373803958710658, u'rsi_lower': 16, u'rebalance_freq': 17}
rebal freq: 17
OrderedDict([('rsi', {'width': 29, 'lower': 16, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 90}}), ('roc', {'width': 1.4373803958710658, 'lower': 0.1148092670590023, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 32}})])
-999
*** Flagging as failed
running trial: 1
{u'roc_timeperiod': 61, u'roc_lower': 0.0844961145944925, u'rsi_width': 18, u'rsi_timeperiod': 62, u'roc_width': 1.1383156724686605, u'rsi_lower': 36, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 36, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 62}}), ('roc', {'width': 1.1383156724686605, 'lower': 0.0844961145944925, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 61}})])
0.296384194657
running trial: 2
{u'roc_timeperiod': 22, u'roc_lower': 0.22803406563195833, u'rsi_width': 12, u'rsi_timeperiod': 73, u'roc_width': 0.7191135230847453, u'rsi_lower': 65, u'rebalance_freq': 7}
rebal freq: 7
OrderedDict([('rsi', {'width': 12, 'lower': 65, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 73}}), ('roc', {'width': 0.7191135230847453, 'lower': 0.22803406563195833, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 22}})])
-999
*** Flagging as failed
running trial: 3
{u'roc_timeperiod': 2, u'roc_lower': 0.2731378920604743, u'rsi_width': 24, u'rsi_timeperiod': 98, u'roc_width': 1.978242597438841, u'rsi_lower': 23, u'rebalance_freq': 9}
rebal freq: 9
OrderedDict([('rsi', {'width': 24, 'lower': 23, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 98}}), ('roc', {'width': 1.978242597438841, 'lower': 0.2731378920604743, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 2}})])
-999
*** Flagging as failed
running trial: 4
{u'roc_timeperiod': 52, u'roc_lower': 0.00922338485484142, u'rsi_width': 25, u'rsi_timeperiod': 23, u'roc_width': 0.5269149378791749, u'rsi_lower': 74, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 25, 'lower': 74, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 23}}), ('roc', {'width': 0.5269149378791749, 'lower': 0.00922338485484142, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 52}})])
-999
*** Flagging as failed
running trial: 5
{u'roc_timeperiod': 17, u'roc_lower': 0.19331486969842795, u'rsi_width': 14, u'rsi_timeperiod': 39, u'roc_width': 1.5503892413558846, u'rsi_lower': 81, u'rebalance_freq': 5}
rebal freq: 5
OrderedDict([('rsi', {'width': 14, 'lower': 81, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 39}}), ('roc', {'width': 1.5503892413558846, 'lower': 0.19331486969842795, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 17}})])
-999
*** Flagging as failed
running trial: 6
{u'roc_timeperiod': 41, u'roc_lower': 0.1719860762888669, u'rsi_width': 20, u'rsi_timeperiod': 18, u'roc_width': 0.11655086301768874, u'rsi_lower': 10, u'rebalance_freq': 19}
rebal freq: 19
OrderedDict([('rsi', {'width': 20, 'lower': 10, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 18}}), ('roc', {'width': 0.11655086301768874, 'lower': 0.1719860762888669, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 41}})])
-999
*** Flagging as failed
running trial: 7
{u'roc_timeperiod': 35, u'roc_lower': 0.0628082531371578, u'rsi_width': 15, u'rsi_timeperiod': 121, u'roc_width': 0.9736839670494162, u'rsi_lower': 53, u'rebalance_freq': 10}
rebal freq: 10
OrderedDict([('rsi', {'width': 15, 'lower': 53, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 121}}), ('roc', {'width': 0.9736839670494162, 'lower': 0.0628082531371578, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 35}})])
-0.322010383406
running trial: 8
{u'roc_timeperiod': 56, u'roc_lower': 0.05890419535760426, u'rsi_width': 21, u'rsi_timeperiod': 84, u'roc_width': 1.2953802802619307, u'rsi_lower': 52, u'rebalance_freq': 9}
rebal freq: 9
OrderedDict([('rsi', {'width': 21, 'lower': 52, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 84}}), ('roc', {'width': 1.2953802802619307, 'lower': 0.05890419535760426, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 56}})])
-0.286484323504
running trial: 9
{u'roc_timeperiod': 62, u'roc_lower': 0.0950192172004, u'rsi_width': 18, u'rsi_timeperiod': 48, u'roc_width': 1.28594968173, u'rsi_lower': 36, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 36, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 48}}), ('roc', {'width': 1.28594968173, 'lower': 0.0950192172004, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 62}})])
0.0431522015222
running trial: 10
{u'roc_timeperiod': 62, u'roc_lower': 0.0905251058487, u'rsi_width': 19, u'rsi_timeperiod': 65, u'roc_width': 1.00334681373, u'rsi_lower': 36, u'rebalance_freq': 16}
rebal freq: 16
OrderedDict([('rsi', {'width': 19, 'lower': 36, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 65}}), ('roc', {'width': 1.00334681373, 'lower': 0.0905251058487, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 62}})])
0.00341989407519
running trial: 11
{u'roc_timeperiod': 60, u'roc_lower': 0.0742466839925, u'rsi_width': 17, u'rsi_timeperiod': 66, u'roc_width': 1.19222664123, u'rsi_lower': 36, u'rebalance_freq': 12}
rebal freq: 12
OrderedDict([('rsi', {'width': 17, 'lower': 36, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 66}}), ('roc', {'width': 1.19222664123, 'lower': 0.0742466839925, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 60}})])
0.275186103768
running trial: 12
{u'roc_timeperiod': 60, u'roc_lower': 0.0855485670482, u'rsi_width': 20, u'rsi_timeperiod': 64, u'roc_width': 1.19797579465, u'rsi_lower': 43, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 20, 'lower': 43, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 64}}), ('roc', {'width': 1.19797579465, 'lower': 0.0855485670482, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 60}})])
-0.208707587868
running trial: 13
{u'roc_timeperiod': 62, u'roc_lower': 0.0882125300343, u'rsi_width': 16, u'rsi_timeperiod': 61, u'roc_width': 1.08598524161, u'rsi_lower': 31, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 16, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 61}}), ('roc', {'width': 1.08598524161, 'lower': 0.0882125300343, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 62}})])
-999
*** Flagging as failed
running trial: 14
{u'roc_timeperiod': 59, u'roc_lower': 0.055349445266, u'rsi_width': 18, u'rsi_timeperiod': 66, u'roc_width': 1.29903729658, u'rsi_lower': 36, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 36, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 66}}), ('roc', {'width': 1.29903729658, 'lower': 0.055349445266, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 59}})])
-0.0856342869641
running trial: 15
{u'roc_timeperiod': 63, u'roc_lower': 0.0770284678528, u'rsi_width': 19, u'rsi_timeperiod': 58, u'roc_width': 1.09110259946, u'rsi_lower': 34, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 19, 'lower': 34, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 58}}), ('roc', {'width': 1.09110259946, 'lower': 0.0770284678528, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 63}})])
0.113588625349
running trial: 16
{u'roc_timeperiod': 56, u'roc_lower': 0.0800060615509, u'rsi_width': 18, u'rsi_timeperiod': 72, u'roc_width': 1.10097040991, u'rsi_lower': 38, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 18, 'lower': 38, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 72}}), ('roc', {'width': 1.10097040991, 'lower': 0.0800060615509, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 56}})])
0.0423878834545
running trial: 17
{u'roc_timeperiod': 63, u'roc_lower': 0.0967364895581, u'rsi_width': 18, u'rsi_timeperiod': 69, u'roc_width': 1.25240989165, u'rsi_lower': 38, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 38, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 69}}), ('roc', {'width': 1.25240989165, 'lower': 0.0967364895581, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 63}})])
-0.152850457939
running trial: 18
{u'roc_timeperiod': 59, u'roc_lower': 0.0764049154489, u'rsi_width': 18, u'rsi_timeperiod': 56, u'roc_width': 1.1009945256, u'rsi_lower': 43, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 43, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 56}}), ('roc', {'width': 1.1009945256, 'lower': 0.0764049154489, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 59}})])
-0.275611570227
running trial: 19
{u'roc_timeperiod': 58, u'roc_lower': 0.0924615435964, u'rsi_width': 19, u'rsi_timeperiod': 60, u'roc_width': 1.17692712608, u'rsi_lower': 31, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 1.17692712608, 'lower': 0.0924615435964, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.776285891713
running trial: 20
{u'roc_timeperiod': 58, u'roc_lower': 0.296181645068, u'rsi_width': 11, u'rsi_timeperiod': 56, u'roc_width': 0.73437937273, u'rsi_lower': 85, u'rebalance_freq': 19}
rebal freq: 19
OrderedDict([('rsi', {'width': 11, 'lower': 85, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 56}}), ('roc', {'width': 0.73437937273, 'lower': 0.296181645068, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
-999
*** Flagging as failed
running trial: 21
{u'roc_timeperiod': 59, u'roc_lower': 0.0677838140476, u'rsi_width': 16, u'rsi_timeperiod': 66, u'roc_width': 1.29421194311, u'rsi_lower': 36, u'rebalance_freq': 9}
rebal freq: 9
OrderedDict([('rsi', {'width': 16, 'lower': 36, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 66}}), ('roc', {'width': 1.29421194311, 'lower': 0.0677838140476, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 59}})])
-0.243354754021
running trial: 22
{u'roc_timeperiod': 60, u'roc_lower': 0.0766231698502, u'rsi_width': 20, u'rsi_timeperiod': 66, u'roc_width': 1.16773641765, u'rsi_lower': 23, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 20, 'lower': 23, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 66}}), ('roc', {'width': 1.16773641765, 'lower': 0.0766231698502, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 60}})])
-999
*** Flagging as failed
running trial: 23
{u'roc_timeperiod': 25, u'roc_lower': 0.131899720829, u'rsi_width': 23, u'rsi_timeperiod': 61, u'roc_width': 1.50351608871, u'rsi_lower': 89, u'rebalance_freq': 20}
rebal freq: 20
OrderedDict([('rsi', {'width': 23, 'lower': 89, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 61}}), ('roc', {'width': 1.50351608871, 'lower': 0.131899720829, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 25}})])
-999
*** Flagging as failed
running trial: 24
{u'roc_timeperiod': 57, u'roc_lower': 0.119191132405, u'rsi_width': 19, u'rsi_timeperiod': 53, u'roc_width': 1.11991952096, u'rsi_lower': 28, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 28, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 53}}), ('roc', {'width': 1.11991952096, 'lower': 0.119191132405, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 57}})])
-999
*** Flagging as failed
running trial: 25
{u'roc_timeperiod': 58, u'roc_lower': 0.0805957842667, u'rsi_width': 18, u'rsi_timeperiod': 73, u'roc_width': 0.734623188307, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 73}}), ('roc', {'width': 0.734623188307, 'lower': 0.0805957842667, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.736090359224
running trial: 26
{u'roc_timeperiod': 56, u'roc_lower': 0.0245196081598, u'rsi_width': 19, u'rsi_timeperiod': 58, u'roc_width': 1.2124074084, u'rsi_lower': 31, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 58}}), ('roc', {'width': 1.2124074084, 'lower': 0.0245196081598, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 56}})])
-0.407345982519
running trial: 27
{u'roc_timeperiod': 61, u'roc_lower': 0.116215396462, u'rsi_width': 17, u'rsi_timeperiod': 51, u'roc_width': 1.35711067723, u'rsi_lower': 40, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 17, 'lower': 40, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 51}}), ('roc', {'width': 1.35711067723, 'lower': 0.116215396462, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 61}})])
0.170172543718
running trial: 28
{u'roc_timeperiod': 14, u'roc_lower': 0.1980846975761057, u'rsi_width': 12, u'rsi_timeperiod': 73, u'roc_width': 0.7040273801421166, u'rsi_lower': 21, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 12, 'lower': 21, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 73}}), ('roc', {'width': 0.7040273801421166, 'lower': 0.1980846975761057, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 14}})])
-999
*** Flagging as failed
running trial: 29
{u'roc_timeperiod': 58, u'roc_lower': 0.0916536280798, u'rsi_width': 18, u'rsi_timeperiod': 48, u'roc_width': 1.45593195219, u'rsi_lower': 33, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 48}}), ('roc', {'width': 1.45593195219, 'lower': 0.0916536280798, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.224192253805
running trial: 30
{u'roc_timeperiod': 58, u'roc_lower': 0.081574629044, u'rsi_width': 19, u'rsi_timeperiod': 73, u'roc_width': 0.866592367621, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 73}}), ('roc', {'width': 0.866592367621, 'lower': 0.081574629044, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.79336563351
running trial: 31
{u'roc_timeperiod': 58, u'roc_lower': 0.0686352155935, u'rsi_width': 18, u'rsi_timeperiod': 74, u'roc_width': 0.764300465235, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 74}}), ('roc', {'width': 0.764300465235, 'lower': 0.0686352155935, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.832788193734
running trial: 32
{u'roc_timeperiod': 59, u'roc_lower': 0.070224720576, u'rsi_width': 19, u'rsi_timeperiod': 87, u'roc_width': 0.569830838899, u'rsi_lower': 31, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 87}}), ('roc', {'width': 0.569830838899, 'lower': 0.070224720576, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 59}})])
0.260122344497
running trial: 33
{u'roc_timeperiod': 58, u'roc_lower': 0.0409559045131, u'rsi_width': 18, u'rsi_timeperiod': 109, u'roc_width': 0.05, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 109}}), ('roc', {'width': 0.05, 'lower': 0.0409559045131, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.52516582284
running trial: 34
{u'roc_timeperiod': 58, u'roc_lower': 0.0909249473008, u'rsi_width': 19, u'rsi_timeperiod': 60, u'roc_width': 1.25027890837, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 1.25027890837, 'lower': 0.0909249473008, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.55669350398
running trial: 35
{u'roc_timeperiod': 58, u'roc_lower': 0.0655476515413, u'rsi_width': 19, u'rsi_timeperiod': 89, u'roc_width': 0.05, u'rsi_lower': 30, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 89}}), ('roc', {'width': 0.05, 'lower': 0.0655476515413, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.603638724703
running trial: 36
{u'roc_timeperiod': 58, u'roc_lower': 0.0565723203443, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 0.857076361146, u'rsi_lower': 32, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.857076361146, 'lower': 0.0565723203443, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
-0.0109758081186
running trial: 37
{u'roc_timeperiod': 58, u'roc_lower': 0.0527568819909, u'rsi_width': 17, u'rsi_timeperiod': 78, u'roc_width': 0.821388502928, u'rsi_lower': 32, u'rebalance_freq': 16}
rebal freq: 16
OrderedDict([('rsi', {'width': 17, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 78}}), ('roc', {'width': 0.821388502928, 'lower': 0.0527568819909, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.54248401227
running trial: 38
{u'roc_timeperiod': 58, u'roc_lower': 0.114539516759, u'rsi_width': 20, u'rsi_timeperiod': 49, u'roc_width': 1.44626902496, u'rsi_lower': 31, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 20, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 49}}), ('roc', {'width': 1.44626902496, 'lower': 0.114539516759, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
-999
*** Flagging as failed
running trial: 39
{u'roc_timeperiod': 58, u'roc_lower': 0.0794466423658, u'rsi_width': 18, u'rsi_timeperiod': 68, u'roc_width': 0.818887402435, u'rsi_lower': 31, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 68}}), ('roc', {'width': 0.818887402435, 'lower': 0.0794466423658, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.407699598033
running trial: 40
{u'roc_timeperiod': 58, u'roc_lower': 0.0, u'rsi_width': 18, u'rsi_timeperiod': 123, u'roc_width': 0.233668991614, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 123}}), ('roc', {'width': 0.233668991614, 'lower': 0.0, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.483018277599
running trial: 41
{u'roc_timeperiod': 58, u'roc_lower': 0.0069189560716, u'rsi_width': 17, u'rsi_timeperiod': 101, u'roc_width': 0.386671984684, u'rsi_lower': 31, u'rebalance_freq': 16}
rebal freq: 16
OrderedDict([('rsi', {'width': 17, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 101}}), ('roc', {'width': 0.386671984684, 'lower': 0.0069189560716, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.375750915892
running trial: 42
{u'roc_timeperiod': 51, u'roc_lower': 0.0678721090036, u'rsi_width': 19, u'rsi_timeperiod': 78, u'roc_width': 0.24939843343, u'rsi_lower': 30, u'rebalance_freq': 16}
rebal freq: 16
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 78}}), ('roc', {'width': 0.24939843343, 'lower': 0.0678721090036, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 51}})])
0.247676980999
running trial: 43
{u'roc_timeperiod': 63, u'roc_lower': 0.0695424924533, u'rsi_width': 18, u'rsi_timeperiod': 75, u'roc_width': 1.3824812369, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.3824812369, 'lower': 0.0695424924533, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 63}})])
0.146287449802
running trial: 44
{u'roc_timeperiod': 61, u'roc_lower': 0.0579682803646, u'rsi_width': 18, u'rsi_timeperiod': 97, u'roc_width': 0.05, u'rsi_lower': 26, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 26, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 97}}), ('roc', {'width': 0.05, 'lower': 0.0579682803646, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 61}})])
-999
*** Flagging as failed
running trial: 45
{u'roc_timeperiod': 40, u'roc_lower': 0.0264310293806, u'rsi_width': 19, u'rsi_timeperiod': 99, u'roc_width': 0.05, u'rsi_lower': 36, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 36, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 99}}), ('roc', {'width': 0.05, 'lower': 0.0264310293806, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 40}})])
0.164613445289
running trial: 46
{u'roc_timeperiod': 59, u'roc_lower': 0.0659192212594, u'rsi_width': 19, u'rsi_timeperiod': 90, u'roc_width': 0.05, u'rsi_lower': 34, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 34, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 90}}), ('roc', {'width': 0.05, 'lower': 0.0659192212594, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 59}})])
0.394021263036
running trial: 47
{u'roc_timeperiod': 53, u'roc_lower': 0.0705666802398, u'rsi_width': 18, u'rsi_timeperiod': 79, u'roc_width': 0.777379970463, u'rsi_lower': 31, u'rebalance_freq': 16}
rebal freq: 16
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 79}}), ('roc', {'width': 0.777379970463, 'lower': 0.0705666802398, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 53}})])
0.479706684697
running trial: 48
{u'roc_timeperiod': 63, u'roc_lower': 0.0603829272553, u'rsi_width': 17, u'rsi_timeperiod': 23, u'roc_width': 0.680558720451, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 17, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 23}}), ('roc', {'width': 0.680558720451, 'lower': 0.0603829272553, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 63}})])
0.124628141681
running trial: 49
{u'roc_timeperiod': 60, u'roc_lower': 0.0693311961775, u'rsi_width': 18, u'rsi_timeperiod': 126, u'roc_width': 0.879559784199, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 126}}), ('roc', {'width': 0.879559784199, 'lower': 0.0693311961775, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 60}})])
0.537205409492
running trial: 50
{u'roc_timeperiod': 42, u'roc_lower': 0.0672724053413, u'rsi_width': 19, u'rsi_timeperiod': 5, u'roc_width': 0.751149995649, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 5}}), ('roc', {'width': 0.751149995649, 'lower': 0.0672724053413, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 42}})])
0.000686877417427
running trial: 51
{u'roc_timeperiod': 63, u'roc_lower': 0.0688373310734, u'rsi_width': 18, u'rsi_timeperiod': 126, u'roc_width': 0.545278693489, u'rsi_lower': 33, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 126}}), ('roc', {'width': 0.545278693489, 'lower': 0.0688373310734, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 63}})])
0.192052955408
running trial: 52
{u'roc_timeperiod': 58, u'roc_lower': 0.0698533936418, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.67370087461, u'rsi_lower': 31, u'rebalance_freq': 16}
rebal freq: 16
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.67370087461, 'lower': 0.0698533936418, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.591806367702
running trial: 53
{u'roc_timeperiod': 58, u'roc_lower': 0.09448302614, u'rsi_width': 20, u'rsi_timeperiod': 69, u'roc_width': 1.40689422113, u'rsi_lower': 29, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 20, 'lower': 29, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 69}}), ('roc', {'width': 1.40689422113, 'lower': 0.09448302614, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.407699598033
running trial: 54
{u'roc_timeperiod': 58, u'roc_lower': 0.0665925207623, u'rsi_width': 18, u'rsi_timeperiod': 59, u'roc_width': 1.38844087554, u'rsi_lower': 33, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 59}}), ('roc', {'width': 1.38844087554, 'lower': 0.0665925207623, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.710104028809
running trial: 55
{u'roc_timeperiod': 58, u'roc_lower': 0.075277651721, u'rsi_width': 19, u'rsi_timeperiod': 97, u'roc_width': 0.05, u'rsi_lower': 30, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 97}}), ('roc', {'width': 0.05, 'lower': 0.075277651721, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.741515118654
running trial: 56
{u'roc_timeperiod': 58, u'roc_lower': 0.0286104144892, u'rsi_width': 18, u'rsi_timeperiod': 73, u'roc_width': 1.44615164547, u'rsi_lower': 34, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 34, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 73}}), ('roc', {'width': 1.44615164547, 'lower': 0.0286104144892, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.404309187699
running trial: 57
{u'roc_timeperiod': 58, u'roc_lower': 0.0910081523135, u'rsi_width': 18, u'rsi_timeperiod': 77, u'roc_width': 0.05, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 77}}), ('roc', {'width': 0.05, 'lower': 0.0910081523135, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.939148134103
running trial: 58
{u'roc_timeperiod': 57, u'roc_lower': 0.0858646784314, u'rsi_width': 18, u'rsi_timeperiod': 81, u'roc_width': 0.05, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 81}}), ('roc', {'width': 0.05, 'lower': 0.0858646784314, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 57}})])
0.316099374723
running trial: 59
{u'roc_timeperiod': 59, u'roc_lower': 0.0808951838129, u'rsi_width': 18, u'rsi_timeperiod': 126, u'roc_width': 1.76890061664, u'rsi_lower': 31, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 126}}), ('roc', {'width': 1.76890061664, 'lower': 0.0808951838129, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 59}})])
0.218707858988
running trial: 60
{u'roc_timeperiod': 58, u'roc_lower': 0.0, u'rsi_width': 18, u'rsi_timeperiod': 80, u'roc_width': 0.05, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 80}}), ('roc', {'width': 0.05, 'lower': 0.0, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
-0.212176701333
running trial: 61
{u'roc_timeperiod': 58, u'roc_lower': 0.0773600381305, u'rsi_width': 18, u'rsi_timeperiod': 79, u'roc_width': 0.05, u'rsi_lower': 33, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 79}}), ('roc', {'width': 0.05, 'lower': 0.0773600381305, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.482453578553
running trial: 62
{u'roc_timeperiod': 58, u'roc_lower': 0.0859374989484, u'rsi_width': 17, u'rsi_timeperiod': 77, u'roc_width': 0.05, u'rsi_lower': 26, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 17, 'lower': 26, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 77}}), ('roc', {'width': 0.05, 'lower': 0.0859374989484, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
-999
*** Flagging as failed
running trial: 63
{u'roc_timeperiod': 58, u'roc_lower': 0.13119630017, u'rsi_width': 19, u'rsi_timeperiod': 77, u'roc_width': 0.05, u'rsi_lower': 55, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 55, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 77}}), ('roc', {'width': 0.05, 'lower': 0.13119630017, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
-0.24407328919
running trial: 64
{u'roc_timeperiod': 58, u'roc_lower': 0.0301304523525, u'rsi_width': 17, u'rsi_timeperiod': 79, u'roc_width': 1.9973571249, u'rsi_lower': 49, u'rebalance_freq': 17}
rebal freq: 17
OrderedDict([('rsi', {'width': 17, 'lower': 49, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 79}}), ('roc', {'width': 1.9973571249, 'lower': 0.0301304523525, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.173230027371
running trial: 65
{u'roc_timeperiod': 58, u'roc_lower': 0.095488678804, u'rsi_width': 19, u'rsi_timeperiod': 77, u'roc_width': 0.05, u'rsi_lower': 37, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 37, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 77}}), ('roc', {'width': 0.05, 'lower': 0.095488678804, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.538566915691
running trial: 66
{u'roc_timeperiod': 58, u'roc_lower': 0.104218405558, u'rsi_width': 19, u'rsi_timeperiod': 59, u'roc_width': 1.05829612948, u'rsi_lower': 32, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 59}}), ('roc', {'width': 1.05829612948, 'lower': 0.104218405558, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.776285891713
running trial: 67
{u'roc_timeperiod': 58, u'roc_lower': 0.0874261690672, u'rsi_width': 18, u'rsi_timeperiod': 89, u'roc_width': 0.05, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 89}}), ('roc', {'width': 0.05, 'lower': 0.0874261690672, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.32930683396
running trial: 68
{u'roc_timeperiod': 58, u'roc_lower': 0.0970812025412, u'rsi_width': 17, u'rsi_timeperiod': 56, u'roc_width': 0.05, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 17, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 56}}), ('roc', {'width': 0.05, 'lower': 0.0970812025412, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
-999
*** Flagging as failed
running trial: 69
{u'roc_timeperiod': 58, u'roc_lower': 0.110391959253, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.0582654631143, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.0582654631143, 'lower': 0.110391959253, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.736090359224
running trial: 70
{u'roc_timeperiod': 58, u'roc_lower': 0.0916711899834, u'rsi_width': 18, u'rsi_timeperiod': 62, u'roc_width': 1.14735666032, u'rsi_lower': 34, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 34, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 62}}), ('roc', {'width': 1.14735666032, 'lower': 0.0916711899834, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.197190987875
running trial: 71
{u'roc_timeperiod': 58, u'roc_lower': 0.100551033614, u'rsi_width': 18, u'rsi_timeperiod': 75, u'roc_width': 0.05, u'rsi_lower': 33, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.05, 'lower': 0.100551033614, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.883286455707
running trial: 72
{u'roc_timeperiod': 58, u'roc_lower': 0.0860966801832, u'rsi_width': 20, u'rsi_timeperiod': 78, u'roc_width': 0.05, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 20, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 78}}), ('roc', {'width': 0.05, 'lower': 0.0860966801832, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.502251565998
running trial: 73
{u'roc_timeperiod': 58, u'roc_lower': 0.0645758848505, u'rsi_width': 18, u'rsi_timeperiod': 70, u'roc_width': 1.08184684035, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 70}}), ('roc', {'width': 1.08184684035, 'lower': 0.0645758848505, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.832788193734
running trial: 74
{u'roc_timeperiod': 58, u'roc_lower': 0.0579134258975, u'rsi_width': 19, u'rsi_timeperiod': 97, u'roc_width': 0.05, u'rsi_lower': 29, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 29, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 97}}), ('roc', {'width': 0.05, 'lower': 0.0579134258975, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.626398515563
running trial: 75
{u'roc_timeperiod': 58, u'roc_lower': 0.0963138227125, u'rsi_width': 18, u'rsi_timeperiod': 78, u'roc_width': 0.0646342962157, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 78}}), ('roc', {'width': 0.0646342962157, 'lower': 0.0963138227125, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.502251565998
running trial: 76
{u'roc_timeperiod': 58, u'roc_lower': 0.0882768317903, u'rsi_width': 18, u'rsi_timeperiod': 70, u'roc_width': 0.05, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 70}}), ('roc', {'width': 0.05, 'lower': 0.0882768317903, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.32930683396
running trial: 77
{u'roc_timeperiod': 58, u'roc_lower': 0.0769041765886, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.109920094361, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.109920094361, 'lower': 0.0769041765886, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.983439526744
running trial: 78
{u'roc_timeperiod': 58, u'roc_lower': 0.061580098722, u'rsi_width': 19, u'rsi_timeperiod': 72, u'roc_width': 2.0, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 72}}), ('roc', {'width': 2.0, 'lower': 0.061580098722, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.653842012422
running trial: 79
{u'roc_timeperiod': 58, u'roc_lower': 0.0869078977485, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 0.408048768236, u'rsi_lower': 33, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.408048768236, 'lower': 0.0869078977485, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.930664518778
running trial: 80
{u'roc_timeperiod': 58, u'roc_lower': 0.0468924997288, u'rsi_width': 17, u'rsi_timeperiod': 69, u'roc_width': 1.03126770215, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 17, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 69}}), ('roc', {'width': 1.03126770215, 'lower': 0.0468924997288, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.578854816386
running trial: 81
{u'roc_timeperiod': 58, u'roc_lower': 0.060767816319, u'rsi_width': 19, u'rsi_timeperiod': 73, u'roc_width': 0.895795018615, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 73}}), ('roc', {'width': 0.895795018615, 'lower': 0.060767816319, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.729319631006
running trial: 82
{u'roc_timeperiod': 58, u'roc_lower': 0.0842705124788, u'rsi_width': 20, u'rsi_timeperiod': 59, u'roc_width': 1.6477725208, u'rsi_lower': 30, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 20, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 59}}), ('roc', {'width': 1.6477725208, 'lower': 0.0842705124788, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.224192253805
running trial: 83
{u'roc_timeperiod': 58, u'roc_lower': 0.0824060575488, u'rsi_width': 18, u'rsi_timeperiod': 77, u'roc_width': 0.05, u'rsi_lower': 33, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 77}}), ('roc', {'width': 0.05, 'lower': 0.0824060575488, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.580406092501
running trial: 84
{u'roc_timeperiod': 58, u'roc_lower': 0.0735975100807, u'rsi_width': 18, u'rsi_timeperiod': 74, u'roc_width': 1.34296813626, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 74}}), ('roc', {'width': 1.34296813626, 'lower': 0.0735975100807, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.84451677802
running trial: 85
{u'roc_timeperiod': 58, u'roc_lower': 0.0871458384877, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 0.523767527677, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.523767527677, 'lower': 0.0871458384877, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.938258190484
running trial: 86
{u'roc_timeperiod': 58, u'roc_lower': 0.0915056052511, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 0.05, u'rsi_lower': 34, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 34, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.05, 'lower': 0.0915056052511, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.582542829275
running trial: 87
{u'roc_timeperiod': 58, u'roc_lower': 0.0826347068017, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 0.05, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.05, 'lower': 0.0826347068017, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.822930306749
running trial: 88
{u'roc_timeperiod': 58, u'roc_lower': 0.0939266841426, u'rsi_width': 18, u'rsi_timeperiod': 60, u'roc_width': 0.462572461365, u'rsi_lower': 32, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 0.462572461365, 'lower': 0.0939266841426, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.776285891713
running trial: 89
{u'roc_timeperiod': 58, u'roc_lower': 0.0750950300876, u'rsi_width': 19, u'rsi_timeperiod': 77, u'roc_width': 0.05, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 77}}), ('roc', {'width': 0.05, 'lower': 0.0750950300876, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.608132497431
running trial: 90
{u'roc_timeperiod': 58, u'roc_lower': 0.083606079985, u'rsi_width': 20, u'rsi_timeperiod': 60, u'roc_width': 2.0, u'rsi_lower': 32, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 20, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 2.0, 'lower': 0.083606079985, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.460022295691
running trial: 91
{u'roc_timeperiod': 58, u'roc_lower': 0.0854272437141, u'rsi_width': 18, u'rsi_timeperiod': 75, u'roc_width': 0.660548427464, u'rsi_lower': 33, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.660548427464, 'lower': 0.0854272437141, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.950974399658
running trial: 92
{u'roc_timeperiod': 58, u'roc_lower': 0.0719150664579, u'rsi_width': 18, u'rsi_timeperiod': 59, u'roc_width': 0.682600648675, u'rsi_lower': 32, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 59}}), ('roc', {'width': 0.682600648675, 'lower': 0.0719150664579, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.68936355513
running trial: 93
{u'roc_timeperiod': 58, u'roc_lower': 0.0842306234264, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 0.226494262634, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.226494262634, 'lower': 0.0842306234264, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.863114101646
running trial: 94
{u'roc_timeperiod': 58, u'roc_lower': 0.0572981029053, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 0.332202842837, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.332202842837, 'lower': 0.0572981029053, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.76867616353
running trial: 95
{u'roc_timeperiod': 58, u'roc_lower': 0.0731437790397, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 0.05, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.05, 'lower': 0.0731437790397, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.834307203277
running trial: 96
{u'roc_timeperiod': 58, u'roc_lower': 0.112653775495, u'rsi_width': 19, u'rsi_timeperiod': 60, u'roc_width': 1.58890514008, u'rsi_lower': 31, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 1.58890514008, 'lower': 0.112653775495, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.776285891713
running trial: 97
{u'roc_timeperiod': 58, u'roc_lower': 0.102380087565, u'rsi_width': 19, u'rsi_timeperiod': 77, u'roc_width': 0.05, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 77}}), ('roc', {'width': 0.05, 'lower': 0.102380087565, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.888949502771
running trial: 98
{u'roc_timeperiod': 58, u'roc_lower': 0.045790026739, u'rsi_width': 18, u'rsi_timeperiod': 70, u'roc_width': 2.0, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 70}}), ('roc', {'width': 2.0, 'lower': 0.045790026739, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.578854816386
running trial: 99
{u'roc_timeperiod': 58, u'roc_lower': 0.0825583378435, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.252452451944, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.252452451944, 'lower': 0.0825583378435, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.938258190484
running trial: 100
{u'roc_timeperiod': 58, u'roc_lower': 0.0593584409278, u'rsi_width': 20, u'rsi_timeperiod': 76, u'roc_width': 1.62440791181, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 20, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 1.62440791181, 'lower': 0.0593584409278, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.843567336358
running trial: 101
{u'roc_timeperiod': 58, u'roc_lower': 0.069683349804, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.05, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.05, 'lower': 0.069683349804, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.608604874683
running trial: 102
{u'roc_timeperiod': 58, u'roc_lower': 0.0727224038191, u'rsi_width': 17, u'rsi_timeperiod': 97, u'roc_width': 1.3631015076, u'rsi_lower': 30, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 17, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 97}}), ('roc', {'width': 1.3631015076, 'lower': 0.0727224038191, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.741150977102
running trial: 103
{u'roc_timeperiod': 58, u'roc_lower': 0.0785929426029, u'rsi_width': 19, u'rsi_timeperiod': 72, u'roc_width': 1.78561555634, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 72}}), ('roc', {'width': 1.78561555634, 'lower': 0.0785929426029, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.654304125492
running trial: 104
{u'roc_timeperiod': 58, u'roc_lower': 0.0611766316331, u'rsi_width': 19, u'rsi_timeperiod': 90, u'roc_width': 1.77483401216, u'rsi_lower': 31, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 90}}), ('roc', {'width': 1.77483401216, 'lower': 0.0611766316331, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.437929798306
running trial: 105
{u'roc_timeperiod': 58, u'roc_lower': 0.0718023953391, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.05, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.05, 'lower': 0.0718023953391, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.71723729937
running trial: 106
{u'roc_timeperiod': 58, u'roc_lower': 0.0743056423866, u'rsi_width': 19, u'rsi_timeperiod': 90, u'roc_width': 0.839894103673, u'rsi_lower': 29, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 29, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 90}}), ('roc', {'width': 0.839894103673, 'lower': 0.0743056423866, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.78677114826
running trial: 107
{u'roc_timeperiod': 58, u'roc_lower': 0.102083544948, u'rsi_width': 20, u'rsi_timeperiod': 60, u'roc_width': 1.30472201501, u'rsi_lower': 32, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 20, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 1.30472201501, 'lower': 0.102083544948, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.795865439658
running trial: 108
{u'roc_timeperiod': 58, u'roc_lower': 0.0608123899645, u'rsi_width': 17, u'rsi_timeperiod': 74, u'roc_width': 0.05, u'rsi_lower': 33, u'rebalance_freq': 16}
rebal freq: 16
OrderedDict([('rsi', {'width': 17, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 74}}), ('roc', {'width': 0.05, 'lower': 0.0608123899645, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.186531754032
running trial: 109
{u'roc_timeperiod': 58, u'roc_lower': 0.104987013208, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 0.0504366133898, u'rsi_lower': 24, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 24, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.0504366133898, 'lower': 0.104987013208, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
-999
*** Flagging as failed
running trial: 110
{u'roc_timeperiod': 58, u'roc_lower': 0.0618219098434, u'rsi_width': 18, u'rsi_timeperiod': 69, u'roc_width': 1.00928983769, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 69}}), ('roc', {'width': 1.00928983769, 'lower': 0.0618219098434, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.381240225866
running trial: 111
{u'roc_timeperiod': 58, u'roc_lower': 0.0792153660947, u'rsi_width': 18, u'rsi_timeperiod': 75, u'roc_width': 0.369516137993, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.369516137993, 'lower': 0.0792153660947, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 112
{u'roc_timeperiod': 58, u'roc_lower': 0.0665653892923, u'rsi_width': 18, u'rsi_timeperiod': 71, u'roc_width': 0.230140750794, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 71}}), ('roc', {'width': 0.230140750794, 'lower': 0.0665653892923, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.832788193734
running trial: 113
{u'roc_timeperiod': 58, u'roc_lower': 0.102126136713, u'rsi_width': 19, u'rsi_timeperiod': 60, u'roc_width': 1.18047954644, u'rsi_lower': 31, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 1.18047954644, 'lower': 0.102126136713, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.776285891713
running trial: 114
{u'roc_timeperiod': 58, u'roc_lower': 0.0952665526919, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 0.05, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.05, 'lower': 0.0952665526919, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.888949502771
running trial: 115
{u'roc_timeperiod': 58, u'roc_lower': 0.0782244616309, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.431218579947, u'rsi_lower': 29, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 29, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.431218579947, 'lower': 0.0782244616309, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 116
{u'roc_timeperiod': 57, u'roc_lower': 0.0668687510866, u'rsi_width': 19, u'rsi_timeperiod': 97, u'roc_width': 0.50855637589, u'rsi_lower': 30, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 97}}), ('roc', {'width': 0.50855637589, 'lower': 0.0668687510866, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 57}})])
0.652192991559
running trial: 117
{u'roc_timeperiod': 58, u'roc_lower': 0.0786026114365, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.05, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.05, 'lower': 0.0786026114365, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.914477152282
running trial: 118
{u'roc_timeperiod': 58, u'roc_lower': 0.105338463307, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.05, u'rsi_lower': 34, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 34, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.05, 'lower': 0.105338463307, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.165907646246
running trial: 119
{u'roc_timeperiod': 58, u'roc_lower': 0.0739301174981, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 2.0, u'rsi_lower': 36, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 36, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 2.0, 'lower': 0.0739301174981, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.386592945956
running trial: 120
{u'roc_timeperiod': 58, u'roc_lower': 0.101859955737, u'rsi_width': 20, u'rsi_timeperiod': 78, u'roc_width': 0.05, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 20, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 78}}), ('roc', {'width': 0.05, 'lower': 0.101859955737, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.458799206378
running trial: 121
{u'roc_timeperiod': 58, u'roc_lower': 0.0988352032733, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.05, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.05, 'lower': 0.0988352032733, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.888949502771
running trial: 122
{u'roc_timeperiod': 58, u'roc_lower': 0.0758932743068, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 0.844226777909, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.844226777909, 'lower': 0.0758932743068, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 123
{u'roc_timeperiod': 58, u'roc_lower': 0.0763914546911, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 1.10074817426, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 1.10074817426, 'lower': 0.0763914546911, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.983439526744
running trial: 124
{u'roc_timeperiod': 58, u'roc_lower': 0.0738413064306, u'rsi_width': 18, u'rsi_timeperiod': 75, u'roc_width': 0.0583131798635, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.0583131798635, 'lower': 0.0738413064306, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.834307203277
running trial: 125
{u'roc_timeperiod': 58, u'roc_lower': 0.0839428487979, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 1.54262774482, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 1.54262774482, 'lower': 0.0839428487979, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.938258190484
running trial: 126
{u'roc_timeperiod': 57, u'roc_lower': 0.0710109958457, u'rsi_width': 18, u'rsi_timeperiod': 73, u'roc_width': 0.969217372508, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 73}}), ('roc', {'width': 0.969217372508, 'lower': 0.0710109958457, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 57}})])
0.518361236053
running trial: 127
{u'roc_timeperiod': 58, u'roc_lower': 0.062084572654, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 0.883908257215, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.883908257215, 'lower': 0.062084572654, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.860058310989
running trial: 128
{u'roc_timeperiod': 58, u'roc_lower': 0.0599049082438, u'rsi_width': 20, u'rsi_timeperiod': 75, u'roc_width': 1.28928865548, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 20, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.28928865548, 'lower': 0.0599049082438, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.860058310989
running trial: 129
{u'roc_timeperiod': 58, u'roc_lower': 0.0996157945951, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 0.05, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.05, 'lower': 0.0996157945951, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.888949502771
running trial: 130
{u'roc_timeperiod': 58, u'roc_lower': 0.106660672529, u'rsi_width': 19, u'rsi_timeperiod': 60, u'roc_width': 1.37456514057, u'rsi_lower': 32, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 1.37456514057, 'lower': 0.106660672529, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.776285891713
running trial: 131
{u'roc_timeperiod': 58, u'roc_lower': 0.0876717824104, u'rsi_width': 19, u'rsi_timeperiod': 77, u'roc_width': 0.05, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 77}}), ('roc', {'width': 0.05, 'lower': 0.0876717824104, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.580406092501
running trial: 132
{u'roc_timeperiod': 58, u'roc_lower': 0.0902786350573, u'rsi_width': 17, u'rsi_timeperiod': 76, u'roc_width': 0.05, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 17, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.05, 'lower': 0.0902786350573, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.822930306749
running trial: 133
{u'roc_timeperiod': 58, u'roc_lower': 0.0640863567405, u'rsi_width': 18, u'rsi_timeperiod': 71, u'roc_width': 0.442783173516, u'rsi_lower': 33, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 71}}), ('roc', {'width': 0.442783173516, 'lower': 0.0640863567405, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.414437135879
running trial: 134
{u'roc_timeperiod': 58, u'roc_lower': 0.0706351603078, u'rsi_width': 19, u'rsi_timeperiod': 97, u'roc_width': 0.949026722959, u'rsi_lower': 30, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 97}}), ('roc', {'width': 0.949026722959, 'lower': 0.0706351603078, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.460912585272
running trial: 135
{u'roc_timeperiod': 58, u'roc_lower': 0.084193081322, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 0.0518587639751, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.0518587639751, 'lower': 0.084193081322, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.888949502771
running trial: 136
{u'roc_timeperiod': 58, u'roc_lower': 0.0882348753594, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 2.0, u'rsi_lower': 34, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 34, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 2.0, 'lower': 0.0882348753594, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.552725393164
running trial: 137
{u'roc_timeperiod': 58, u'roc_lower': 0.0845976948896, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 1.41911795292, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 1.41911795292, 'lower': 0.0845976948896, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.938258190484
running trial: 138
{u'roc_timeperiod': 58, u'roc_lower': 0.076456166725, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 0.512446560605, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.512446560605, 'lower': 0.076456166725, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 139
{u'roc_timeperiod': 58, u'roc_lower': 0.0669133259809, u'rsi_width': 18, u'rsi_timeperiod': 71, u'roc_width': 1.17564211004, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 71}}), ('roc', {'width': 1.17564211004, 'lower': 0.0669133259809, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.832788193734
running trial: 140
{u'roc_timeperiod': 58, u'roc_lower': 0.10427461919, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.05, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.05, 'lower': 0.10427461919, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.822930306749
running trial: 141
{u'roc_timeperiod': 58, u'roc_lower': 0.0679948141589, u'rsi_width': 18, u'rsi_timeperiod': 70, u'roc_width': 0.517600562925, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 70}}), ('roc', {'width': 0.517600562925, 'lower': 0.0679948141589, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.832788193734
running trial: 142
{u'roc_timeperiod': 58, u'roc_lower': 0.0983482623098, u'rsi_width': 19, u'rsi_timeperiod': 60, u'roc_width': 1.01153257121, u'rsi_lower': 32, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 1.01153257121, 'lower': 0.0983482623098, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.776285891713
running trial: 143
{u'roc_timeperiod': 58, u'roc_lower': 0.0822198304314, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 0.917861828528, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.917861828528, 'lower': 0.0822198304314, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.863114101646
running trial: 144
{u'roc_timeperiod': 58, u'roc_lower': 0.0750455381591, u'rsi_width': 17, u'rsi_timeperiod': 97, u'roc_width': 0.252937332486, u'rsi_lower': 30, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 17, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 97}}), ('roc', {'width': 0.252937332486, 'lower': 0.0750455381591, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.741150977102
running trial: 145
{u'roc_timeperiod': 58, u'roc_lower': 0.0760548213416, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.564544365462, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.564544365462, 'lower': 0.0760548213416, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.978776031181
running trial: 146
{u'roc_timeperiod': 58, u'roc_lower': 0.0764551721924, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.464758854584, u'rsi_lower': 31, u'rebalance_freq': 16}
rebal freq: 16
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.464758854584, 'lower': 0.0764551721924, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.663801879125
running trial: 147
{u'roc_timeperiod': 58, u'roc_lower': 0.106407835475, u'rsi_width': 20, u'rsi_timeperiod': 60, u'roc_width': 1.28693496071, u'rsi_lower': 31, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 20, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 1.28693496071, 'lower': 0.106407835475, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.916075747319
running trial: 148
{u'roc_timeperiod': 58, u'roc_lower': 0.0706450780048, u'rsi_width': 18, u'rsi_timeperiod': 90, u'roc_width': 0.856587204785, u'rsi_lower': 30, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 90}}), ('roc', {'width': 0.856587204785, 'lower': 0.0706450780048, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.78677114826
running trial: 149
{u'roc_timeperiod': 58, u'roc_lower': 0.0829185770777, u'rsi_width': 18, u'rsi_timeperiod': 75, u'roc_width': 1.0530327303, u'rsi_lower': 33, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.0530327303, 'lower': 0.0829185770777, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.950974399658
running trial: 150
{u'roc_timeperiod': 58, u'roc_lower': 0.0685620762192, u'rsi_width': 19, u'rsi_timeperiod': 73, u'roc_width': 1.26134170714, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 73}}), ('roc', {'width': 1.26134170714, 'lower': 0.0685620762192, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.775165358116
running trial: 151
{u'roc_timeperiod': 58, u'roc_lower': 0.0990338050591, u'rsi_width': 18, u'rsi_timeperiod': 75, u'roc_width': 0.05, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.05, 'lower': 0.0990338050591, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.822930306749
running trial: 152
{u'roc_timeperiod': 58, u'roc_lower': 0.106430538508, u'rsi_width': 20, u'rsi_timeperiod': 59, u'roc_width': 1.32575082161, u'rsi_lower': 31, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 20, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 59}}), ('roc', {'width': 1.32575082161, 'lower': 0.106430538508, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.916075747319
running trial: 153
{u'roc_timeperiod': 58, u'roc_lower': 0.0941706308701, u'rsi_width': 18, u'rsi_timeperiod': 77, u'roc_width': 0.05, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 77}}), ('roc', {'width': 0.05, 'lower': 0.0941706308701, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.647549669667
running trial: 154
{u'roc_timeperiod': 58, u'roc_lower': 0.0759721997198, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.398945100872, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.398945100872, 'lower': 0.0759721997198, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.983439526744
running trial: 155
{u'roc_timeperiod': 58, u'roc_lower': 0.0780635510335, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 2.0, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 2.0, 'lower': 0.0780635510335, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.983439526744
running trial: 156
{u'roc_timeperiod': 58, u'roc_lower': 0.0659413605762, u'rsi_width': 19, u'rsi_timeperiod': 70, u'roc_width': 0.669913471368, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 70}}), ('roc', {'width': 0.669913471368, 'lower': 0.0659413605762, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.832788193734
running trial: 157
{u'roc_timeperiod': 58, u'roc_lower': 0.0980253189888, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.05, u'rsi_lower': 33, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.05, 'lower': 0.0980253189888, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.633582805152
running trial: 158
{u'roc_timeperiod': 58, u'roc_lower': 0.0771768495774, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 1.59684793037, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 1.59684793037, 'lower': 0.0771768495774, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.983439526744
running trial: 159
{u'roc_timeperiod': 58, u'roc_lower': 0.0846313775317, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 2.0, u'rsi_lower': 33, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 2.0, 'lower': 0.0846313775317, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.922558146524
running trial: 160
{u'roc_timeperiod': 58, u'roc_lower': 0.0593720338155, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 0.520524506989, u'rsi_lower': 30, u'rebalance_freq': 16}
rebal freq: 16
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.520524506989, 'lower': 0.0593720338155, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.638228322522
running trial: 161
{u'roc_timeperiod': 58, u'roc_lower': 0.105399423956, u'rsi_width': 20, u'rsi_timeperiod': 59, u'roc_width': 2.0, u'rsi_lower': 31, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 20, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 59}}), ('roc', {'width': 2.0, 'lower': 0.105399423956, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.776285891713
running trial: 162
{u'roc_timeperiod': 58, u'roc_lower': 0.0705692616012, u'rsi_width': 20, u'rsi_timeperiod': 90, u'roc_width': 0.586243719584, u'rsi_lower': 29, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 20, 'lower': 29, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 90}}), ('roc', {'width': 0.586243719584, 'lower': 0.0705692616012, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.760232147599
running trial: 163
{u'roc_timeperiod': 58, u'roc_lower': 0.0919389761527, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 0.05, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.05, 'lower': 0.0919389761527, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.888949502771
running trial: 164
{u'roc_timeperiod': 58, u'roc_lower': 0.0826919772764, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 2.0, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 2.0, 'lower': 0.0826919772764, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.863114101646
running trial: 165
{u'roc_timeperiod': 58, u'roc_lower': 0.10523301419, u'rsi_width': 19, u'rsi_timeperiod': 60, u'roc_width': 1.57648591155, u'rsi_lower': 31, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 1.57648591155, 'lower': 0.10523301419, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.916075747319
running trial: 166
{u'roc_timeperiod': 58, u'roc_lower': 0.059731662535, u'rsi_width': 18, u'rsi_timeperiod': 75, u'roc_width': 0.05, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.05, 'lower': 0.059731662535, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.511631176995
running trial: 167
{u'roc_timeperiod': 58, u'roc_lower': 0.102746878192, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.781870275373, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.781870275373, 'lower': 0.102746878192, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.938258190484
running trial: 168
{u'roc_timeperiod': 58, u'roc_lower': 0.108415970608, u'rsi_width': 19, u'rsi_timeperiod': 59, u'roc_width': 0.680890902834, u'rsi_lower': 31, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 59}}), ('roc', {'width': 0.680890902834, 'lower': 0.108415970608, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.916075747319
running trial: 169
{u'roc_timeperiod': 58, u'roc_lower': 0.105001648483, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 0.05, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.05, 'lower': 0.105001648483, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.822930306749
running trial: 170
{u'roc_timeperiod': 58, u'roc_lower': 0.0660465725456, u'rsi_width': 18, u'rsi_timeperiod': 70, u'roc_width': 2.0, u'rsi_lower': 30, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 70}}), ('roc', {'width': 2.0, 'lower': 0.0660465725456, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.526118179776
running trial: 171
{u'roc_timeperiod': 58, u'roc_lower': 0.0595962782797, u'rsi_width': 20, u'rsi_timeperiod': 75, u'roc_width': 0.962787477979, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 20, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.962787477979, 'lower': 0.0595962782797, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.665552050278
running trial: 172
{u'roc_timeperiod': 58, u'roc_lower': 0.101720769934, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.05, u'rsi_lower': 31, u'rebalance_freq': 16}
rebal freq: 16
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.05, 'lower': 0.101720769934, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.357431157949
running trial: 173
{u'roc_timeperiod': 58, u'roc_lower': 0.101932094686, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.206638623991, u'rsi_lower': 31, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.206638623991, 'lower': 0.101932094686, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.407699598033
running trial: 174
{u'roc_timeperiod': 58, u'roc_lower': 0.104836899906, u'rsi_width': 19, u'rsi_timeperiod': 77, u'roc_width': 2.0, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 77}}), ('roc', {'width': 2.0, 'lower': 0.104836899906, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.938258190484
running trial: 175
{u'roc_timeperiod': 58, u'roc_lower': 0.06581128707, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 1.58184926397, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.58184926397, 'lower': 0.06581128707, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 176
{u'roc_timeperiod': 58, u'roc_lower': 0.0927159354337, u'rsi_width': 18, u'rsi_timeperiod': 77, u'roc_width': 2.0, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 77}}), ('roc', {'width': 2.0, 'lower': 0.0927159354337, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.981029981719
running trial: 177
{u'roc_timeperiod': 58, u'roc_lower': 0.0713020752223, u'rsi_width': 18, u'rsi_timeperiod': 89, u'roc_width': 0.370904876564, u'rsi_lower': 29, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 29, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 89}}), ('roc', {'width': 0.370904876564, 'lower': 0.0713020752223, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.761181371291
running trial: 178
{u'roc_timeperiod': 58, u'roc_lower': 0.106517415593, u'rsi_width': 19, u'rsi_timeperiod': 59, u'roc_width': 0.557230713299, u'rsi_lower': 31, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 59}}), ('roc', {'width': 0.557230713299, 'lower': 0.106517415593, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.916075747319
running trial: 179
{u'roc_timeperiod': 58, u'roc_lower': 0.0636716826365, u'rsi_width': 20, u'rsi_timeperiod': 75, u'roc_width': 1.51419631313, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 20, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.51419631313, 'lower': 0.0636716826365, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.860058310989
running trial: 180
{u'roc_timeperiod': 57, u'roc_lower': 0.0737407396175, u'rsi_width': 18, u'rsi_timeperiod': 97, u'roc_width': 1.08756441351, u'rsi_lower': 30, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 97}}), ('roc', {'width': 1.08756441351, 'lower': 0.0737407396175, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 57}})])
0.743113155741
running trial: 181
{u'roc_timeperiod': 58, u'roc_lower': 0.0761091726953, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.05, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.05, 'lower': 0.0761091726953, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.834307203277
running trial: 182
{u'roc_timeperiod': 58, u'roc_lower': 0.0790052650866, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 0.726709806868, u'rsi_lower': 28, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 28, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.726709806868, 'lower': 0.0790052650866, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.698861750531
running trial: 183
{u'roc_timeperiod': 58, u'roc_lower': 0.0851507301763, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 2.0, u'rsi_lower': 33, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 2.0, 'lower': 0.0851507301763, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.930664518778
running trial: 184
{u'roc_timeperiod': 58, u'roc_lower': 0.106284676773, u'rsi_width': 21, u'rsi_timeperiod': 76, u'roc_width': 1.04550620872, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 21, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 1.04550620872, 'lower': 0.106284676773, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.45747729645
running trial: 185
{u'roc_timeperiod': 57, u'roc_lower': 0.0717706309688, u'rsi_width': 19, u'rsi_timeperiod': 90, u'roc_width': 0.05, u'rsi_lower': 30, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 90}}), ('roc', {'width': 0.05, 'lower': 0.0717706309688, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 57}})])
-0.0589865526629
running trial: 186
{u'roc_timeperiod': 59, u'roc_lower': 0.0660132901116, u'rsi_width': 18, u'rsi_timeperiod': 70, u'roc_width': 0.998528803548, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 70}}), ('roc', {'width': 0.998528803548, 'lower': 0.0660132901116, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 59}})])
0.254922697689
running trial: 187
{u'roc_timeperiod': 59, u'roc_lower': 0.0710302722614, u'rsi_width': 18, u'rsi_timeperiod': 90, u'roc_width': 1.51440163603, u'rsi_lower': 29, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 29, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 90}}), ('roc', {'width': 1.51440163603, 'lower': 0.0710302722614, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 59}})])
0.502742669448
running trial: 188
{u'roc_timeperiod': 57, u'roc_lower': 0.0653822198111, u'rsi_width': 19, u'rsi_timeperiod': 70, u'roc_width': 1.64144483319, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 70}}), ('roc', {'width': 1.64144483319, 'lower': 0.0653822198111, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 57}})])
0.259222667574
running trial: 189
{u'roc_timeperiod': 57, u'roc_lower': 0.0763872106218, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.818372940469, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.818372940469, 'lower': 0.0763872106218, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 57}})])
0.589473210771
running trial: 190
{u'roc_timeperiod': 58, u'roc_lower': 0.0775934469102, u'rsi_width': 18, u'rsi_timeperiod': 75, u'roc_width': 0.05, u'rsi_lower': 29, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 29, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.05, 'lower': 0.0775934469102, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.698861750531
running trial: 191
{u'roc_timeperiod': 59, u'roc_lower': 0.0657235656326, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 0.05, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.05, 'lower': 0.0657235656326, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 59}})])
-999
*** Flagging as failed
running trial: 192
{u'roc_timeperiod': 58, u'roc_lower': 0.0789409236942, u'rsi_width': 20, u'rsi_timeperiod': 76, u'roc_width': 0.05, u'rsi_lower': 28, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 20, 'lower': 28, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.05, 'lower': 0.0789409236942, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.834307203277
running trial: 193
{u'roc_timeperiod': 58, u'roc_lower': 0.0829431720388, u'rsi_width': 18, u'rsi_timeperiod': 72, u'roc_width': 1.9794732304, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 72}}), ('roc', {'width': 1.9794732304, 'lower': 0.0829431720388, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.79336563351
running trial: 194
{u'roc_timeperiod': 58, u'roc_lower': 0.0973750984149, u'rsi_width': 19, u'rsi_timeperiod': 60, u'roc_width': 1.11585469428, u'rsi_lower': 31, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 1.11585469428, 'lower': 0.0973750984149, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.916075747319
running trial: 195
{u'roc_timeperiod': 58, u'roc_lower': 0.0713305988334, u'rsi_width': 18, u'rsi_timeperiod': 90, u'roc_width': 0.05, u'rsi_lower': 29, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 29, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 90}}), ('roc', {'width': 0.05, 'lower': 0.0713305988334, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.727344883271
running trial: 196
{u'roc_timeperiod': 58, u'roc_lower': 0.0969987185826, u'rsi_width': 18, u'rsi_timeperiod': 60, u'roc_width': 1.24297906844, u'rsi_lower': 31, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 1.24297906844, 'lower': 0.0969987185826, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.672412822696
running trial: 197
{u'roc_timeperiod': 58, u'roc_lower': 0.0720354217877, u'rsi_width': 19, u'rsi_timeperiod': 89, u'roc_width': 1.84065050499, u'rsi_lower': 30, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 89}}), ('roc', {'width': 1.84065050499, 'lower': 0.0720354217877, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.67084327966
running trial: 198
{u'roc_timeperiod': 58, u'roc_lower': 0.107611037588, u'rsi_width': 19, u'rsi_timeperiod': 60, u'roc_width': 2.0, u'rsi_lower': 31, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 2.0, 'lower': 0.107611037588, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.916075747319
running trial: 199
{u'roc_timeperiod': 58, u'roc_lower': 0.0998526131822, u'rsi_width': 16, u'rsi_timeperiod': 75, u'roc_width': 0.05, u'rsi_lower': 33, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 16, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.05, 'lower': 0.0998526131822, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.822930306749
running trial: 200
{u'roc_timeperiod': 58, u'roc_lower': 0.0703840385559, u'rsi_width': 19, u'rsi_timeperiod': 60, u'roc_width': 0.474440172532, u'rsi_lower': 33, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 0.474440172532, 'lower': 0.0703840385559, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.550399319648
running trial: 201
{u'roc_timeperiod': 58, u'roc_lower': 0.0765205965727, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.398186198873, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.398186198873, 'lower': 0.0765205965727, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.983439526744
running trial: 202
{u'roc_timeperiod': 58, u'roc_lower': 0.073140686667, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 2.0, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 2.0, 'lower': 0.073140686667, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 203
{u'roc_timeperiod': 58, u'roc_lower': 0.0995454796295, u'rsi_width': 17, u'rsi_timeperiod': 75, u'roc_width': 2.0, u'rsi_lower': 33, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 17, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 2.0, 'lower': 0.0995454796295, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.863114101646
running trial: 204
{u'roc_timeperiod': 58, u'roc_lower': 0.0976195314358, u'rsi_width': 20, u'rsi_timeperiod': 60, u'roc_width': 0.66552691568, u'rsi_lower': 31, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 20, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 0.66552691568, 'lower': 0.0976195314358, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.916075747319
running trial: 205
{u'roc_timeperiod': 58, u'roc_lower': 0.0428726821706, u'rsi_width': 18, u'rsi_timeperiod': 69, u'roc_width': 1.92813649904, u'rsi_lower': 32, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 69}}), ('roc', {'width': 1.92813649904, 'lower': 0.0428726821706, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.387316090622
running trial: 206
{u'roc_timeperiod': 58, u'roc_lower': 0.0644432255557, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 2.0, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 2.0, 'lower': 0.0644432255557, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.887341435167
running trial: 207
{u'roc_timeperiod': 58, u'roc_lower': 0.0843447928944, u'rsi_width': 18, u'rsi_timeperiod': 75, u'roc_width': 2.0, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 2.0, 'lower': 0.0843447928944, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.863114101646
running trial: 208
{u'roc_timeperiod': 58, u'roc_lower': 0.0995459376687, u'rsi_width': 19, u'rsi_timeperiod': 60, u'roc_width': 2.0, u'rsi_lower': 31, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 2.0, 'lower': 0.0995459376687, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.916075747319
running trial: 209
{u'roc_timeperiod': 58, u'roc_lower': 0.0686759578989, u'rsi_width': 17, u'rsi_timeperiod': 59, u'roc_width': 1.82285049453, u'rsi_lower': 32, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 17, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 59}}), ('roc', {'width': 1.82285049453, 'lower': 0.0686759578989, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
-999
*** Flagging as failed
running trial: 210
{u'roc_timeperiod': 58, u'roc_lower': 0.0650856374484, u'rsi_width': 19, u'rsi_timeperiod': 59, u'roc_width': 0.939899684771, u'rsi_lower': 34, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 34, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 59}}), ('roc', {'width': 0.939899684771, 'lower': 0.0650856374484, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.540812205357
running trial: 211
{u'roc_timeperiod': 58, u'roc_lower': 0.0663698500526, u'rsi_width': 18, u'rsi_timeperiod': 70, u'roc_width': 2.0, u'rsi_lower': 31, u'rebalance_freq': 16}
rebal freq: 16
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 70}}), ('roc', {'width': 2.0, 'lower': 0.0663698500526, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.854836229399
running trial: 212
{u'roc_timeperiod': 58, u'roc_lower': 0.0737395017542, u'rsi_width': 19, u'rsi_timeperiod': 59, u'roc_width': 0.135608415199, u'rsi_lower': 32, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 59}}), ('roc', {'width': 0.135608415199, 'lower': 0.0737395017542, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.710104028809
running trial: 213
{u'roc_timeperiod': 58, u'roc_lower': 0.0763235119514, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 2.0, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 2.0, 'lower': 0.0763235119514, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 214
{u'roc_timeperiod': 58, u'roc_lower': 0.101574585492, u'rsi_width': 19, u'rsi_timeperiod': 77, u'roc_width': 1.9999993802, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 77}}), ('roc', {'width': 1.9999993802, 'lower': 0.101574585492, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.938258190484
running trial: 215
{u'roc_timeperiod': 58, u'roc_lower': 0.0762260573038, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.05, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.05, 'lower': 0.0762260573038, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.914477152282
running trial: 216
{u'roc_timeperiod': 58, u'roc_lower': 0.0705866013688, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.91939361166, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.91939361166, 'lower': 0.0705866013688, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 217
{u'roc_timeperiod': 58, u'roc_lower': 0.0820878892536, u'rsi_width': 17, u'rsi_timeperiod': 76, u'roc_width': 2.0, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 17, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 2.0, 'lower': 0.0820878892536, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.863114101646
running trial: 218
{u'roc_timeperiod': 58, u'roc_lower': 0.104988716423, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 0.110871931072, u'rsi_lower': 79, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 79, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.110871931072, 'lower': 0.104988716423, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
-999
*** Flagging as failed
running trial: 219
{u'roc_timeperiod': 53, u'roc_lower': 0.0578259212625, u'rsi_width': 21, u'rsi_timeperiod': 97, u'roc_width': 0.05, u'rsi_lower': 34, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 21, 'lower': 34, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 97}}), ('roc', {'width': 0.05, 'lower': 0.0578259212625, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 53}})])
0.471356037963
running trial: 220
{u'roc_timeperiod': 58, u'roc_lower': 0.0778730524215, u'rsi_width': 18, u'rsi_timeperiod': 75, u'roc_width': 1.19909942391, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.19909942391, 'lower': 0.0778730524215, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 221
{u'roc_timeperiod': 58, u'roc_lower': 0.0759293093881, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 0.244295128123, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.244295128123, 'lower': 0.0759293093881, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 222
{u'roc_timeperiod': 58, u'roc_lower': 0.0767457896943, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 0.212595882485, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.212595882485, 'lower': 0.0767457896943, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 223
{u'roc_timeperiod': 58, u'roc_lower': 0.0767748689838, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 1.22027180526, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.22027180526, 'lower': 0.0767748689838, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.976425219121
running trial: 224
{u'roc_timeperiod': 58, u'roc_lower': 0.100125957637, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.423899168687, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.423899168687, 'lower': 0.100125957637, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.938258190484
running trial: 225
{u'roc_timeperiod': 58, u'roc_lower': 0.0765040524729, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.243799018108, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.243799018108, 'lower': 0.0765040524729, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.978776031181
running trial: 226
{u'roc_timeperiod': 58, u'roc_lower': 0.0731650700784, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.908866858882, u'rsi_lower': 33, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.908866858882, 'lower': 0.0731650700784, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.424220011945
running trial: 227
{u'roc_timeperiod': 58, u'roc_lower': 0.101700712457, u'rsi_width': 19, u'rsi_timeperiod': 59, u'roc_width': 0.86484767427, u'rsi_lower': 31, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 59}}), ('roc', {'width': 0.86484767427, 'lower': 0.101700712457, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.916075747319
running trial: 228
{u'roc_timeperiod': 58, u'roc_lower': 0.0773386691467, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.220618623863, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.220618623863, 'lower': 0.0773386691467, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.983439526744
running trial: 229
{u'roc_timeperiod': 58, u'roc_lower': 0.080806761324, u'rsi_width': 20, u'rsi_timeperiod': 77, u'roc_width': 0.788752204212, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 20, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 77}}), ('roc', {'width': 0.788752204212, 'lower': 0.080806761324, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.74145151814
running trial: 230
{u'roc_timeperiod': 58, u'roc_lower': 0.0829636081611, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 1.70811332375, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 1.70811332375, 'lower': 0.0829636081611, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.938258190484
running trial: 231
{u'roc_timeperiod': 58, u'roc_lower': 0.0750027090238, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.616310571021, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.616310571021, 'lower': 0.0750027090238, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 232
{u'roc_timeperiod': 58, u'roc_lower': 0.0830681742033, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 1.94622801128, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 1.94622801128, 'lower': 0.0830681742033, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.930664518778
running trial: 233
{u'roc_timeperiod': 58, u'roc_lower': 0.0791600484329, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.579911406025, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.579911406025, 'lower': 0.0791600484329, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.983439526744
running trial: 234
{u'roc_timeperiod': 58, u'roc_lower': 0.10224988193, u'rsi_width': 19, u'rsi_timeperiod': 60, u'roc_width': 0.684240505033, u'rsi_lower': 31, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 0.684240505033, 'lower': 0.10224988193, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.916075747319
running trial: 235
{u'roc_timeperiod': 58, u'roc_lower': 0.100233124907, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 1.99416711816, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 1.99416711816, 'lower': 0.100233124907, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.938258190484
running trial: 236
{u'roc_timeperiod': 58, u'roc_lower': 0.0837205894889, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 1.13504804525, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.13504804525, 'lower': 0.0837205894889, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.950974399658
running trial: 237
{u'roc_timeperiod': 58, u'roc_lower': 0.0888640314306, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 0.200927490341, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.200927490341, 'lower': 0.0888640314306, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.863114101646
running trial: 238
{u'roc_timeperiod': 58, u'roc_lower': 0.104921328512, u'rsi_width': 19, u'rsi_timeperiod': 60, u'roc_width': 1.83438222487, u'rsi_lower': 31, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 1.83438222487, 'lower': 0.104921328512, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.916075747319
running trial: 239
{u'roc_timeperiod': 58, u'roc_lower': 0.0710974713963, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 1.77972428231, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 1.77972428231, 'lower': 0.0710974713963, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.887341435167
running trial: 240
{u'roc_timeperiod': 58, u'roc_lower': 0.0811271237141, u'rsi_width': 20, u'rsi_timeperiod': 75, u'roc_width': 1.56911677281, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 20, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.56911677281, 'lower': 0.0811271237141, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.922558146524
running trial: 241
{u'roc_timeperiod': 58, u'roc_lower': 0.101960479994, u'rsi_width': 20, u'rsi_timeperiod': 59, u'roc_width': 0.677418682988, u'rsi_lower': 31, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 20, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 59}}), ('roc', {'width': 0.677418682988, 'lower': 0.101960479994, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.916075747319
running trial: 242
{u'roc_timeperiod': 58, u'roc_lower': 0.0785294083106, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 1.45016075197, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 1.45016075197, 'lower': 0.0785294083106, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.978776031181
running trial: 243
{u'roc_timeperiod': 58, u'roc_lower': 0.0878969817794, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 0.491690124505, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.491690124505, 'lower': 0.0878969817794, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.950974399658
running trial: 244
{u'roc_timeperiod': 58, u'roc_lower': 0.0693260048893, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 1.13992314966, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.13992314966, 'lower': 0.0693260048893, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 245
{u'roc_timeperiod': 58, u'roc_lower': 0.0783858943872, u'rsi_width': 18, u'rsi_timeperiod': 75, u'roc_width': 1.83658650802, u'rsi_lower': 33, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.83658650802, 'lower': 0.0783858943872, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.976425219121
running trial: 246
{u'roc_timeperiod': 58, u'roc_lower': 0.0975343393777, u'rsi_width': 20, u'rsi_timeperiod': 60, u'roc_width': 0.951185901165, u'rsi_lower': 31, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 20, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 0.951185901165, 'lower': 0.0975343393777, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.916075747319
running trial: 247
{u'roc_timeperiod': 58, u'roc_lower': 0.0696559143877, u'rsi_width': 18, u'rsi_timeperiod': 71, u'roc_width': 1.05070208419, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 71}}), ('roc', {'width': 1.05070208419, 'lower': 0.0696559143877, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.832788193734
running trial: 248
{u'roc_timeperiod': 58, u'roc_lower': 0.0792347361052, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 1.52617811578, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.52617811578, 'lower': 0.0792347361052, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.976425219121
running trial: 249
{u'roc_timeperiod': 58, u'roc_lower': 0.0980811398299, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.632147606897, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.632147606897, 'lower': 0.0980811398299, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.938258190484
running trial: 250
{u'roc_timeperiod': 58, u'roc_lower': 0.100882620699, u'rsi_width': 18, u'rsi_timeperiod': 77, u'roc_width': 2.0, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 77}}), ('roc', {'width': 2.0, 'lower': 0.100882620699, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.938258190484
running trial: 251
{u'roc_timeperiod': 58, u'roc_lower': 0.0739040429565, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.521664256421, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.521664256421, 'lower': 0.0739040429565, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.983439526744
running trial: 252
{u'roc_timeperiod': 58, u'roc_lower': 0.0786878045638, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 1.90991941617, u'rsi_lower': 33, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 1.90991941617, 'lower': 0.0786878045638, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.978776031181
running trial: 253
{u'roc_timeperiod': 58, u'roc_lower': 0.0632062303362, u'rsi_width': 19, u'rsi_timeperiod': 72, u'roc_width': 0.441506667267, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 72}}), ('roc', {'width': 0.441506667267, 'lower': 0.0632062303362, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.653842012422
running trial: 254
{u'roc_timeperiod': 58, u'roc_lower': 0.092418025124, u'rsi_width': 20, u'rsi_timeperiod': 76, u'roc_width': 0.422313917611, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 20, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.422313917611, 'lower': 0.092418025124, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.930664518778
running trial: 255
{u'roc_timeperiod': 58, u'roc_lower': 0.0796592871387, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 1.1592767278, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.1592767278, 'lower': 0.0796592871387, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.905723888734
running trial: 256
{u'roc_timeperiod': 58, u'roc_lower': 0.0720633972477, u'rsi_width': 18, u'rsi_timeperiod': 91, u'roc_width': 0.600866883235, u'rsi_lower': 29, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 29, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 91}}), ('roc', {'width': 0.600866883235, 'lower': 0.0720633972477, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.78677114826
running trial: 257
{u'roc_timeperiod': 58, u'roc_lower': 0.0694986758357, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 1.28246652442, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.28246652442, 'lower': 0.0694986758357, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.892952110412
running trial: 258
{u'roc_timeperiod': 58, u'roc_lower': 0.089708413172, u'rsi_width': 18, u'rsi_timeperiod': 75, u'roc_width': 1.04060912382, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.04060912382, 'lower': 0.089708413172, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.863114101646
running trial: 259
{u'roc_timeperiod': 58, u'roc_lower': 0.0873292266503, u'rsi_width': 18, u'rsi_timeperiod': 77, u'roc_width': 1.84632091019, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 77}}), ('roc', {'width': 1.84632091019, 'lower': 0.0873292266503, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.981029981719
running trial: 260
{u'roc_timeperiod': 58, u'roc_lower': 0.0887061756036, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 1.17126328341, u'rsi_lower': 33, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.17126328341, 'lower': 0.0887061756036, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.872464082591
running trial: 261
{u'roc_timeperiod': 58, u'roc_lower': 0.0926811705278, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 1.86694757448, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 1.86694757448, 'lower': 0.0926811705278, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.938258190484
running trial: 262
{u'roc_timeperiod': 58, u'roc_lower': 0.0746517358401, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 1.3224452279, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.3224452279, 'lower': 0.0746517358401, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 263
{u'roc_timeperiod': 58, u'roc_lower': 0.0884707332556, u'rsi_width': 20, u'rsi_timeperiod': 76, u'roc_width': 1.05895222305, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 20, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 1.05895222305, 'lower': 0.0884707332556, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.930664518778
running trial: 264
{u'roc_timeperiod': 58, u'roc_lower': 0.0770892389206, u'rsi_width': 18, u'rsi_timeperiod': 75, u'roc_width': 1.33719358907, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.33719358907, 'lower': 0.0770892389206, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 265
{u'roc_timeperiod': 58, u'roc_lower': 0.106772979013, u'rsi_width': 20, u'rsi_timeperiod': 60, u'roc_width': 1.50760922714, u'rsi_lower': 31, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 20, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 1.50760922714, 'lower': 0.106772979013, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.916075747319
running trial: 266
{u'roc_timeperiod': 58, u'roc_lower': 0.0674869503042, u'rsi_width': 18, u'rsi_timeperiod': 75, u'roc_width': 1.85188262474, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.85188262474, 'lower': 0.0674869503042, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 267
{u'roc_timeperiod': 58, u'roc_lower': 0.0870215496418, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 1.22247695231, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 1.22247695231, 'lower': 0.0870215496418, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.938258190484
running trial: 268
{u'roc_timeperiod': 58, u'roc_lower': 0.0768812866098, u'rsi_width': 20, u'rsi_timeperiod': 74, u'roc_width': 1.41017632385, u'rsi_lower': 33, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 20, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 74}}), ('roc', {'width': 1.41017632385, 'lower': 0.0768812866098, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.336140384781
running trial: 269
{u'roc_timeperiod': 58, u'roc_lower': 0.0873705686892, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 0.953877606471, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.953877606471, 'lower': 0.0873705686892, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.950974399658
running trial: 270
{u'roc_timeperiod': 58, u'roc_lower': 0.102027446628, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 0.265371486889, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.265371486889, 'lower': 0.102027446628, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.863114101646
running trial: 271
{u'roc_timeperiod': 58, u'roc_lower': 0.0861563986373, u'rsi_width': 19, u'rsi_timeperiod': 77, u'roc_width': 1.67270300725, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 77}}), ('roc', {'width': 1.67270300725, 'lower': 0.0861563986373, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.74145151814
running trial: 272
{u'roc_timeperiod': 58, u'roc_lower': 0.0726096216059, u'rsi_width': 18, u'rsi_timeperiod': 74, u'roc_width': 0.509083636561, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 74}}), ('roc', {'width': 0.509083636561, 'lower': 0.0726096216059, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.791627217325
running trial: 273
{u'roc_timeperiod': 58, u'roc_lower': 0.0833192909004, u'rsi_width': 18, u'rsi_timeperiod': 75, u'roc_width': 1.75778210596, u'rsi_lower': 34, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 34, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.75778210596, 'lower': 0.0833192909004, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.922558146524
running trial: 274
{u'roc_timeperiod': 58, u'roc_lower': 0.0993305190699, u'rsi_width': 19, u'rsi_timeperiod': 60, u'roc_width': 1.16189748532, u'rsi_lower': 31, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 60}}), ('roc', {'width': 1.16189748532, 'lower': 0.0993305190699, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.916075747319
running trial: 275
{u'roc_timeperiod': 58, u'roc_lower': 0.0686686674087, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 1.35654710783, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 1.35654710783, 'lower': 0.0686686674087, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.887341435167
running trial: 276
{u'roc_timeperiod': 58, u'roc_lower': 0.107500192165, u'rsi_width': 19, u'rsi_timeperiod': 59, u'roc_width': 1.22679360271, u'rsi_lower': 31, u'rebalance_freq': 13}
rebal freq: 13
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 59}}), ('roc', {'width': 1.22679360271, 'lower': 0.107500192165, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.916075747319
running trial: 277
{u'roc_timeperiod': 58, u'roc_lower': 0.0987279618458, u'rsi_width': 19, u'rsi_timeperiod': 59, u'roc_width': 0.667859071745, u'rsi_lower': 31, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 59}}), ('roc', {'width': 0.667859071745, 'lower': 0.0987279618458, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.224192253805
running trial: 278
{u'roc_timeperiod': 58, u'roc_lower': 0.0819832821089, u'rsi_width': 18, u'rsi_timeperiod': 75, u'roc_width': 1.75061582311, u'rsi_lower': 33, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.75061582311, 'lower': 0.0819832821089, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.950974399658
running trial: 279
{u'roc_timeperiod': 58, u'roc_lower': 0.0818105867791, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.511580127315, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.511580127315, 'lower': 0.0818105867791, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.930664518778
running trial: 280
{u'roc_timeperiod': 58, u'roc_lower': 0.0865040981205, u'rsi_width': 18, u'rsi_timeperiod': 77, u'roc_width': 2.0, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 77}}), ('roc', {'width': 2.0, 'lower': 0.0865040981205, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.981029981719
running trial: 281
{u'roc_timeperiod': 58, u'roc_lower': 0.0641383598287, u'rsi_width': 18, u'rsi_timeperiod': 71, u'roc_width': 1.19298490589, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 71}}), ('roc', {'width': 1.19298490589, 'lower': 0.0641383598287, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.832788193734
running trial: 282
{u'roc_timeperiod': 58, u'roc_lower': 0.0753699044248, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 0.475928995262, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.475928995262, 'lower': 0.0753699044248, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.983439526744
running trial: 283
{u'roc_timeperiod': 58, u'roc_lower': 0.0757938775802, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.507359818264, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.507359818264, 'lower': 0.0757938775802, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.978776031181
running trial: 284
{u'roc_timeperiod': 58, u'roc_lower': 0.0691362494393, u'rsi_width': 18, u'rsi_timeperiod': 59, u'roc_width': 1.13013083081, u'rsi_lower': 32, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 59}}), ('roc', {'width': 1.13013083081, 'lower': 0.0691362494393, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.68936355513
running trial: 285
{u'roc_timeperiod': 58, u'roc_lower': 0.0761291701225, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.124363137169, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.124363137169, 'lower': 0.0761291701225, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.978776031181
running trial: 286
{u'roc_timeperiod': 58, u'roc_lower': 0.0722475896471, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 1.107715067, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.107715067, 'lower': 0.0722475896471, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 287
{u'roc_timeperiod': 58, u'roc_lower': 0.066138662478, u'rsi_width': 19, u'rsi_timeperiod': 71, u'roc_width': 0.992343474249, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 71}}), ('roc', {'width': 0.992343474249, 'lower': 0.066138662478, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.832788193734
running trial: 288
{u'roc_timeperiod': 58, u'roc_lower': 0.0636867897542, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 0.986328610714, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.986328610714, 'lower': 0.0636867897542, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 289
{u'roc_timeperiod': 58, u'roc_lower': 0.0897953615282, u'rsi_width': 18, u'rsi_timeperiod': 77, u'roc_width': 1.93994434442, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 77}}), ('roc', {'width': 1.93994434442, 'lower': 0.0897953615282, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.981029981719
running trial: 290
{u'roc_timeperiod': 58, u'roc_lower': 0.0771954869554, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 1.7761340404, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 1.7761340404, 'lower': 0.0771954869554, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.983439526744
running trial: 291
{u'roc_timeperiod': 58, u'roc_lower': 0.0875796076303, u'rsi_width': 20, u'rsi_timeperiod': 75, u'roc_width': 1.31451545139, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 20, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.31451545139, 'lower': 0.0875796076303, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.950974399658
running trial: 292
{u'roc_timeperiod': 58, u'roc_lower': 0.0738845980468, u'rsi_width': 19, u'rsi_timeperiod': 90, u'roc_width': 0.617891940696, u'rsi_lower': 30, u'rebalance_freq': 14}
rebal freq: 14
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 90}}), ('roc', {'width': 0.617891940696, 'lower': 0.0738845980468, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.773011242219
running trial: 293
{u'roc_timeperiod': 58, u'roc_lower': 0.0767056075541, u'rsi_width': 18, u'rsi_timeperiod': 76, u'roc_width': 0.58186987918, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.58186987918, 'lower': 0.0767056075541, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 294
{u'roc_timeperiod': 58, u'roc_lower': 0.0628668987083, u'rsi_width': 19, u'rsi_timeperiod': 75, u'roc_width': 1.79588870087, u'rsi_lower': 31, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 31, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 1.79588870087, 'lower': 0.0628668987083, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.860058310989
running trial: 295
{u'roc_timeperiod': 58, u'roc_lower': 0.0949810019766, u'rsi_width': 18, u'rsi_timeperiod': 75, u'roc_width': 0.32217597336, u'rsi_lower': 33, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 33, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.32217597336, 'lower': 0.0949810019766, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.950974399658
running trial: 296
{u'roc_timeperiod': 58, u'roc_lower': 0.0629964160787, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 1.35320417538, u'rsi_lower': 29, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 29, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 1.35320417538, 'lower': 0.0629964160787, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 297
{u'roc_timeperiod': 58, u'roc_lower': 0.06160033075, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 1.43667774554, u'rsi_lower': 30, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 30, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 1.43667774554, 'lower': 0.06160033075, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.909541954276
running trial: 298
{u'roc_timeperiod': 58, u'roc_lower': 0.0942001973876, u'rsi_width': 19, u'rsi_timeperiod': 76, u'roc_width': 0.406773739917, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 19, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 76}}), ('roc', {'width': 0.406773739917, 'lower': 0.0942001973876, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.930664518778
running trial: 299
{u'roc_timeperiod': 58, u'roc_lower': 0.0794787244906, u'rsi_width': 18, u'rsi_timeperiod': 75, u'roc_width': 0.614159079508, u'rsi_lower': 32, u'rebalance_freq': 15}
rebal freq: 15
OrderedDict([('rsi', {'width': 18, 'lower': 32, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 75}}), ('roc', {'width': 0.614159079508, 'lower': 0.0794787244906, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 58}})])
0.863114101646

In [22]:
sigopt_df.sort('objective', ascending=False).head()


Out[22]:
failed objective rebalance_freq roc_lower roc_timeperiod roc_width rsi_lower rsi_timeperiod rsi_width
4 False -0.054690 3 0.168719 17 1.834614 33 75 28
3 False -0.073903 17 0.205710 29 1.186417 64 8 18
1 False -0.250872 20 0.014307 21 0.238028 35 95 23
0 True -999.000000 8 0.109979 63 0.678920 82 44 11
2 True -999.000000 10 0.236430 3 0.853963 70 107 26

In [41]:
# If you exported a CSV of your SigOpt results from your account page on the SigOpt website,
# you can read the results in like this. 
# To make it 'pandas friendly' you might want to replace 'None' with 'NA' prior to reading it in

sigopt_df = pd.read_csv('SigOpt_Experiment_good_2.csv')

In [42]:
sigopt_df.head()


Out[42]:
rsi_timeperiod rsi_lower rsi_width roc_timeperiod roc_lower roc_width rebalance_freq value
0 27 55 17 16 0.132454 1.943223 7 0.337197
1 38 44 18 46 0.000729 0.812360 9 0.425559
2 66 89 13 4 0.168258 1.104381 16 NaN
3 119 76 21 35 0.057774 0.265620 3 NaN
4 86 21 12 51 0.250782 1.664795 11 NaN

In [43]:
sigopt_df.sort('value', ascending=False).head(10)


Out[43]:
rsi_timeperiod rsi_lower rsi_width roc_timeperiod roc_lower roc_width rebalance_freq value
226 33 43 17 54 0 0.568999 12 1.009966
223 33 43 17 54 0 0.608607 12 1.009966
247 33 44 16 54 0 0.534478 12 1.009966
148 33 42 18 54 0 1.488573 12 1.009709
141 33 42 18 54 0 1.012120 12 1.009709
115 33 42 18 54 0 0.921427 12 1.009709
139 33 42 18 54 0 1.114055 12 1.009709
153 33 42 18 54 0 1.405196 12 1.009709
245 34 44 16 54 0 0.452321 12 1.009289
293 34 44 16 54 0 0.531977 12 0.990455

View the distribution of all the values attempted by the SigOpt Bayesian Optimizer for each parameter in the trading model


In [30]:
_=sigopt_df.hist(figsize=(17,10))


Diagonal: Visualize the distribution of each parameter attempted by the SigOpt optimizer

Scatterplots: Each individual parameter attempted vs. each of the others


In [31]:
g = sns.PairGrid(sigopt_df, diag_sharey=False)
g.map_lower(plt.scatter, cmap="Blues_d")
g.map_upper(sns.kdeplot, shade=True, bw='silverman', shade_lowest=False)
g.map_diag(sns.kdeplot, lw=3)


Out[31]:
<seaborn.axisgrid.PairGrid at 0x114613f50>

In [65]:
# Specify the values of the best parameter combo in the signals dict, and rebalance frequency
# These values were pulled from the SigOpt export CSV
# filename: SigOpt_Experiment_good_2.csv 

input_params = {}

input_params['rebalance_freq'] = 12

signals = OrderedDict([
    ( 'rsi', {'func': talib.RSI, 'func_kwargs': {'timeperiod': 33 }, 
                   'lower': 44,  'width': 16} ),
    ( 'roc', {'func': talib.ROCP, 'func_kwargs': {'timeperiod': 54 }, 
                   'lower': 0.0, 'width': 0.534} )  
    ])

input_params['signals_input'] = signals

In [66]:
algo_obj = zipline.TradingAlgorithm(
    initialize=initialize_local_sigopt_rsi_roc,
    handle_data=handle_data_local_sigopt_rsi_roc,
    **input_params
)

# Run algorithm using the training data
perf_manual = algo_obj.run(data)


rebal freq: 12
OrderedDict([('rsi', {'width': 16, 'lower': 44, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 33}}), ('roc', {'width': 0.534, 'lower': 0.0, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 54}})])

In [67]:
daily_rets = perf_manual.portfolio_value.pct_change().dropna()
sharpe_ratio_rets = daily_rets.mean() / daily_rets.std() * np.sqrt(252)
print sharpe_ratio_rets

perf_manual.portfolio_value.plot()


1.00996603411
Out[67]:
<matplotlib.axes._subplots.AxesSubplot at 0x10c0611d0>

In [68]:
# Run algorithm using the heldout, out-of-sample data
perf_manual = algo_obj.run(data_heldout)

daily_rets = perf_manual.portfolio_value.pct_change().dropna()
sharpe_ratio_rets = daily_rets.mean() / daily_rets.std() * np.sqrt(252)
print sharpe_ratio_rets

perf_manual.portfolio_value.plot()


-1.10345060794
Out[68]:
<matplotlib.axes._subplots.AxesSubplot at 0x1162db810>

(Above) Again, as before, seeing how poorly the strategy performs out-of-sample illustrates how important it is to perform additional analysis after using parameter optimization to discover a global maximum

One way to combat this overfitting is to use performance on a cross-validated or holdout dataset as the metric being optimized. This forces the algorithm to be robust to never-before-seen data and allows the optimizer to find potentially better overall results. For an example of using SigOpt to tune on a cross-validated dataset, with results on a holdout dataset check out this blog post (with code).

Let's take a deep dive into what we found

How fast did we find our best result?

In practice SigOpt is able to find a good optima in a linear number of evaluations with respect to the number of parameters being tuned (usually between 10 and 20 times the dimensionality of the parameter space). Grid search, even an expertly tuned grid search, grows exponentially with the number of parameters. As the model being tuned becomes more complex it can quickly become completely intractable to tune a model using these traditional methods.


In [105]:
plt.figure(figsize=(10,6));
plt.title("Grid Search vs. SigOpt: Values Returned for Objective Function by Iteration");
plt.plot(grid_df.value.values, alpha=0.5, color='forestgreen', label='grid search', marker='o', linestyle='')
plt.plot(sigopt_df.value.values, alpha=0.7, color='steelblue', label='SigOpt', marker='o', linestyle='')
plt.tight_layout()
plt.legend()
plt.xlabel("Iteration")
plt.ylabel("Objective Function Value")
plt.savefig('SigOpt_vs_GridSearch_time_comparison.png', dpi=300)



In [106]:
plt.figure(figsize=(10,6));
plt.title("SigOpt: Each Trial Value and Max Value over time");
plt.plot(sigopt_df.value, alpha=0.7, color='steelblue', label='SigOpt', marker='o', linestyle='')
np.maximum.accumulate(sigopt_df.value.fillna(0)).plot(lw=3.5)
plt.tight_layout()
plt.xlabel("Iteration")
plt.ylabel("Objective Function Value")
plt.savefig('SigOpt_max_over_time.png', dpi=300)



In [103]:
plt.figure(figsize=(10,6));
plt.title("Grid Search VS SigOpt: Sorted Values Returned for Objective Function");
plt.plot(np.sort(grid_df.fillna(0.0).value), color='forestgreen', lw=3, marker='o', ls='')
plt.plot(np.sort(sigopt_df.value), color='steelblue', lw=3, marker='o', ls='')
plt.tight_layout()
plt.legend()
plt.ylabel("Objective Function Value")
plt.savefig('SigOpt_vs_GridSearch_sorted_value_comparison.png', dpi=300)


What does the distribution of objective function values found look like?


In [75]:
plt.figure(figsize=(15,6));
gs = plt.GridSpec(1,2);
plt.subplot(gs[0]);
sns.distplot(grid_df.value.dropna())
plt.axvline(0.0,c='k',ls='--')
plt.axvline(np.mean(grid_df.value),c='orange',ls='--', lw=3, label='mean')
plt.legend()
plt.title("Grid Search");

plt.subplot(gs[1]);
sns.distplot(sigopt_df.value.dropna())
plt.axvline(0.0,c='k',ls='--')
plt.axvline(np.mean(sigopt_df.value),c='orange',ls='--', lw=3, label='mean')
plt.legend()
plt.title("SigOpt");


Make a Pyfolio Tearsheet if you have it installed

Run the Zipline algo over the entire date range, then we'll highlight the Out-of-sample period within Pyfolio


In [76]:
# Specify the values of the best parameter combo in the signals dict, and rebalance frequency
# These values were pulled from the SigOpt export CSV
# filename: SigOpt_Experiment_good_2.csv 

input_params = {}

input_params['rebalance_freq'] = 12

signals = OrderedDict([
    ( 'rsi', {'func': talib.RSI, 'func_kwargs': {'timeperiod': 33 }, 
                   'lower': 44,  'width': 16} ),
    ( 'roc', {'func': talib.ROCP, 'func_kwargs': {'timeperiod': 54 }, 
                   'lower': 0.0, 'width': 0.534} )  
    ])

input_params['signals_input'] = signals

algo_obj = zipline.TradingAlgorithm(
    initialize=initialize_local_sigopt_rsi_roc,
    handle_data=handle_data_local_sigopt_rsi_roc,
    **input_params
)

perf_manual = algo_obj.run(data_all)

# First need to normalize, and localize all the timestamps
perf_manual.index = perf_manual.index.normalize()
if perf_manual.index.tzinfo is None:
    perf_manual.index = perf_manual.index.tz_localize('UTC')
returns = perf_manual.returns


rebal freq: 12
OrderedDict([('rsi', {'width': 16, 'lower': 44, 'func': <built-in function RSI>, 'func_kwargs': {'timeperiod': 33}}), ('roc', {'width': 0.534, 'lower': 0.0, 'func': <built-in function ROCP>, 'func_kwargs': {'timeperiod': 54}})])

In [77]:
# Render the tearsheet
pf.create_returns_tear_sheet(returns, live_start_date='01-10-2010')


Entire data start date: 2004-01-02
Entire data end date: 2016-01-07


Out-of-Sample Months: 71
Backtest Months: 72
                         Backtest  Out of sample  All history
annual_return                0.06          -0.03         0.01
annual_volatility            0.06           0.04         0.05
sharpe_ratio                 1.03          -0.89         0.25
calmar_ratio                 0.94          -0.17         0.05
stability_of_timeseries      0.94          -0.92         0.57
max_drawdown                -0.06          -0.20        -0.20
omega_ratio                  1.22           0.85         1.05
sortino_ratio                1.49          -1.18         0.36
skew                        -0.19          -0.33        -0.17
kurtosis                     4.32           4.23         5.30
information_ratio            0.00          -0.06        -0.02
alpha                        0.06          -0.03         0.02
beta                        -0.03          -0.05        -0.04

Worst Drawdown Periods
   net drawdown in %  peak date valley date recovery date duration
0              20.49 2010-01-13  2015-11-06           NaT      NaN
1               6.19 2006-07-21  2006-10-12    2007-02-27      158
2               4.63 2005-04-25  2005-10-20    2006-04-18      257
3               3.86 2008-06-30  2008-08-28    2008-09-29       66
4               3.75 2008-01-09  2008-02-14    2008-04-11       68


2-sigma returns daily    -0.006
2-sigma returns weekly   -0.012
dtype: float64

In [ ]: