{"record":{"id":"b2370e705190d1b9","repo":"microsoft/qlib","slug":"indicator-analysis-method-method-is-not-supporte","errorCode":null,"errorMessage":"indicator_analysis method {method} is not supported!","messagePattern":"indicator_analysis method (.+?) is not supported!","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"qlib/contrib/evaluate.py","lineNumber":132,"sourceCode":"\n        - if method is 'mean', count the mean statistical value of each trade indicator\n        - if method is 'amount_weighted', count the deal_amount weighted mean statistical value of each trade indicator\n        - if method is 'value_weighted', count the value weighted mean statistical value of each trade indicator\n\n        Note: statistics method of pos is always \"mean\"\n\n    Returns\n    -------\n    pd.DataFrame\n        statistical value of each trade indicators\n    \"\"\"\n    weights_dict = {\n        \"mean\": df[\"count\"],\n        \"amount_weighted\": df[\"deal_amount\"].abs(),\n        \"value_weighted\": df[\"value\"].abs(),\n    }\n    if method not in weights_dict:\n        raise ValueError(f\"indicator_analysis method {method} is not supported!\")\n\n    # statistic pa/ffr indicator\n    indicators_df = df[[\"ffr\", \"pa\"]]\n    weights = weights_dict.get(method)\n    res = indicators_df.mul(weights, axis=0).sum() / weights.sum()\n\n    # statistic pos\n    weights = weights_dict.get(\"mean\")\n    res.loc[\"pos\"] = df[\"pos\"].mul(weights).sum() / weights.sum()\n    res = res.to_frame(\"value\")\n    return res\n\n\n# This is the API for compatibility for legacy code\ndef backtest_daily(\n    start_time: Union[str, pd.Timestamp],\n    end_time: Union[str, pd.Timestamp],\n    strategy: Union[str, dict, BaseStrategy],","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/contrib/evaluate.py#L114-L150","documentation":"indicator_analysis weights each trade-indicator row (ffr, pa) when aggregating. The method argument selects the weighting scheme from a fixed dict {'mean', 'amount_weighted', 'value_weighted'}; anything else fails membership check against weights_dict and raises.","triggerScenarios":"Calling qlib.contrib.evaluate.indicator_analysis(df, method=...) with a string not in {'mean', 'amount_weighted', 'value_weighted'}, or passing a weighting vector where a method name is expected.","commonSituations":"Typos like 'amount_weight' or 'valueweighted'; assuming a custom weighting key exists; passing the argument positionally in the wrong order so another value lands in method.","solutions":["Use one of the three supported methods: 'mean' (count-weighted), 'amount_weighted' (deal_amount-weighted), or 'value_weighted' (value-weighted).","Check membership before calling: if method not in {'mean','amount_weighted','value_weighted'}: raise ValueError(...).","If you need custom weights, compute indicators_df.mul(w).sum()/w.sum() yourself instead of calling this helper."],"exampleFix":"// before\nres = indicator_analysis(df, method=\"amount\")\n\n// after\nres = indicator_analysis(df, method=\"amount_weighted\")","handlingStrategy":"validation","validationCode":"VALID = {\"mean\", \"amount_weighted\", \"value_weighted\"}\nif method not in VALID:\n    raise ValueError(f\"method must be one of {VALID}, got {method!r}\")\nindicator_analysis(df, method=method)","typeGuard":"def is_indicator_method(method) -> bool:\n    return method in {\"mean\", \"amount_weighted\", \"value_weighted\"}","tryCatchPattern":"try:\n    res = indicator_analysis(df, method=method)\nexcept ValueError as e:\n    if \"not supported\" in str(e):\n        res = indicator_analysis(df, method=\"mean\")\n    else:\n        raise","preventionTips":["Keep an enum/constant set of valid methods in your code.","Validate method names when loading workflow configs.","Pass method by keyword to avoid positional mix-ups."],"tags":["qlib","evaluate","indicator-analysis","validation"],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}