] settings['lookback'] = 252 settings['budget'] = 10**6 settings['slippage'] = 0.05 return settings # Evaluate trading system defined in current file. if __name__ == '__main__': ''' import the toolbox and use it to run this strategy ''' from quantiacsToolbox.quantiacsToolbox import runts, stats res = runts(__file__) lst_markets = res['settings']['markets'] try: i = lst_markets.index('fundEquity') del lst_markets[i] except: pass for i in range(0, len(lst_markets)): ticker = lst_markets[i] market_equity = np.array(res['marketEquity']) equity = market_equity[:, i] my_stats = stats(equity) print('ticker ' + ticker + ' Sharpe:' + str(my_stats['sharpe']))
def mySettings(): """ Define your trading system settings here """ # Futures Contracts settings = {} settings['markets'] = ['CASH', 'F_AD', 'F_AE', 'F_AH', 'F_AX', 'F_BC', 'F_BG', 'F_BO', 'F_BP', 'F_C', 'F_CA', 'F_CC', 'F_CD', 'F_CF', 'F_CL', 'F_CT', 'F_DL', 'F_DM', 'F_DT', 'F_DX', 'F_DZ', 'F_EB', 'F_EC', 'F_ED', 'F_ES', 'F_F', 'F_FB', 'F_FC', 'F_FL', 'F_FM', 'F_FP', 'F_FV', 'F_FY', 'F_GC', 'F_GD', 'F_GS', 'F_GX', 'F_HG', 'F_HO', 'F_HP', 'F_JY', 'F_KC', 'F_LB', 'F_LC', 'F_LN', 'F_LQ', 'F_LR', 'F_LU', 'F_LX', 'F_MD', 'F_MP', 'F_ND', 'F_NG', 'F_NQ', 'F_NR', 'F_NY', 'F_O', 'F_OJ', 'F_PA', 'F_PL', 'F_PQ', 'F_RB', 'F_RF', 'F_RP', 'F_RR', 'F_RU', 'F_RY', 'F_S', 'F_SB', 'F_SF', 'F_SH', 'F_SI', 'F_SM', 'F_SS', 'F_SX', 'F_TR', 'F_TU', 'F_TY', 'F_UB', 'F_US', 'F_UZ', 'F_VF', 'F_VT', 'F_VW', 'F_W', 'F_XX', 'F_YM', 'F_ZQ'] settings['lookback'] = 252 settings['budget'] = 10 ** 6 settings['slippage'] = 0.05 # these are specific to the regression settings['threshold'] = 0.2 settings['dimension'] = 3 return settings # Evaluate trading system defined in current file. if __name__ == '__main__': from quantiacsToolbox import quantiacsToolbox results = quantiacsToolbox.runts(__file__)
# 'UPS','USB','UTX','V','VZ','WAG','WFC','WMT','XOM'] # Futures Contracts settings['markets'] = ['CASH', 'F_AD', 'F_AE'] # settings['markets'] = ['CASH', 'F_AD', 'F_AE', 'F_AH', 'F_AX', 'F_BC', 'F_BG', 'F_BO', 'F_BP', 'F_C', 'F_CA', # 'F_CC', 'F_CD', 'F_CF', 'F_CL', 'F_CT', 'F_DL', 'F_DM', 'F_DT', 'F_DX', 'F_DZ', 'F_EB', # 'F_EC', 'F_ED', 'F_ES', 'F_F', 'F_FB', 'F_FC', 'F_FL', 'F_FM', 'F_FP', 'F_FV', 'F_FY', # 'F_GC', 'F_GD', 'F_GS', 'F_GX', 'F_HG', 'F_HO', 'F_HP', 'F_JY', 'F_KC', 'F_LB', 'F_LC', # 'F_LN', 'F_LQ', 'F_LR', 'F_LU', 'F_LX', 'F_MD', 'F_MP', 'F_ND', 'F_NG', 'F_NQ', 'F_NR', # 'F_NY', 'F_O', 'F_OJ', 'F_PA', 'F_PL', 'F_PQ', 'F_RB', 'F_RF', 'F_RP', 'F_RR', 'F_RU', # 'F_RY', 'F_S', 'F_SB', 'F_SF', 'F_SH', 'F_SI', 'F_SM', 'F_SS', 'F_SX', 'F_TR', 'F_TU', # 'F_TY', 'F_UB', 'F_US', 'F_UZ', 'F_VF', 'F_VT', 'F_VW', 'F_VX', 'F_W', 'F_XX', 'F_YM', # 'F_ZQ'] settings['lookback'] = 504 settings['budget'] = 10**6 settings['slippage'] = 0.05 settings['beginInSample'] = '20180101' settings['endInSample'] = '20201231' return settings # Evaluate trading system defined in current file. if __name__ == '__main__': from quantiacsToolbox.quantiacsToolbox import runts, optimize results = runts(__file__) #optimize(__file__)
def mySettings(): """ Define your trading system settings here """ settings = {} settings['markets'] = [ 'CASH', 'F_AD', 'F_AE', 'F_AH', 'F_AX', 'F_BC', 'F_BG', 'F_BO', 'F_BP', 'F_C', 'F_CA', 'F_CC', 'F_CD', 'F_CF', 'F_CL', 'F_CT', 'F_DL', 'F_DM', 'F_DT', 'F_DX', 'F_DZ', 'F_EB', 'F_EC', 'F_ED', 'F_ES', 'F_F', 'F_FB', 'F_FC', 'F_FL', 'F_FM', 'F_FP', 'F_FV', 'F_FY', 'F_GC', 'F_GD', 'F_GS', 'F_GX', 'F_HG', 'F_HO', 'F_HP', 'F_JY', 'F_KC', 'F_LB', 'F_LC', 'F_LN', 'F_LQ', 'F_LR', 'F_LU', 'F_LX', 'F_MD', 'F_MP', 'F_ND', 'F_NG', 'F_NQ', 'F_NR', 'F_NY', 'F_O', 'F_OJ', 'F_PA', 'F_PL', 'F_PQ', 'F_RB', 'F_RF', 'F_RP', 'F_RR', 'F_RU', 'F_RY', 'F_S', 'F_SB', 'F_SF', 'F_SH', 'F_SI', 'F_SM', 'F_SS', 'F_SX', 'F_TR', 'F_TU', 'F_TY', 'F_UB', 'F_US', 'F_UZ', 'F_VF', 'F_VT', 'F_VW', 'F_VX', 'F_W', 'F_XX', 'F_YM', 'F_ZQ' ] settings['lookback'] = 252 settings['budget'] = 10**6 settings['slippage'] = 0.05 settings['gap'] = 20 settings['dimension'] = 5 return settings if __name__ == '__main__': from quantiacsToolbox.quantiacsToolbox import runts runts(__file__)