@ -342,8 +342,8 @@ def buildPort():
# role, test_info['annual_ret'], test_info['vol'], test_info['mdd'], test_info['annual_sr'],
# role, test_info['annual_ret'], test_info['vol'], test_info['mdd'], test_info['annual_sr'],
# test_info['beta'], test_info['alpha'], test_info['var10'], test_info['R2'], True, comment, stock_list, list(sol), sep=", ")
# test_info['beta'], test_info['alpha'], test_info['var10'], test_info['R2'], True, comment, stock_list, list(sol), sep=", ")
# print("-"*10)
# print("-"*10)
data = ( ts , name , session . get ( ' username ' ) . split ( ' @ ' ) [ 0 ] , comp ,
data = ( ts , name , session . get ( ' username ' ) . split ( ' @ ' ) [ 0 ] , comp , role , ratio , test_info [ ' annual_ret ' ] ,
role , ratio , test_info [ ' annual_ret ' ] , test_info [ ' vol ' ] , test_info [ ' mdd ' ] , test_info [ ' annual_sr ' ] ,
test_info [ ' vol ' ] , test_info [ ' mdd ' ] , test_info [ ' annual_sr ' ] ,
test_info [ ' beta ' ] , test_info [ ' alpha ' ] , test_info [ ' var10 ' ] , test_info [ ' R2 ' ] , True , comment , stock_list , list ( sol ) )
test_info [ ' beta ' ] , test_info [ ' alpha ' ] , test_info [ ' var10 ' ] , test_info [ ' R2 ' ] , True , comment , stock_list , list ( sol ) )
sql = ' insert into strategy \
sql = ' insert into strategy \
( date , name , username , competition , role , ratio , annual_ret , vol , mdd , annual_sr , beta , alpha , var10 , R2 , tw , comment , assets , assets_position ) \
( date , name , username , competition , role , ratio , annual_ret , vol , mdd , annual_sr , beta , alpha , var10 , R2 , tw , comment , assets , assets_position ) \
@ -353,7 +353,7 @@ def buildPort():
curs . execute ( sql , data )
curs . execute ( sql , data )
conn . close ( )
conn . close ( )
print ( " \n ------Write in Success-------- \n " )
print ( " \n ------Write in Success-------- \n " )
return ''' <span>投資組合已完成建立,請至<a class= " badge rounded-pill text-bg-primary " href= " / " >#TODO:insert link</a>查詢分析結果。</span> '''
return ''' <span>投資組合已完成建立,請至 <a class= " badge rounded-pill text-bg-primary " href= " /result " >#TODO:insert link</a> 查詢分析結果。</span> '''