In this notebook a sensitivity analysis will be performed. The best Automatic Trader will be tested with unseen symbols, without retraining, in the Test period.


In [1]:
# Basic imports
import os
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import datetime as dt
import scipy.optimize as spo
import sys
from time import time
from sklearn.metrics import r2_score, median_absolute_error
from multiprocessing import Pool
import pickle

%matplotlib inline

%pylab inline
pylab.rcParams['figure.figsize'] = (20.0, 10.0)

%load_ext autoreload
%autoreload 2

sys.path.append('../../')

import recommender.simulator as sim
from utils.analysis import value_eval
from recommender.agent import Agent
from functools import partial


Populating the interactive namespace from numpy and matplotlib

In [2]:
def show_results(results_list, data_in_df, symbol, graph=False):
    for values in results_list:
        total_value = values.sum(axis=1)
        print('Sharpe ratio: {}\nCum. Ret.: {}\nAVG_DRET: {}\nSTD_DRET: {}\nFinal value: {}'.format(*value_eval(pd.DataFrame(total_value))))
        print('-'*100)
        initial_date = total_value.index[0]
        compare_results = data_in_df.loc[initial_date:, 'Close'].copy()
        compare_results.name = symbol
        compare_results_df = pd.DataFrame(compare_results)
        compare_results_df['portfolio'] = total_value
        std_comp_df = compare_results_df / compare_results_df.iloc[0]
        if graph:
            plt.figure()
            std_comp_df.plot()

Let's get some "good" symbols (low missing data)


In [3]:
raw_data_df = pd.read_pickle('../../data/data_df.pkl')

In [4]:
close_df = raw_data_df.unstack().loc[:,(slice(None), 'Close')]
close_df.columns = close_df.columns.droplevel('feature')
missing_df = close_df.isnull().sum() / close_df.shape[0]
good_close = list(close_df.loc[:,missing_df < 0.001].columns)
len(good_close)


Out[4]:
279

In [5]:
volume_df = raw_data_df.unstack().loc[:,(slice(None), 'Volume')]
volume_df.columns = volume_df.columns.droplevel('feature')
missing_df = volume_df.isnull().sum() / volume_df.shape[0]
good_volume = list(volume_df.loc[:,missing_df < 0.001].columns)
len(good_volume)


Out[5]:
279

In [6]:
good_symbols = list(set(good_close).intersection(good_volume))
good_symbols


Out[6]:
['AFL',
 'CHK',
 'HD',
 'APC',
 'GWW',
 'ADP',
 'GIS',
 'TSN',
 'LEN',
 'TMO',
 'FOXA',
 'RRC',
 'SLB',
 'F',
 'ROK',
 'XLNX',
 'MAS',
 'SYK',
 'SYMC',
 'IPG',
 'BDX',
 'SRE',
 'RJF',
 'PPL',
 'JEC',
 'HSY',
 'PX',
 'NEM',
 'BK',
 'ROST',
 'TWX',
 'HOG',
 'LLY',
 'L',
 'TROW',
 'TRV',
 'COP',
 'AME',
 'ESRX',
 'STI',
 'TIF',
 'SPY',
 'XEL',
 'TGNA',
 'BAC',
 'MOS',
 'ES',
 'FAST',
 'REGN',
 'SCG',
 'FMC',
 'WY',
 'M',
 'EA',
 'EFX',
 'AEP',
 'DOW',
 'ETR',
 'HCN',
 'PBCT',
 'BEN',
 'KO',
 'BBY',
 'AIG',
 'HON',
 'PGR',
 'MKC',
 'JNJ',
 'MSI',
 'SPGI',
 'ARNC',
 'USB',
 'BIIB',
 'CELG',
 'MRK',
 'BBBY',
 'CNP',
 'CPB',
 'HRS',
 'WEC',
 'R',
 'BHI',
 'GLW',
 'OKE',
 'IDXX',
 'OXY',
 'HAS',
 'SIG',
 'EXPD',
 'KIM',
 'SPLS',
 'LUV',
 'CTL',
 'CL',
 'DHR',
 'LRCX',
 'ALK',
 'HP',
 'PNW',
 'PSA',
 'PHM',
 'UNH',
 'DOV',
 'NKE',
 'CCL',
 'UHS',
 'TJX',
 'FISV',
 'PCAR',
 'TGT',
 'BF.B',
 'SWK',
 'CAT',
 'KR',
 'ZION',
 'AAPL',
 'AZO',
 'DUK',
 'PAYX',
 'NSC',
 'SNPS',
 'PNC',
 'APH',
 'CSX',
 'IR',
 'MUR',
 'ECL',
 'ADM',
 'HAL',
 'ORCL',
 'VNO',
 'TSO',
 'PPG',
 'TXN',
 'GILD',
 'CHD',
 'STT',
 'MHK',
 'SO',
 'MSFT',
 'NI',
 'KMB',
 'HPQ',
 'RHI',
 'LUK',
 'C',
 'HRB',
 'PKI',
 'PDCO',
 'ABT',
 'GPC',
 'MMC',
 'MMM',
 'GPS',
 'D',
 'AJG',
 'BMY',
 'GD',
 'WMT',
 'WFM',
 'UDR',
 'MTB',
 'ROP',
 'CERN',
 'CAG',
 'ADBE',
 'COG',
 'DHI',
 'IFF',
 'VFC',
 'LEG',
 'SNA',
 'ED',
 'WFC',
 'CLX',
 'DE',
 'DTE',
 'INTC',
 'BAX',
 'PFE',
 'HES',
 'MCD',
 'CA',
 'AES',
 'STZ',
 'IP',
 'CMCSA',
 'TSS',
 'PEP',
 'BLL',
 'DD',
 'AMGN',
 'CMA',
 'AET',
 'BCR',
 'FITB',
 'HCP',
 'WHR',
 'AMD',
 'TAP',
 'KLAC',
 'PCG',
 'XRX',
 'COST',
 'TMK',
 'EXC',
 'QCOM',
 'FDX',
 'XRAY',
 'AVY',
 'DVN',
 'AN',
 'OMC',
 'PH',
 'EOG',
 'HOLX',
 'SBUX',
 'SHW',
 'COO',
 'LH',
 'ADSK',
 'JWN',
 'CMS',
 'JBHT',
 'AXP',
 'MO',
 'SYY',
 'WDC',
 'KSS',
 'TXT',
 'BA',
 'KEY',
 'DIS',
 'WMB',
 'PVH',
 'HBAN',
 'APA',
 'CSCO',
 'CMI',
 'CVS',
 'LNC',
 'NUE',
 'CAH',
 'APD',
 'VZ',
 'VRTX',
 'LB',
 'GE',
 'EMR',
 'XOM',
 'LOW',
 'EIX',
 'UTX',
 'VMC',
 'IBM',
 'BBT',
 'NTRS',
 'RF',
 'FRT',
 'HRL',
 'MRO',
 'UNM',
 'CINF',
 'AMAT',
 'SWKS',
 'FL',
 'EQT',
 'LNT',
 'NOC',
 'ITW',
 'UNP',
 'PEG',
 'CTAS',
 'CI',
 'VLO',
 'FOX',
 'K',
 'PG',
 'T']

In [7]:
'SPY' in good_symbols


Out[7]:
True

In [8]:
good_symbols.remove('SPY')
'SPY' in good_symbols


Out[8]:
False

Let's try to test on one unseen symbol alone


In [9]:
SYMBOL = 'MCD'
AGENT_PICKLE = '../../data/simple_q_learner_1000_states_full_training.pkl'
AGENT_PICKLE = '../../data/simple_q_learner_1000_states_full_training_25_epochs.pkl'

LOOKBACK = -1  # 252*4 + 28
STARTING_DAYS_AHEAD = 252
POSSIBLE_FRACTIONS = [0.0, 1.0]

# Get the data
total_data_train_df = pd.read_pickle('../../data/data_train_val_df.pkl').stack(level='feature')
data_train_df = total_data_train_df[SYMBOL].unstack()
total_data_test_df = pd.read_pickle('../../data/data_test_df.pkl').stack(level='feature')
data_test_df = total_data_test_df[SYMBOL].unstack()
if LOOKBACK == -1:
    total_data_in_df = total_data_train_df
    data_in_df = data_train_df
else:
    data_in_df = data_train_df.iloc[-LOOKBACK:]
    total_data_in_df = total_data_train_df.loc[data_in_df.index[0]:]

env, num_states, num_actions = sim.initialize_env(total_data_in_df, 
                                                  SYMBOL, 
                                                  starting_days_ahead=STARTING_DAYS_AHEAD,
                                                  possible_fractions=POSSIBLE_FRACTIONS,
                                                  n_levels=10)

with open(AGENT_PICKLE, 'rb') as f:
    agent = pickle.load(f)

Test without retraining. It will probably not work very well, as the thresholds may not be general enough to be transferable between different symbols.


In [10]:
total_data_test_df.unstack().shape


Out[10]:
(504, 2495)

In [11]:
TEST_DAYS_AHEAD = 20

env.set_test_data(total_data_test_df, TEST_DAYS_AHEAD)
tic = time()
results_list = sim.simulate_period(total_data_test_df, 
                                    SYMBOL,
                                    agent,
                                    learn=False,
                                    starting_days_ahead=TEST_DAYS_AHEAD,
                                    possible_fractions=POSSIBLE_FRACTIONS,
                                    verbose=False,
                                    other_env=env)
toc = time()
print('Elapsed time: {} seconds.'.format((toc-tic)))
print('Random Actions Rate: {}'.format(agent.random_actions_rate))
show_results([results_list], data_test_df, SYMBOL, graph=True)


Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.17609357833862305s.  Value: 10115.979999999996.Elapsed time: 8.87047028541565 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.06382145737380468
Cum. Ret.: 0.003725999999999452
AVG_DRET: 1.9844066420790565e-05
STD_DRET: 0.004935875823908302
Final value: 10037.259999999995
----------------------------------------------------------------------------------------------------
<matplotlib.figure.Figure at 0x7f4dea3c71d0>

In [12]:
total_value = results_list.sum(axis=1)
sharpe, cumret, _, _, _ = value_eval(pd.DataFrame(total_value))
sharpe_bench, cumret_bench, _, _, _ = value_eval(pd.DataFrame(data_test_df['Close'].iloc[TEST_DAYS_AHEAD:]))

sharpe_q = sharpe / sharpe_bench
cumret_q = cumret / cumret_bench
print('Sharpe Quotient: %f' % sharpe_q)
print('Cumulative Return Quotient: %f' % cumret_q)


Sharpe Quotient: 0.069251
Cumulative Return Quotient: 0.011800

In [13]:
results_df = pd.DataFrame(columns=['sharpe', 'sharpe_bench', 'cum_ret', 'cum_ret_bench', 'sharpe_quotient', 'cum_ret_quotient'])

In [14]:
symbol = SYMBOL
results_df = results_df.append(pd.DataFrame({symbol: {'sharpe': sharpe,
                                         'sharpe_bench': sharpe_bench,
                                         'cum_ret': cumret,
                                         'cum_ret_bench': cumret_bench,
                                         'sharpe_quotient': sharpe_q,
                                         'cum_ret_quotient': cumret_q}}).T)
results_df


Out[14]:
cum_ret cum_ret_bench cum_ret_quotient sharpe sharpe_bench sharpe_quotient
MCD 0.003726 0.31575 0.0118 0.063821 0.921594 0.069251

Let's test it with n_syms random symbols


In [15]:
n_syms = 100

np.random.seed(2017)
random_symbols = np.random.choice(good_symbols, size=n_syms, replace=False)
print('Testing with these symbols:\n{}'.format(random_symbols))

# Set the Agent (It shouldn't change if tested with 'no learning')
AGENT_PICKLE = '../../data/simple_q_learner_1000_states_full_training.pkl'
AGENT_PICKLE = '../../data/simple_q_learner_1000_states_full_training_25_epochs.pkl'

with open(AGENT_PICKLE, 'rb') as f:
    agent = pickle.load(f)

# Results holder
results_df = pd.DataFrame(columns=['sharpe', 
                                   'sharpe_bench', 
                                   'cum_ret', 
                                   'cum_ret_bench', 
                                   'sharpe_quotient', 
                                   'cum_ret_quotient',])

for symbol in random_symbols:
    # Set the environment
    data_test_df = total_data_test_df[symbol].unstack()
    env, num_states, num_actions = sim.initialize_env(total_data_train_df, 
                                                  symbol, 
                                                  starting_days_ahead=STARTING_DAYS_AHEAD,
                                                  possible_fractions=POSSIBLE_FRACTIONS,
                                                  n_levels=10)
    # Test
    TEST_DAYS_AHEAD = 20
    env.set_test_data(total_data_test_df, TEST_DAYS_AHEAD)
    tic = time()
    results_list = sim.simulate_period(total_data_test_df, 
                                    symbol,
                                    agent,
                                    learn=False,
                                    starting_days_ahead=TEST_DAYS_AHEAD,
                                    possible_fractions=POSSIBLE_FRACTIONS,
                                    verbose=False,
                                    other_env=env)
    toc = time()
    
    # Show results
    print('Elapsed time: {} seconds.'.format((toc-tic)))
    print('Random Actions Rate: {}'.format(agent.random_actions_rate))
    show_results([results_list], data_test_df, symbol, graph=False)
    
    # Save some results
    total_value = results_list.sum(axis=1)
    sharpe, cumret, _, _, _ = value_eval(pd.DataFrame(total_value))
    sharpe_bench, cumret_bench, _, _, _ = value_eval(pd.DataFrame(data_test_df['Close'].iloc[TEST_DAYS_AHEAD:]))
    sharpe_q = sharpe / sharpe_bench
    cumret_q = cumret / cumret_bench
    results_df = results_df.append(pd.DataFrame({symbol: {'sharpe': sharpe,
                                         'sharpe_bench': sharpe_bench,
                                         'cum_ret': cumret,
                                         'cum_ret_bench': cumret_bench,
                                         'sharpe_quotient': sharpe_q,
                                         'cum_ret_quotient': cumret_q}}).T)


Testing with these symbols:
['CTL' 'PNC' 'PG' 'BAC' 'OMC' 'DOW' 'CERN' 'LB' 'STT' 'MHK' 'EIX' 'HAL'
 'AMD' 'CMS' 'KR' 'ROP' 'UTX' 'ADP' 'AZO' 'RRC' 'MRK' 'AIG' 'TWX' 'BBY'
 'HCN' 'ZION' 'DIS' 'AN' 'IPG' 'APH' 'NI' 'STZ' 'SCG' 'NKE' 'WHR' 'PPL'
 'ROK' 'RF' 'HRB' 'HRS' 'DVN' 'WMB' 'TGNA' 'TSO' 'WY' 'IDXX' 'GLW' 'SHW'
 'BIIB' 'AJG' 'UNM' 'CAT' 'EOG' 'PBCT' 'HOG' 'LLY' 'ADSK' 'IBM' 'IR' 'GD'
 'BAX' 'CL' 'ADM' 'AMGN' 'PSA' 'APC' 'ESRX' 'EXC' 'ADBE' 'GWW' 'CAG' 'NUE'
 'CHK' 'XRAY' 'HSY' 'DTE' 'CLX' 'LRCX' 'LNT' 'MCD' 'M' 'BBBY' 'XEL' 'KSS'
 'WFM' 'PX' 'CELG' 'MOS' 'DHI' 'PPG' 'PHM' 'BA' 'AVY' 'FAST' 'SYMC' 'MTB'
 'PKI' 'DOV' 'WMT' 'PVH']
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.23154973983764648s.  Value: 9529.020000000013.Elapsed time: 10.270526885986328 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.045193201707058844
Cum. Ret.: -0.04709799999999864
AVG_DRET: -3.324237469541687e-05
STD_DRET: 0.011676675222534046
Final value: 9529.020000000013
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.20815229415893555s.  Value: 11461.670000000002.Elapsed time: 10.302802085876465 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.7427801901724845
Cum. Ret.: 0.14616700000000016
AVG_DRET: 0.0003040805871220824
STD_DRET: 0.00649873237890783
Final value: 11461.670000000002
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.177534818649292s.  Value: 10382.310000000009...Elapsed time: 8.822841882705688 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.2639847889904722
Cum. Ret.: 0.03823100000000079
AVG_DRET: 9.375440442830464e-05
STD_DRET: 0.005637843893571147
Final value: 10382.310000000009
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.2192373275756836s.  Value: 11859.970000000008.Elapsed time: 8.858989477157593 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.6176708440021935
Cum. Ret.: 0.17378400000000083
AVG_DRET: 0.00038010100947880585
STD_DRET: 0.009768821895326052
Final value: 11737.84000000001
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.17658448219299316s.  Value: 11068.77999999999..Elapsed time: 9.36438274383545 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.6149465409469408
Cum. Ret.: 0.10687799999999892
AVG_DRET: 0.0002279534199462513
STD_DRET: 0.005884492581313561
Final value: 11068.77999999999
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.19452357292175293s.  Value: 13224.340000000007.Elapsed time: 8.837015151977539 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 1.1572412834659753
Cum. Ret.: 0.31783400000000084
AVG_DRET: 0.0006071364700714636
STD_DRET: 0.008328421054297434
Final value: 13178.340000000007
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.1837761402130127s.  Value: 8026.369999999999.Elapsed time: 9.053290128707886 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.961936982331632
Cum. Ret.: -0.19736300000000007
AVG_DRET: -0.00043076623837330326
STD_DRET: 0.007108783803130333
Final value: 8026.369999999999
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.19234967231750488s.  Value: 11397.569999999996.Elapsed time: 9.057953834533691 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.6300578161941788
Cum. Ret.: 0.1397569999999997
AVG_DRET: 0.00030016550334426966
STD_DRET: 0.007562765704327452
Final value: 11397.569999999996
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.2005443572998047s.  Value: 8929.119999999999.Elapsed time: 9.863100528717041 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.5161465851935586
Cum. Ret.: -0.10708800000000007
AVG_DRET: -0.00021338852558286484
STD_DRET: 0.006562937593962216
Final value: 8929.119999999999
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18060731887817383s.  Value: 12215.019999999999.Elapsed time: 8.917678833007812 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 1.0037973179073008
Cum. Ret.: 0.22150199999999987
AVG_DRET: 0.0004393278459976426
STD_DRET: 0.0069477306053698
Final value: 12215.019999999999
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.1961045265197754s.  Value: 10984.730000000009.Elapsed time: 8.966152429580688 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.5622336818227801
Cum. Ret.: 0.09409400000000079
AVG_DRET: 0.00020296309507520011
STD_DRET: 0.0057306051798817785
Final value: 10940.940000000008
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.2356727123260498s.  Value: 7896.730000000011.Elapsed time: 10.325822114944458 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.6409476626928412
Cum. Ret.: -0.2095969999999988
AVG_DRET: -0.00043162395151244805
STD_DRET: 0.010690136203662548
Final value: 7904.030000000012
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.19776320457458496s.  Value: 31854.88000000001..Elapsed time: 9.498262882232666 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 1.7975018065709767
Cum. Ret.: 2.116788000000001
AVG_DRET: 0.002622438938376621
STD_DRET: 0.023159880787990108
Final value: 31167.88000000001
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18941259384155273s.  Value: 11063.189999999995.Elapsed time: 9.76248812675476 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.6491759994869665
Cum. Ret.: 0.10631899999999961
AVG_DRET: 0.00022482363493469873
STD_DRET: 0.005497684085889208
Final value: 11063.189999999995
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.23417377471923828s.  Value: 11792.460000000014.Elapsed time: 10.316590309143066 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.6836406883925652
Cum. Ret.: 0.17618600000000129
AVG_DRET: 0.0003743640882195168
STD_DRET: 0.008692937334240666
Final value: 11761.860000000013
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.1955263614654541s.  Value: 9601.260000000017.Elapsed time: 9.25663423538208 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.13783974197871646
Cum. Ret.: -0.04013399999999834
AVG_DRET: -6.041991077971618e-05
STD_DRET: 0.0069583440536847225
Final value: 9598.660000000016
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18374180793762207s.  Value: 9916.219999999994.Elapsed time: 9.258635520935059 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.005304853950276274
Cum. Ret.: -0.008378000000000663
AVG_DRET: -1.870100078614311e-06
STD_DRET: 0.005596180156354496
Final value: 9916.219999999994
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.17756986618041992s.  Value: 10919.589999999993.Elapsed time: 9.459774017333984 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.6471089540133568
Cum. Ret.: 0.09195899999999924
AVG_DRET: 0.00019384562793105248
STD_DRET: 0.004755310410050067
Final value: 10919.589999999993
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.19603681564331055s.  Value: 10097.119999999994.Elapsed time: 8.726715803146362 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.1284333769190053
Cum. Ret.: 0.01283199999999951
AVG_DRET: 3.690005083360281e-05
STD_DRET: 0.004560887218573531
Final value: 10128.319999999994
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18545269966125488s.  Value: 17938.660000000018.Elapsed time: 9.603624105453491 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 1.1139789274808876
Cum. Ret.: 0.7938660000000017
AVG_DRET: 0.0014130039649189682
STD_DRET: 0.020135697366436757
Final value: 17938.660000000018
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.177659273147583s.  Value: 8328.49.Elapsed time: 9.14042329788208 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.9390784690612982
Cum. Ret.: -0.16715100000000005
AVG_DRET: -0.0003606743253075789
STD_DRET: 0.00609696378197491
Final value: 8328.49
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18194246292114258s.  Value: 10088.509999999998.Elapsed time: 9.079984664916992 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.08154731586952269
Cum. Ret.: 0.005924999999999736
AVG_DRET: 3.363059389602621e-05
STD_DRET: 0.006546740645736938
Final value: 10059.249999999998
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18030929565429688s.  Value: 10623.630000000006.Elapsed time: 9.165901899337769 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.3437465482962636
Cum. Ret.: 0.06236300000000061
AVG_DRET: 0.0001493046556697409
STD_DRET: 0.006895015943185103
Final value: 10623.630000000006
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.1780381202697754s.  Value: 7329.6700000000055.Elapsed time: 9.267974138259888 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.9774249524313204
Cum. Ret.: -0.2738329999999993
AVG_DRET: -0.0006144096972054007
STD_DRET: 0.009978721688258984
Final value: 7261.670000000006
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.2306232452392578s.  Value: 9596.909999999998.Elapsed time: 9.192546606063843 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.09099579445048338
Cum. Ret.: -0.034907000000000354
AVG_DRET: -4.402162978735287e-05
STD_DRET: 0.007679714349115407
Final value: 9650.929999999997
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.17540621757507324s.  Value: 13492.11000000001..Elapsed time: 9.077039241790771 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 1.1485024969213717
Cum. Ret.: 0.34921100000000105
AVG_DRET: 0.0006634081398885444
STD_DRET: 0.009169573216876701
Final value: 13492.11000000001
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.1819465160369873s.  Value: 9554.070000000003.Elapsed time: 8.471277475357056 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.16535166090965522
Cum. Ret.: -0.0453209999999995
AVG_DRET: -7.191641155028384e-05
STD_DRET: 0.006904301018791171
Final value: 9546.790000000005
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.1809394359588623s.  Value: 9040.940000000002.Elapsed time: 8.460016250610352 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.3768060814084102
Cum. Ret.: -0.09590599999999971
AVG_DRET: -0.00018016805147005795
STD_DRET: 0.007590321100028071
Final value: 9040.940000000002
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18100857734680176s.  Value: 10545.810000000003.Elapsed time: 8.419506311416626 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.3542320004738302
Cum. Ret.: 0.05950900000000048
AVG_DRET: 0.00013947003604076143
STD_DRET: 0.006250192476379581
Final value: 10595.090000000004
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18704676628112793s.  Value: 8585.889999999996.Elapsed time: 8.458260297775269 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.6588601852569834
Cum. Ret.: -0.1414110000000004
AVG_DRET: -0.00029147982532124974
STD_DRET: 0.007022884192267107
Final value: 8585.889999999996
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.1785721778869629s.  Value: 3910.139999999999.6.Elapsed time: 8.77078890800476 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.6502659096041319
Cum. Ret.: -0.6107360000000001
AVG_DRET: -0.0011989339468687131
STD_DRET: 0.02926877465010126
Final value: 3892.6399999999994
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.180128812789917s.  Value: 9822.600000000004.Elapsed time: 8.448578357696533 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.034195476973119414
Cum. Ret.: -0.017739999999999645
AVG_DRET: -1.4530331666399658e-05
STD_DRET: 0.006745391050424635
Final value: 9822.600000000004
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.1809251308441162s.  Value: 8710.999999999998.Elapsed time: 8.468928337097168 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.692775692718589
Cum. Ret.: -0.13279400000000008
AVG_DRET: -0.0002755556554234681
STD_DRET: 0.006314179994511296
Final value: 8672.06
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.21460175514221191s.  Value: 7733.0599999999995.Elapsed time: 8.491547346115112 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -1.4520372095164926
Cum. Ret.: -0.22609
AVG_DRET: -0.0005156091370399053
STD_DRET: 0.0056369363321252435
Final value: 7739.099999999999
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.17861104011535645s.  Value: 10757.179999999998.Elapsed time: 8.449965476989746 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.3428867877613457
Cum. Ret.: 0.07571799999999995
AVG_DRET: 0.00019001798713474545
STD_DRET: 0.008797195281916586
Final value: 10757.179999999998
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18018078804016113s.  Value: 10854.309999999992.Elapsed time: 8.334309816360474 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.4458544082487735
Cum. Ret.: 0.09151099999999923
AVG_DRET: 0.0002099164141646686
STD_DRET: 0.007474008793654369
Final value: 10915.109999999991
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.1831357479095459s.  Value: 9908.37.Elapsed time: 8.43291687965393 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.018137223647820253
Cum. Ret.: -0.009162999999999921
AVG_DRET: 8.471843968047804e-06
STD_DRET: 0.007414936063257147
Final value: 9908.37
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.17499136924743652s.  Value: 14262.03.000000001.Elapsed time: 8.430533647537231 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 1.2844162558248757
Cum. Ret.: 0.4262030000000001
AVG_DRET: 0.0007833372211798813
STD_DRET: 0.009681513156860617
Final value: 14262.03
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18360328674316406s.  Value: 6739.699999999992.Elapsed time: 8.461484909057617 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -1.0248543501612377
Cum. Ret.: -0.3260300000000008
AVG_DRET: -0.00075048609703318
STD_DRET: 0.01162467373934
Final value: 6739.699999999992
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.1834406852722168s.  Value: 10857.270000000002.Elapsed time: 8.433289527893066 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.4188700841871782
Cum. Ret.: 0.08572700000000033
AVG_DRET: 0.00019896414880982749
STD_DRET: 0.007540423784476586
Final value: 10857.270000000002
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18449115753173828s.  Value: 6884.219999999999.Elapsed time: 8.379835605621338 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.3893846658992701
Cum. Ret.: -0.311578
AVG_DRET: -0.0005364693631233234
STD_DRET: 0.021870884682398267
Final value: 6884.219999999999
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.17589426040649414s.  Value: 13116.409999999996.Elapsed time: 8.434047222137451 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.5149214200983413
Cum. Ret.: 0.31037499999999985
AVG_DRET: 0.0009784179648505264
STD_DRET: 0.03016363870951075
Final value: 13103.749999999998
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18582439422607422s.  Value: 10243.599999999999.Elapsed time: 8.408087730407715 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.09441245595851504
Cum. Ret.: 0.007875000000000076
AVG_DRET: 4.595910410163324e-05
STD_DRET: 0.007727562557149013
Final value: 10078.75
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.1853342056274414s.  Value: 15833.239999999993.Elapsed time: 8.465044021606445 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 1.5213337845381052
Cum. Ret.: 0.5833239999999993
AVG_DRET: 0.0010090330033964224
STD_DRET: 0.01052885468833809
Final value: 15833.239999999993
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18074321746826172s.  Value: 10915.069999999996.Elapsed time: 8.405700206756592 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.37740729556115243
Cum. Ret.: 0.08217299999999961
AVG_DRET: 0.0001989119487921648
STD_DRET: 0.008366635549863282
Final value: 10821.729999999996
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18245267868041992s.  Value: 9517.76.Elapsed time: 8.440192699432373 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.13993029433420098
Cum. Ret.: -0.04558400000000007
AVG_DRET: -6.706589926722923e-05
STD_DRET: 0.007608346359518606
Final value: 9544.16
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.19172453880310059s.  Value: 10301.50000000001.Elapsed time: 8.384333610534668 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.2028994495075969
Cum. Ret.: 0.029729000000001005
AVG_DRET: 8.044718339936378e-05
STD_DRET: 0.006294050815816071
Final value: 10297.29000000001
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18198776245117188s.  Value: 9972.65.Elapsed time: 8.435845613479614 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.05603286564241822
Cum. Ret.: -0.002735000000000043
AVG_DRET: 2.9085571178744615e-05
STD_DRET: 0.008240148405435539
Final value: 9972.65
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18123722076416016s.  Value: 7588.859999999999.Elapsed time: 8.441560506820679 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.549692099042794
Cum. Ret.: -0.24688600000000027
AVG_DRET: -0.00048183041873763266
STD_DRET: 0.013914736605882863
Final value: 7531.139999999998
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.17849040031433105s.  Value: 9313.370000000014.Elapsed time: 8.348774433135986 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.36121341235322474
Cum. Ret.: -0.06470299999999862
AVG_DRET: -0.00012392485587799435
STD_DRET: 0.005446215539616856
Final value: 9352.970000000014
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.180694580078125s.  Value: 11773.27.Elapsed time: 8.385395288467407 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.8052716354164683
Cum. Ret.: 0.177327
AVG_DRET: 0.00036433288742624954
STD_DRET: 0.007182179320696595
Final value: 11773.27
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18145227432250977s.  Value: 9377.529999999993.Elapsed time: 8.449682474136353 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.2010878111386703
Cum. Ret.: -0.06224700000000061
AVG_DRET: -0.00010125048641995773
STD_DRET: 0.007993033660507588
Final value: 9377.529999999993
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18105292320251465s.  Value: 8221.779999999986.Elapsed time: 8.380849599838257 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.5428283563862818
Cum. Ret.: -0.17782200000000137
AVG_DRET: -0.00035307609930244584
STD_DRET: 0.010325380481452963
Final value: 8221.779999999986
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18186497688293457s.  Value: 11513.250000000002.Elapsed time: 8.415516138076782 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.7819267284314668
Cum. Ret.: 0.15132500000000015
AVG_DRET: 0.0003124189278543071
STD_DRET: 0.006342661719442992
Final value: 11513.250000000002
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.17589378356933594s.  Value: 6417.26.000000001..Elapsed time: 8.422601461410522 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -1.5719475004650079
Cum. Ret.: -0.3562939999999999
AVG_DRET: -0.0008735869843988715
STD_DRET: 0.008822027104411151
Final value: 6437.060000000001
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.1806478500366211s.  Value: 10762.239999999998.Elapsed time: 8.427208423614502 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.3542937571788174
Cum. Ret.: 0.07622399999999985
AVG_DRET: 0.0001873981749682994
STD_DRET: 0.008396574149003378
Final value: 10762.239999999998
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18320536613464355s.  Value: 8961.31.Elapsed time: 8.3893461227417 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.5282861772240743
Cum. Ret.: -0.1038690000000001
AVG_DRET: -0.0002078158107245155
STD_DRET: 0.006244671665347692
Final value: 8961.31
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18116044998168945s.  Value: 12278.45000000001.Elapsed time: 8.395339965820312 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 1.7311807660347198
Cum. Ret.: 0.22784500000000096
AVG_DRET: 0.00043375786769350147
STD_DRET: 0.0039774544737923
Final value: 12278.45000000001
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18128466606140137s.  Value: 9661.500000000005.Elapsed time: 8.453545808792114 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.0852681011877687
Cum. Ret.: -0.03384999999999949
AVG_DRET: -4.1458395628089515e-05
STD_DRET: 0.007718380242532242
Final value: 9661.500000000005
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.190232515335083s.  Value: 11509.989999999993.Elapsed time: 8.398939371109009 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.8771160572961709
Cum. Ret.: 0.1473689999999992
AVG_DRET: 0.00029984326874643813
STD_DRET: 0.005426721228968962
Final value: 11473.689999999991
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.17963886260986328s.  Value: 11666.009999999993.Elapsed time: 8.45229983329773 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.7418258660213972
Cum. Ret.: 0.16660099999999933
AVG_DRET: 0.00034728776572414565
STD_DRET: 0.007431693368223814
Final value: 11666.009999999993
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.1798102855682373s.  Value: 8288.98.Elapsed time: 8.503175497055054 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -1.052173991347168
Cum. Ret.: -0.1675740000000001
AVG_DRET: -0.00036516063320534494
STD_DRET: 0.005509303016406392
Final value: 8324.259999999998
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18506741523742676s.  Value: 10157.109999999997.Elapsed time: 8.445024013519287 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.1286703726574211
Cum. Ret.: 0.015710999999999586
AVG_DRET: 7.009468365121635e-05
STD_DRET: 0.008647822991666792
Final value: 10157.109999999997
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18073248863220215s.  Value: 10069.199999999995.Elapsed time: 8.44909119606018 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.08862156005370911
Cum. Ret.: 0.006919999999999593
AVG_DRET: 4.0888457318460985e-05
STD_DRET: 0.007324223777520761
Final value: 10069.199999999995
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18322491645812988s.  Value: 8944.42.Elapsed time: 8.386373519897461 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.4610187358271856
Cum. Ret.: -0.10555800000000004
AVG_DRET: -0.00020617927244532676
STD_DRET: 0.0070994825762272125
Final value: 8944.42
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18184232711791992s.  Value: 12913.319999999996.Elapsed time: 10.358964920043945 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.6829793817327914
Cum. Ret.: 0.28168599999999966
AVG_DRET: 0.0006142693785046386
STD_DRET: 0.014277479440759955
Final value: 12816.859999999997
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18062543869018555s.  Value: 7845.989999999988.Elapsed time: 8.409327268600464 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -1.417496412611377
Cum. Ret.: -0.21663300000000119
AVG_DRET: -0.0004912145116227249
STD_DRET: 0.005501099374546718
Final value: 7833.669999999988
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18050432205200195s.  Value: 9542.070000000007.Elapsed time: 8.43899941444397 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.053606464019976895
Cum. Ret.: -0.031700999999999424
AVG_DRET: -2.9268648689501374e-05
STD_DRET: 0.00866733895537069
Final value: 9682.990000000005
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18361163139343262s.  Value: 10273.090000000006.Elapsed time: 8.420465469360352 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.2357468544928136
Cum. Ret.: 0.027309000000000472
AVG_DRET: 6.564586977725789e-05
STD_DRET: 0.00442040203852094
Final value: 10273.090000000006
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18283939361572266s.  Value: 11434.770000000008.Elapsed time: 8.45274305343628 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.7370263081807589
Cum. Ret.: 0.14347700000000074
AVG_DRET: 0.0002987935078061589
STD_DRET: 0.006435591019542151
Final value: 11434.770000000008
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18050599098205566s.  Value: 8252.820000000002.Elapsed time: 8.406030416488647 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.27127520600135596
Cum. Ret.: -0.17471799999999982
AVG_DRET: -0.0002620314061020308
STD_DRET: 0.015333578319673217
Final value: 8252.820000000002
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18031978607177734s.  Value: 7864.2899999999945.Elapsed time: 8.470767974853516 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.7657447256660288
Cum. Ret.: -0.23176000000000052
AVG_DRET: -0.0004942071263724946
STD_DRET: 0.010245313682573882
Final value: 7682.399999999995
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18253016471862793s.  Value: 2188.710000000003.Elapsed time: 8.421484231948853 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.9247593034540824
Cum. Ret.: -0.7832429999999997
AVG_DRET: -0.0023506683029800666
STD_DRET: 0.040351800006278915
Final value: 2167.5700000000033
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.1807701587677002s.  Value: 10860.749999999984.Elapsed time: 8.421472072601318 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.4822429056246332
Cum. Ret.: 0.08607499999999835
AVG_DRET: 0.00019108871351429898
STD_DRET: 0.00629027249645384
Final value: 10860.749999999984
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.1756114959716797s.  Value: 12236.820000000002..Elapsed time: 8.453932285308838 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.6640928399996978
Cum. Ret.: 0.22368200000000016
AVG_DRET: 0.00048346239086296183
STD_DRET: 0.011556708737983246
Final value: 12236.820000000002
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18358778953552246s.  Value: 10399.409999999994.Elapsed time: 8.494065999984741 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.2646468532064674
Cum. Ret.: 0.03994099999999934
AVG_DRET: 9.892934821056783e-05
STD_DRET: 0.005934152238568438
Final value: 10399.409999999994
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.17448115348815918s.  Value: 12480.04999999999..Elapsed time: 8.39321517944336 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 1.678174074428098
Cum. Ret.: 0.24800499999999892
AVG_DRET: 0.0004695428558743376
STD_DRET: 0.004441590340813362
Final value: 12480.04999999999
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.1815493106842041s.  Value: 11410.560000000005.Elapsed time: 8.391175985336304 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.5373647696290342
Cum. Ret.: 0.14105600000000051
AVG_DRET: 0.00031792132568077573
STD_DRET: 0.009391841204803736
Final value: 11410.560000000005
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18185877799987793s.  Value: 8368.069999999985..Elapsed time: 8.496093511581421 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.8337038427546409
Cum. Ret.: -0.16319300000000148
AVG_DRET: -0.0003475220343229701
STD_DRET: 0.006617147462551121
Final value: 8368.069999999985
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.183607816696167s.  Value: 10115.979999999996.Elapsed time: 8.463354587554932 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.06382145737380468
Cum. Ret.: 0.003725999999999452
AVG_DRET: 1.9844066420790565e-05
STD_DRET: 0.004935875823908302
Final value: 10037.259999999995
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18241572380065918s.  Value: 8966.22.Elapsed time: 8.372565507888794 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.15069197127094366
Cum. Ret.: -0.10337800000000008
AVG_DRET: -0.00013130938701807197
STD_DRET: 0.013832667258702431
Final value: 8966.22
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18594574928283691s.  Value: 8477.88999999999.Elapsed time: 8.44313383102417 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.6531857314946449
Cum. Ret.: -0.15221100000000098
AVG_DRET: -0.0003131051925851666
STD_DRET: 0.0076094602240109775
Final value: 8477.88999999999
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.1801893711090088s.  Value: 8777.709999999988.Elapsed time: 8.477742910385132 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.5191061595338348
Cum. Ret.: -0.10812400000000122
AVG_DRET: -0.00021551482139281418
STD_DRET: 0.006590543503848264
Final value: 8918.759999999987
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18041038513183594s.  Value: 13514.949999999999.Elapsed time: 8.404338121414185 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 1.0586801210658183
Cum. Ret.: 0.3332029999999999
AVG_DRET: 0.0006433981439652802
STD_DRET: 0.009647511740669591
Final value: 13332.029999999999
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18154525756835938s.  Value: 10738.279999999999.Elapsed time: 8.399491310119629 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.31573606954521366
Cum. Ret.: 0.07382799999999978
AVG_DRET: 0.00019483138445569386
STD_DRET: 0.009795689005744684
Final value: 10738.279999999999
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.17562484741210938s.  Value: 9664.38999999999...Elapsed time: 8.459457159042358 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.12538240817802013
Cum. Ret.: -0.03356100000000095
AVG_DRET: -5.042345414051058e-05
STD_DRET: 0.006384049652862604
Final value: 9664.38999999999
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.17986464500427246s.  Value: 11193.850000000004.Elapsed time: 8.442967176437378 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.5118417824938383
Cum. Ret.: 0.1193850000000003
AVG_DRET: 0.000268306529068846
STD_DRET: 0.008321388077296734
Final value: 11193.850000000004
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.17471933364868164s.  Value: 12827.710000000001.Elapsed time: 8.467476844787598 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.7101476032636598
Cum. Ret.: 0.2827710000000001
AVG_DRET: 0.0006090356175012323
STD_DRET: 0.0136142692821903
Final value: 12827.710000000001
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18379974365234375s.  Value: 6371.469999999991.Elapsed time: 8.438016176223755 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -1.4606476470589977
Cum. Ret.: -0.36285300000000087
AVG_DRET: -0.0008878425728828063
STD_DRET: 0.009649188108932465
Final value: 6371.469999999991
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18110322952270508s.  Value: 7054.909999999992.Elapsed time: 8.48354721069336 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -1.1949896911419096
Cum. Ret.: -0.2897730000000007
AVG_DRET: -0.0006695139867972906
STD_DRET: 0.008893972164658563
Final value: 7102.269999999992
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.1801590919494629s.  Value: 11091.249999999989.Elapsed time: 8.485681772232056 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.523247255555617
Cum. Ret.: 0.1091249999999988
AVG_DRET: 0.00024179740222510433
STD_DRET: 0.007335757087953802
Final value: 11091.249999999989
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18584322929382324s.  Value: 10138.590000000007.Elapsed time: 8.402872562408447 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.12066129951266588
Cum. Ret.: 0.01379400000000075
AVG_DRET: 5.6781995751055596e-05
STD_DRET: 0.007470383974479714
Final value: 10137.940000000008
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18697142601013184s.  Value: 10880.660000000005.Elapsed time: 8.439812898635864 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.41166088695680353
Cum. Ret.: 0.08190600000000026
AVG_DRET: 0.0001901101773877418
STD_DRET: 0.0073310474763144395
Final value: 10819.060000000003
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18004179000854492s.  Value: 10709.249999999996.Elapsed time: 8.484179973602295 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.3327482128253974
Cum. Ret.: 0.07092499999999968
AVG_DRET: 0.00017794801193769927
STD_DRET: 0.008489413335467875
Final value: 10709.249999999996
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18235516548156738s.  Value: 13479.66.Elapsed time: 8.421953678131104 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 1.753016178871646
Cum. Ret.: 0.347966
AVG_DRET: 0.0006360358350668755
STD_DRET: 0.005759647850810143
Final value: 13479.66
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.1818087100982666s.  Value: 11971.340000000006.Elapsed time: 8.462928056716919 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.8527264868257134
Cum. Ret.: 0.1971340000000006
AVG_DRET: 0.00040121091083044583
STD_DRET: 0.007469013638555093
Final value: 11971.340000000006
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.1746835708618164s.  Value: 9472.569999999998...Elapsed time: 8.443870067596436 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.22006796562050235
Cum. Ret.: -0.05328600000000028
AVG_DRET: -9.153867568291838e-05
STD_DRET: 0.006603102923726064
Final value: 9467.139999999998
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18182969093322754s.  Value: 10837.469999999998.Elapsed time: 8.431835174560547 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.3794926861765683
Cum. Ret.: 0.0837469999999998
AVG_DRET: 0.00020228070159435964
STD_DRET: 0.008461577009639674
Final value: 10837.469999999998
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.17508649826049805s.  Value: 9612.280000000006..Elapsed time: 8.508755683898926 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: -0.13930906928769624
Cum. Ret.: -0.041393999999999376
AVG_DRET: -6.267399582671841e-05
STD_DRET: 0.007141809538002941
Final value: 9586.060000000007
----------------------------------------------------------------------------------------------------
Starting simulation for agent: Agent_0. 484 days of simulation to go.
Date 2016-12-28 00:00:00 (simulating until 2016-12-30 00:00:00).  Time: 0.18070101737976074s.  Value: 10497.83.Elapsed time: 8.39989972114563 seconds.
Random Actions Rate: 1.8722659434110675e-06
Sharpe ratio: 0.2290691902993946
Cum. Ret.: 0.04978299999999991
AVG_DRET: 0.000171723628140161
STD_DRET: 0.011900457159658453
Final value: 10497.83
----------------------------------------------------------------------------------------------------

In [16]:
results_df


Out[16]:
cum_ret cum_ret_bench cum_ret_quotient sharpe sharpe_bench sharpe_quotient
CTL -0.047098 -0.377813 0.124660 -0.045193 -0.669725 0.067480
PNC 0.146167 0.357159 0.409249 0.742780 0.849174 0.874709
PG 0.038231 -0.012218 -3.129060 0.263985 0.033548 7.868767
BAC 0.173784 0.429495 0.404624 0.617671 0.793640 0.778276
OMC 0.106878 0.163500 0.653689 0.614947 0.528033 1.164598
DOW 0.317834 0.265369 1.197704 1.157241 0.611136 1.893589
CERN -0.197363 -0.290124 0.680270 -0.961937 -0.589201 1.632613
LB 0.139757 -0.224042 -0.623797 0.630058 -0.363500 -1.733308
STT -0.107088 0.064949 -1.648794 -0.516147 0.257145 -2.007217
MHK 0.221502 0.197769 1.120006 1.003797 0.505824 1.984481
EIX 0.094094 0.054181 1.736670 0.562234 0.239434 2.348178
HAL -0.209597 0.303060 -0.691603 -0.640948 0.573159 -1.118273
AMD 2.116788 3.247191 0.651883 1.797502 1.377900 1.304523
CMS 0.106319 0.101933 1.043031 0.649176 0.360862 1.798960
KR 0.176186 -0.009472 -18.600970 0.683641 0.098904 6.912171
ROP -0.040134 0.163891 -0.244883 -0.137840 0.503870 -0.273562
UTX -0.008378 -0.059701 0.140332 -0.005305 -0.081586 0.065021
ADP 0.091959 0.231783 0.396746 0.647109 0.689429 0.938616
AZO 0.012832 0.330173 0.038865 0.128433 0.890149 0.144283
RRC 0.793866 -0.281322 -2.821913 1.113979 -0.037821 -29.454081
MRK -0.167151 -0.033016 5.062763 -0.939078 0.023876 -39.330796
AIG 0.005925 0.294293 0.020133 0.081547 0.740498 0.110125
TWX 0.062363 0.228273 0.273194 0.343747 0.580909 0.591739
BBY -0.273833 0.220189 -1.243629 -0.977425 0.467794 -2.089434
HCN -0.034907 -0.183282 0.190455 -0.090996 -0.319167 0.285104
ZION 0.349211 0.748172 0.466752 1.148502 1.110093 1.034600
DIS -0.045321 0.133689 -0.339004 -0.165352 0.426173 -0.387992
AN -0.095906 -0.180148 0.532373 -0.376806 -0.212898 1.769889
IPG 0.059509 0.158911 0.374480 0.354232 0.462870 0.765294
APH -0.141411 0.238938 -0.591831 -0.658860 0.669513 -0.984088
... ... ... ... ... ... ...
CAG -0.174718 0.106294 -1.643729 -0.271275 0.341172 -0.795127
NUE -0.231760 0.346302 -0.669243 -0.765745 0.672203 -1.139158
CHK -0.783243 -0.657895 1.190529 -0.924759 -0.141669 6.527611
XRAY 0.086075 0.143168 0.601215 0.482243 0.449622 1.072552
HSY 0.223682 -0.006054 -36.946586 0.664093 0.100435 6.612198
DTE 0.039941 0.088749 0.450045 0.264647 0.331811 0.797584
CLX 0.248005 0.113048 2.193796 1.678174 0.432594 3.879329
LRCX 0.141056 0.379207 0.371976 0.537365 0.738697 0.727450
LNT -0.163193 0.099536 -1.639543 -0.833704 0.351418 -2.372400
MCD 0.003726 0.315750 0.011800 0.063821 0.921594 0.069251
M -0.103378 -0.442038 0.233867 -0.150692 -0.724551 0.207980
BBBY -0.152211 -0.462860 0.328849 -0.653186 -1.168773 0.558865
XEL -0.108124 0.083311 -1.297833 -0.519106 0.318974 -1.627426
KSS 0.333203 -0.196289 -1.697512 1.058680 -0.107644 -9.835036
WFM 0.073828 -0.421261 -0.175255 0.315736 -0.854322 -0.369575
PX -0.033561 -0.041155 0.815472 -0.125382 -0.030229 4.147786
CELG 0.119385 -0.023783 -5.019674 0.511842 0.124642 4.106493
MOS 0.282771 -0.402526 -0.702491 0.710148 -0.488094 -1.454939
DHI -0.362853 0.099799 -3.635846 -1.460648 0.316697 -4.612126
PPG -0.289773 -0.152870 1.895556 -1.194990 -0.279746 4.271699
PHM 0.109125 -0.106031 -1.029179 0.523247 -0.059941 -8.729422
BA 0.013794 0.064406 0.214173 0.120661 0.258010 0.467661
AVY 0.081906 0.371484 0.220483 0.411661 0.869891 0.473233
FAST 0.070925 0.044696 1.586815 0.332748 0.214625 1.550367
SYMC 0.347966 -0.042101 -8.265021 1.753016 0.064822 27.043344
MTB 0.197134 0.353786 0.557212 0.852726 0.791342 1.077571
PKI -0.053286 0.143891 -0.370321 -0.220068 0.425503 -0.517195
DOV 0.083747 0.035231 2.377101 0.379493 0.199723 1.900096
WMT -0.041394 -0.193560 0.213857 -0.139309 -0.463481 0.300571
PVH 0.049783 -0.189873 -0.262190 0.229069 -0.165545 -1.383725

100 rows × 6 columns


In [17]:
results_df['sharpe_delta'] = results_df['sharpe'] - results_df['sharpe_bench']
results_df


Out[17]:
cum_ret cum_ret_bench cum_ret_quotient sharpe sharpe_bench sharpe_quotient sharpe_delta
CTL -0.047098 -0.377813 0.124660 -0.045193 -0.669725 0.067480 0.624532
PNC 0.146167 0.357159 0.409249 0.742780 0.849174 0.874709 -0.106394
PG 0.038231 -0.012218 -3.129060 0.263985 0.033548 7.868767 0.230436
BAC 0.173784 0.429495 0.404624 0.617671 0.793640 0.778276 -0.175969
OMC 0.106878 0.163500 0.653689 0.614947 0.528033 1.164598 0.086913
DOW 0.317834 0.265369 1.197704 1.157241 0.611136 1.893589 0.546105
CERN -0.197363 -0.290124 0.680270 -0.961937 -0.589201 1.632613 -0.372736
LB 0.139757 -0.224042 -0.623797 0.630058 -0.363500 -1.733308 0.993558
STT -0.107088 0.064949 -1.648794 -0.516147 0.257145 -2.007217 -0.773292
MHK 0.221502 0.197769 1.120006 1.003797 0.505824 1.984481 0.497974
EIX 0.094094 0.054181 1.736670 0.562234 0.239434 2.348178 0.322800
HAL -0.209597 0.303060 -0.691603 -0.640948 0.573159 -1.118273 -1.214106
AMD 2.116788 3.247191 0.651883 1.797502 1.377900 1.304523 0.419602
CMS 0.106319 0.101933 1.043031 0.649176 0.360862 1.798960 0.288314
KR 0.176186 -0.009472 -18.600970 0.683641 0.098904 6.912171 0.584737
ROP -0.040134 0.163891 -0.244883 -0.137840 0.503870 -0.273562 -0.641710
UTX -0.008378 -0.059701 0.140332 -0.005305 -0.081586 0.065021 0.076281
ADP 0.091959 0.231783 0.396746 0.647109 0.689429 0.938616 -0.042320
AZO 0.012832 0.330173 0.038865 0.128433 0.890149 0.144283 -0.761715
RRC 0.793866 -0.281322 -2.821913 1.113979 -0.037821 -29.454081 1.151800
MRK -0.167151 -0.033016 5.062763 -0.939078 0.023876 -39.330796 -0.962955
AIG 0.005925 0.294293 0.020133 0.081547 0.740498 0.110125 -0.658950
TWX 0.062363 0.228273 0.273194 0.343747 0.580909 0.591739 -0.237162
BBY -0.273833 0.220189 -1.243629 -0.977425 0.467794 -2.089434 -1.445219
HCN -0.034907 -0.183282 0.190455 -0.090996 -0.319167 0.285104 0.228171
ZION 0.349211 0.748172 0.466752 1.148502 1.110093 1.034600 0.038410
DIS -0.045321 0.133689 -0.339004 -0.165352 0.426173 -0.387992 -0.591525
AN -0.095906 -0.180148 0.532373 -0.376806 -0.212898 1.769889 -0.163908
IPG 0.059509 0.158911 0.374480 0.354232 0.462870 0.765294 -0.108638
APH -0.141411 0.238938 -0.591831 -0.658860 0.669513 -0.984088 -1.328374
... ... ... ... ... ... ... ...
CAG -0.174718 0.106294 -1.643729 -0.271275 0.341172 -0.795127 -0.612447
NUE -0.231760 0.346302 -0.669243 -0.765745 0.672203 -1.139158 -1.437947
CHK -0.783243 -0.657895 1.190529 -0.924759 -0.141669 6.527611 -0.783090
XRAY 0.086075 0.143168 0.601215 0.482243 0.449622 1.072552 0.032621
HSY 0.223682 -0.006054 -36.946586 0.664093 0.100435 6.612198 0.563658
DTE 0.039941 0.088749 0.450045 0.264647 0.331811 0.797584 -0.067164
CLX 0.248005 0.113048 2.193796 1.678174 0.432594 3.879329 1.245580
LRCX 0.141056 0.379207 0.371976 0.537365 0.738697 0.727450 -0.201332
LNT -0.163193 0.099536 -1.639543 -0.833704 0.351418 -2.372400 -1.185122
MCD 0.003726 0.315750 0.011800 0.063821 0.921594 0.069251 -0.857772
M -0.103378 -0.442038 0.233867 -0.150692 -0.724551 0.207980 0.573859
BBBY -0.152211 -0.462860 0.328849 -0.653186 -1.168773 0.558865 0.515587
XEL -0.108124 0.083311 -1.297833 -0.519106 0.318974 -1.627426 -0.838080
KSS 0.333203 -0.196289 -1.697512 1.058680 -0.107644 -9.835036 1.166324
WFM 0.073828 -0.421261 -0.175255 0.315736 -0.854322 -0.369575 1.170058
PX -0.033561 -0.041155 0.815472 -0.125382 -0.030229 4.147786 -0.095154
CELG 0.119385 -0.023783 -5.019674 0.511842 0.124642 4.106493 0.387200
MOS 0.282771 -0.402526 -0.702491 0.710148 -0.488094 -1.454939 1.198242
DHI -0.362853 0.099799 -3.635846 -1.460648 0.316697 -4.612126 -1.777345
PPG -0.289773 -0.152870 1.895556 -1.194990 -0.279746 4.271699 -0.915244
PHM 0.109125 -0.106031 -1.029179 0.523247 -0.059941 -8.729422 0.583188
BA 0.013794 0.064406 0.214173 0.120661 0.258010 0.467661 -0.137349
AVY 0.081906 0.371484 0.220483 0.411661 0.869891 0.473233 -0.458230
FAST 0.070925 0.044696 1.586815 0.332748 0.214625 1.550367 0.118123
SYMC 0.347966 -0.042101 -8.265021 1.753016 0.064822 27.043344 1.688194
MTB 0.197134 0.353786 0.557212 0.852726 0.791342 1.077571 0.061385
PKI -0.053286 0.143891 -0.370321 -0.220068 0.425503 -0.517195 -0.645571
DOV 0.083747 0.035231 2.377101 0.379493 0.199723 1.900096 0.179770
WMT -0.041394 -0.193560 0.213857 -0.139309 -0.463481 0.300571 0.324172
PVH 0.049783 -0.189873 -0.262190 0.229069 -0.165545 -1.383725 0.394615

100 rows × 7 columns


In [18]:
delta = results_df['sharpe_delta']
pd.DataFrame(delta.describe())


Out[18]:
sharpe_delta
count 100.000000
mean -0.118791
std 0.759289
min -1.797214
25% -0.666129
50% -0.074547
75% 0.400861
max 1.688194

In [19]:
delta.hist(bins=20)


Out[19]:
<matplotlib.axes._subplots.AxesSubplot at 0x7f4de568e588>

In [ ]: