Exemplo n.º 1
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : 2017-10-26 16:29:29
# @Author  : Li Hao ([email protected])
# @Link    : https://github.com/SAmmer0
# @Version : $Id$
'''
低特异波动率组
'''
from portmonitor.utils import MonitorConfig, factor_stockfilter_template

stock_filter = factor_stockfilter_template('SPECIAL_VOL', group_id=0)

# 监控配置必须以portfolio命名
portfolio = MonitorConfig(stock_filter, '2017-10-26',
                          'SPECIAL_VOL_LOW')  # 其他采用默认参数
Exemplo n.º 2
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : 2017-11-09 09:11:59
# @Author  : Li Hao ([email protected])
# @Link    : https://github.com/SAmmer0
# @Version : $Id$
'''
高三月动量组合
'''
from portmonitor.utils import MonitorConfig, factor_stockfilter_template


stock_filter = factor_stockfilter_template('MOM_3M', group_id=4)


# 监控配置必须以portfolio命名
portfolio = MonitorConfig(stock_filter, '2017-11-09', 'UP_MOM3M')  # 其他采用默认参数
Exemplo n.º 3
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : 2017-12-01 10:39:09
# @Author  : Hao Li ([email protected])
# @Link    : https://github.com/SAmmer0
# @Version : $Id$
'''
低beta组合
'''
from portmonitor.utils import MonitorConfig, factor_stockfilter_template

stock_filter = factor_stockfilter_template('BETA', group_id=0, group_num=20)

# 监控配置必须以portfolio命名
portfolio = MonitorConfig(stock_filter, '2017-12-01', 'LOW_BETA')  # 其他采用默认参数
Exemplo n.º 4
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : 2017-10-23 16:19:32
# @Author  : Li Hao ([email protected])
# @Link    : https://github.com/SAmmer0
# @Version : $Id$

from portmonitor.utils import MonitorConfig


def stock_filter(date):
    return ['002852.SZ']


# 监控配置必须以portfolio命名
portfolio = MonitorConfig(stock_filter, '2017-10-20', 'TEST')  # 其他采用默认参数
Exemplo n.º 5
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : 2017-11-07 09:29:08
# @Author  : Li Hao ([email protected])
# @Link    : https://github.com/SAmmer0
# @Version : $Id$

'''
小市值组中筛选低前景值股票
'''
from portmonitor.utils import MonitorConfig, query_data_bydate
from fmanager import query


def stock_filter(date):
    data = query_data_bydate(date, {'TOTAL_MKTVALUE': 'cap', 'PT_VALUE_1W': 'pt_value',
                                    'ST_TAG': 'st_tag', 'TRADEABLE': 'trade_data'})
    data = data.loc[(data.st_tag == 0) & (data.trade_data == 1)].dropna(subset=['cap', 'pt_value'],
                                                                        axis=0)
    data = data.loc[data.cap <= data.cap.quantile(0.2)]
    data = data.loc[data.pt_value <= data.pt_value.quantile(0.2)]
    out = data.index.tolist()
    return out


# 监控配置必须以portfolio命名
portfolio = MonitorConfig(stock_filter, '2017-11-07', 'LOWPT_IN_SC')  # 其他采用默认参数
Exemplo n.º 6
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : 2017-10-26 09:23:13
# @Author  : Li Hao ([email protected])
# @Link    : https://github.com/SAmmer0
# @Version : $Id$
'''
大市值组
'''
from portmonitor.utils import MonitorConfig, factor_stockfilter_template

stock_filter = factor_stockfilter_template('TOTAL_MKTVALUE', group_id=4)

# 监控配置必须以portfolio命名
portfolio = MonitorConfig(stock_filter, '2017-10-20', 'BIG_CAP')  # 其他采用默认参数
Exemplo n.º 7
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author  : Li Hao ([email protected])
# @Link    : https://github.com/SAmmer0
# @Version : $Id$
'''
低季度换手率组
'''
from portmonitor.utils import MonitorConfig, factor_stockfilter_template


stock_filter = factor_stockfilter_template('STOQ', group_id=0)


# 监控配置必须以portfolio命名
portfolio = MonitorConfig(stock_filter, '2017-10-31', 'LOW_STOQ')  # 其他采用默认参数
Exemplo n.º 8
0
# @Date    : 2018-01-08 13:26:43
# @Author  : Hao Li ([email protected])
# @Link    : https://github.com/SAmmer0
# @Version : $Id$
'''
大市值组中筛选高前景值股票
'''
from portmonitor.utils import MonitorConfig, query_data_bydate
from fmanager import query


def stock_filter(date):
    data = query_data_bydate(
        date, {
            'TOTAL_MKTVALUE': 'cap',
            'PT_VALUE_1W': 'pt_value',
            'ST_TAG': 'st_tag',
            'TRADEABLE': 'trade_data'
        })
    data = data.loc[(data.st_tag == 0) & (data.trade_data == 1)].dropna(
        subset=['cap', 'pt_value'], axis=0)
    data = data.loc[data.cap >= data.cap.quantile(0.8)]
    data = data.loc[data.pt_value >= data.pt_value.quantile(0.8)]
    out = data.index.tolist()
    return out


# 监控配置必须以portfolio命名
portfolio = MonitorConfig(stock_filter, '2018-01-08',
                          'HIGHPT_IN_BC')  # 其他采用默认参数
Exemplo n.º 9
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : 2017-10-26 16:34:59
# @Author  : Li Hao ([email protected])
# @Link    : https://github.com/SAmmer0
# @Version : $Id$

'''
高BP组合
'''
from portmonitor.utils import MonitorConfig, factor_stockfilter_template


stock_filter = factor_stockfilter_template('BP', group_id=4)


# 监控配置必须以portfolio命名
portfolio = MonitorConfig(stock_filter, '2017-10-26', 'BP_HIGH')  # 其他采用默认参数
Exemplo n.º 10
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : 2017-11-09 09:08:11
# @Author  : Li Hao ([email protected])
# @Link    : https://github.com/SAmmer0
# @Version : $Id$
'''
低一月动量组合
'''
from portmonitor.utils import MonitorConfig, factor_stockfilter_template

stock_filter = factor_stockfilter_template('MOM_1M', group_id=0)

# 监控配置必须以portfolio命名
portfolio = MonitorConfig(stock_filter, '2017-11-09', 'DOWN_MOM1M')  # 其他采用默认参数