pyfolio教程3——create_interesting_times_tear_sheet

      We sometimes special attention for some period of time, such as 911, the Internet bubble, what alien invasion. In pyfolio, there is one interesting times tear sheet, in fact, is to put some special time for everyone to see magnified.

      As for the definition of specific time periods:

      In this file pyfolio folder below, there is a py this file, set inside it:

# Dotcom bubble
PERIODS['Dotcom'] = (pd.Timestamp('20000310'), pd.Timestamp('20000910'))

# Lehmann Brothers
PERIODS['Lehman'] = (pd.Timestamp('20080801'), pd.Timestamp('20081001'))

# 9/11
PERIODS['9/11'] = (pd.Timestamp('20010911'), pd.Timestamp('20011011'))

# 05/08/11  US down grade and European Debt Crisis 2011
PERIODS[
    'US downgrade/European Debt Crisis'] = (pd.Timestamp('20110805'),
                                            pd.Timestamp('20110905'))

自己设置一个
PERIODS['lyx'] = (pd.Timestamp('20180301'), pd.Timestamp('20180801'))

then:

pf.create_interesting_times_tear_sheet(return_ser['return'], benchmark_rets=return_ser['bench'])

      We look at this result:

      So, this is very simple, that looked at the details.

 

 

 

 

Published 205 original articles · won praise 236 · views 980 000 +

Guess you like

Origin blog.csdn.net/qtlyx/article/details/88752490