class_docstr: Enhanced Indexing Strategy
  
  Enhanced indexing combines the arts of active management and passive management,
  with the aim of outperforming a benchmark index (e.g., S&P 500) in terms of
  portfolio return while controlling the risk exposure (a.k.a. tracking error).
  
  Users need to prepare their risk model data like below:
  
  .. code-block:: text
  
      ├── /path/to/riskmodel
      ├──── 20210101
      ├────── factor_exp.{csv|pkl|h5}
      ├────── factor_cov.{csv|pkl|h5}
      ├────── specific_risk.{csv|pkl|h5}
      ├────── blacklist.{csv|pkl|h5}  # optional
  
  The risk model data can be obtained from risk data provider. You can also use
  `qlib.model.riskmodel.structured.StructuredCovEstimator` to prepare these data.
  
  Args:
      riskmodel_path (str): risk model path
      name_mapping (dict): alternative file names
code: def __init__(
      self,
      *,
      riskmodel_root,
      market="csi500",
      turn_limit=None,
      name_mapping={},
      optimizer_kwargs={},
      verbose=False,
      **kwargs,
  ):
      super().__init__(**kwargs)
  
      self.logger = get_module_logger("EnhancedIndexingStrategy")
  
      self.riskmodel_root = riskmodel_root
      self.market = market
      self.turn_limit = turn_limit
  
      self.factor_exp_path = name_mapping.get(
          "factor_exp", self.FACTOR_EXP_NAME
      )
      self.factor_cov_path = name_mapping.get(
          "factor_cov", self.FACTOR_COV_NAME
      )
      self.specific_risk_path = name_mapping.get(
          "specific_risk", self.SPECIFIC_RISK_NAME
      )
      self.blacklist_path = name_mapping.get(
          "blacklist", self.BLACKLIST_NAME
      )
  
      self.optimizer = EnhancedIndexingOptimizer(**optimizer_kwargs)
  
      self.verbose = verbose
  
      self._riskdata_cache = {}
  
imports: import os
  import copy
  import warnings
  import numpy
  import pandas
  from typing import Dict, List, Text, Tuple, Union
  from abc import ABC
  from qlib.data import D
  from qlib.data.dataset import Dataset
  from qlib.model.base import BaseModel
  from qlib.strategy.base import BaseStrategy
  from qlib.backtest.position import Position
  from qlib.backtest.signal import Signal, create_signal_from
  from qlib.backtest.decision import Order, OrderDir, TradeDecisionWO
  from qlib.log import get_module_logger
  from qlib.utils import get_pre_trading_date, load_dataset
  from qlib.contrib.strategy.order_generator import OrderGenerator, OrderGenWOInteract
  from qlib.contrib.strategy.optimizer import EnhancedIndexingOptimizer
label_desc: Use image node_id 1 to create a new EnhancedIndexingStrategy object from inherited base classes: WeightStrategyBase with example: obj = EnhancedIndexingStrategy()