예제 #1
0
def other_indicator(request):
    """
    离线计算其他指标
    :param request:
        : indicatorId: 指标Id
    :return:
    """

    req = request.data

    try:
        bun = Bunch(req)

        indicatorId = bun.indicatorId
    except:
        raise Error("indicatorId 不能为空")

    uuid = uuid_util.gen_uuid()
    model = OfflineTaskModel(TaskModel.qitazhibiao, offline_value_service.other_indicator, request, uuid,
                             extVal=indicatorId)

    ThreadTool.pool.submit(logic_processor.doLogic, (model,))

    view = OffLineView(uuid)

    return JsonResponse(convert_to_dict(view))
예제 #2
0
def indicator_score_rank(request, format=None):
    """
    指标打分
    :param request:
           indicatorId    : 指标id
           {"indicatorId": "1"}
    :return:
    """

    req = request.data
    logger.info("req:", req)

    try:
        m = Bunch(req)
        indicatorId = m.indicatorId
    except Exception as ae:
        raise Error("参数验证异常", ae)

    uuid = uuid_util.gen_uuid()

    model = OfflineTaskModel(TaskModel.zhibiaodafen,
                             offline_score_service.indicator_score_rank,
                             request, uuid, indicatorId, "1")

    ThreadTool.pool.submit(logic_processor.doLogic, (model, ))

    view = OffLineView(uuid)

    return JsonResponse(convert_to_dict(view))
예제 #3
0
def maximum_drawdown(request):
    """
    离线计算最大回撤
    :param request:
    :return:
    """
    uuid = uuid_util.gen_uuid()
    model = OfflineTaskModel(TaskModel.zuidahuiche, offline_value_service.maximum_drawdown, request, uuid)

    ThreadTool.pool.submit(logic_processor.doLogic, (model,))

    view = OffLineView(uuid)

    return JsonResponse(convert_to_dict(view))
예제 #4
0
def calmar_ratio(request):
    """
    离线计算卡玛比率
    :param request:
    :return:
    """

    uuid = uuid_util.gen_uuid()
    model = OfflineTaskModel(TaskModel.kamabilv, offline_value_service.calmar_ratio, request, uuid)

    ThreadTool.pool.submit(logic_processor.doLogic, (model,))

    view = OffLineView(uuid)

    return JsonResponse(convert_to_dict(view))
예제 #5
0
def volatility(request):
    """
    离线计算年化波动率
    :param request:
    :return:
    """

    uuid = uuid_util.gen_uuid()
    model = OfflineTaskModel(TaskModel.nianhuabodonglv, offline_value_service.volatility, request, uuid)

    ThreadTool.pool.submit(logic_processor.doLogic, (model,))

    view = OffLineView(uuid)

    return JsonResponse(convert_to_dict(view))
예제 #6
0
def intervalYield(request):
    """
    离线计算区间收益率

    :return:
    """
    uuid = uuid_util.gen_uuid()

    model = OfflineTaskModel(TaskModel.qujianshouyilv, offline_value_service.interval_yield, request, uuid)

    ThreadTool.pool.submit(logic_processor.doLogic, model)

    view = OffLineView(uuid)

    return JsonResponse(convert_to_dict(view))
예제 #7
0
def risk_single(request):
    """
    风险因子业绩归因模块 fof_single_attr_riskmodel

    :param request:
    :return:
    """
    uuid = uuid_util.gen_uuid()
    model = OfflineTaskModel(TaskModel.stockRiskSingle,
                             offline_index_service.risk_single, request, uuid)
    ThreadTool.pool.submit(logic_processor.doLogic, (model, ))

    view = OffLineView(uuid)

    return JsonResponse(convert_to_dict(view))
예제 #8
0
def stockexpousre(request):
    """
    导入因子库
    :param request:
    :return:
    """
    uuid = uuid_util.gen_uuid()
    model = OfflineTaskModel(TaskModel.stockexpousre,
                             offline_index_service.stockexpousre, request,
                             uuid)
    ThreadTool.pool.submit(logic_processor.doLogic, (model, ))

    view = OffLineView(uuid)

    return JsonResponse(convert_to_dict(view))
예제 #9
0
def net_value(request):
    """
    基金净值风格划分        fof_fundnav_style
    考虑到服务器的承载能力,该程序前期可每周更新,后续服务器运载能力加大,可改为每日更新
    :param request:
    :return:
    """
    uuid = uuid_util.gen_uuid()

    model = OfflineTaskModel(TaskModel.jinglifengge_profit_style,
                             manager_service.net_value, request, uuid)

    ThreadTool.pool.submit(logic_processor.doLogic, (model, ))

    view = OffLineView(uuid)

    return JsonResponse(convert_to_dict(view))
예제 #10
0
def return_his(request):
    """
    基金经理股票筛选能力
    table:  fof_fund_main_stock_return_his
    :param request:
    :return:
    """
    uuid = uuid_util.gen_uuid()

    model = OfflineTaskModel(TaskModel.jingliShaixuanNengli_return_his,
                             manager_service.return_his, request, uuid)

    ThreadTool.pool.submit(logic_processor.doLogic, (model, ))

    view = OffLineView(uuid)

    return JsonResponse(convert_to_dict(view))
예제 #11
0
def holding_style_all(request):
    """
        风格分析 - 持仓风格
    fof_fund_stock_style
    :param request:
    :return:
    """

    uuid = uuid_util.gen_uuid()

    model = OfflineTaskModel(TaskModel.jinglifengge_holding_stype_all,
                             manager_service.holding_style_all, request, uuid)

    ThreadTool.pool.submit(logic_processor.doLogic, (model, ))

    view = OffLineView(uuid)

    return JsonResponse(convert_to_dict(view))
예제 #12
0
def compute_manager_product(request, format=None):
    """
    计算基金经理管理的产品信息
    :param request:
    :return:
    """

    uuid = uuid_util.gen_uuid()

    model = OfflineTaskModel(TaskModel.jinglichanpin,
                             manager_service.compute_manager_product, request,
                             uuid)

    ThreadTool.pool.submit(logic_processor.doLogic, (model, ))

    view = OffLineView(uuid)

    return JsonResponse(convert_to_dict(view))
예제 #13
0
def equ_timing(request):
    """
    基金经理股票择时能力评价模型
    请于每季结束后的第一个月的15日开始运行本程序(即基金季报发布),按日更新,运行至该月末
    如1季度结束后,于4月15日~4月30日每日更新该数据
    :param request:
    :return:
    """

    uuid = uuid_util.gen_uuid()

    model = OfflineTaskModel(TaskModel.jingliNengli,
                             manager_service.equ_timing, request, uuid)

    ThreadTool.pool.submit(logic_processor.doLogic, (model, ))

    view = OffLineView(uuid)

    return JsonResponse(convert_to_dict(view))
예제 #14
0
def holding_style_main(request):
    """
    风格分析-持仓风格   fof_fund_tentop_stock_style

    重仓股数风格暴露数据,请于每季结束后的第一个月的15日开始运行本程序,按日更新,运行至该月末
    全部持仓数据,请于每年的8月21日~8月31日,以及3月21日~3月31日运行
    :param request:
    :return:
    """
    uuid = uuid_util.gen_uuid()

    model = OfflineTaskModel(TaskModel.jinglifengge_holding_stype_main,
                             manager_service.holding_style_main, request, uuid)

    ThreadTool.pool.submit(logic_processor.doLogic, (model, ))

    view = OffLineView(uuid)

    return JsonResponse(convert_to_dict(view))
예제 #15
0
def industry_config_score(request):
    """
    离线计算基金经理行业配置能力
    :keyword 表 fof_fund_industry_score
    请于每季结束后的第一个月的15日开始运行本程序(即基金季报发布),按日更新,运行至该月末
    如1季度结束后,于4月15日~4月30日每日更新该数据
    :param request:
    :return:
    """
    uuid = uuid_util.gen_uuid()

    model = OfflineTaskModel(TaskModel.jingliPeizhiNengli_score,
                             manager_service.industry_config_score, request,
                             uuid)

    ThreadTool.pool.submit(logic_processor.doLogic, (model, ))

    view = OffLineView(uuid)

    return JsonResponse(convert_to_dict(view))
예제 #16
0
def hand_turn_over(request):
    """
    能力分析-持股集中度、换手率  fof_fund_stock_porfolio


    该程序于每半年进行一次更新
    请于每年的3月20日~3月31日以及8月20日~8月31日更新
    由于程序运行量不大,若更新时间配置麻烦,可设定为每日更新
    :param request:
    :return:
    """
    uuid = uuid_util.gen_uuid()

    model = OfflineTaskModel(TaskModel.jinglifengge_hand_change_rate,
                             manager_service.hand_turn_over, request, uuid)

    ThreadTool.pool.submit(logic_processor.doLogic, (model, ))

    view = OffLineView(uuid)

    return JsonResponse(convert_to_dict(view))