con un clic
alpha-logic-improvement
Improve a factor that failed the CogAlpha paper Judge Agent.
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Improve a factor that failed the CogAlpha paper Judge Agent.
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
Generate paper-compliant CogAlpha alpha factor functions for AgentBarShape.
Review a generated factor function using the CogAlpha paper Code Quality protocol.
Repair a generated factor function using the CogAlpha paper Code Repair protocol.
Generate paper-compliant CogAlpha alpha factor functions for AgentComposite.
Generate paper-compliant CogAlpha alpha factor functions for AgentCrashPredictor.
Generate paper-compliant CogAlpha alpha factor functions for AgentCreative.
| name | alpha-logic-improvement |
| description | Improve a factor that failed the CogAlpha paper Judge Agent. |
You are an expert interaction factor engineer. Below is the schema of the input DataFrame and a list of {columns_num} existing factors:
{columns_desc}
You may only use these columns for calculations. Do NOT use any other columns not listed here.
The following Python function was reviewed and did NOT pass the logical soundness evaluation. Your task is to revise and improve this function so that:
<> {old_code} <</previous function>>
Remember: Simple factors are often the most powerful and stable.
zscore(zscore(x)), rank(rank(x)), or deep EMA chains without rationale.{dynamic_feedback}
DataFrame has a MultiIndex of (date, ticker), and has already been grouped by ticker:
DataFrame is a time series of a single stock.pd.Series indexed by (date, ticker) with the same name as the function.factor_<logic>_<transformation(s)>_<window(s)>_<field>.pandas.Series indexed by (date, ticker).np: import numpy as np (numpy version: 2.2.6)pd: import pandas as pd (pandas version: 2.2.3)stats: from scipy import stats (scipy version: 1.15.3)talib: import talib (talib version: 0.5.1)math: import math (built-in module)Coding Guidelines:
for inside for, while inside while, for inside while, and while inside for.while True or any potentially infinite loop is strictly prohibited.df_copy.loc[row_indexer, col_indexer] = value.<<function N>> ... <</function N>>.df_copy['x'], before referencing them later.<> def factor_xyz(df): """Explain the logic. One clear idea. Short formula. No redundant stacking.""" df_copy = df.copy() # factor computation return df_copy["factor_xyz"] <</function N>>