<s> '''<STR_LIT>''' <EOL> import QSTK . qstkutil . tsutil as tsu <EOL> def get_winning_days ( fund_ts ) : <EOL> """<STR_LIT>""" <EOL> return tsu . get_winning_days ( tsu . daily ( fund_ts ) ) <EOL> def get_max_draw_down ( fund_ts ) : <EOL> """<STR_LIT>""" <EOL> MDD = <NUM_LIT:0> <EOL> DD = <NUM_LIT:0> <EOL> peak = - <NUM_LIT> <EOL> for value in fund_ts : <EOL> if ( value > peak ) : <EOL> peak = value <EOL> else : <EOL> DD = ( peak - value ) / peak <EOL> if ( DD > MDD ) : <EOL> MDD = DD <EOL> return - <NUM_LIT:1> * MDD <EOL> def get_sortino_ratio ( fund_ts ) : <EOL> """<STR_LIT>""" <EOL> return tsu . get_sortino_ratio ( tsu . daily ( fund_ts ) ) <EOL> def get_sharpe_ratio ( fund_ts ) : <EOL> """<STR_LIT>""" <EOL> return tsu . get_sharpe_ratio ( tsu . daily ( fund_ts ) ) </s>
