MCPcopy Create free account

hub / github.com/ailabx/alphalab / functions

Functions269 in github.com/ailabx/alphalab

↓ 19 callersMethodMA
Calculate N-period simple moving average
panda_factor/generate/factor_utils.py:442
↓ 18 callersMethodREF
Shift entire series by N periods (generates NAN), preserving index
panda_factor/generate/factor_utils.py:393
↓ 14 callersMethodnext_row
(self)
alphalens/tears.py:39
↓ 14 callersMethodplot
(self)
backtest/backtrader_engine.py:408
↓ 10 callersMethodABS
Calculate absolute value
panda_factor/generate/factor_utils.py:334
↓ 10 callersMethodSUM
Calculate rolling sum
panda_factor/generate/factor_utils.py:135
↓ 10 callersMethodclose
(self)
alphalens/tears.py:55
↓ 10 callersMethodlog
(self, txt, dt=None)
backtest/backtrader_strategy.py:19
↓ 8 callersMethodEMA
Calculate exponential moving average, requires S>4*N periods for accuracy, EMA needs at least 120 periods, alpha=2/(span+1)
panda_factor/generate/factor_utils.py:447
↓ 6 callersMethodIF
Conditional selection function
panda_factor/generate/factor_utils.py:125
↓ 6 callersMethodMAX
Calculate element-wise maximum of two series or series and scalar
panda_factor/generate/factor_utils.py:314
↓ 6 callersMethodRD
Round to D decimal places while preserving index
panda_factor/generate/factor_utils.py:383
↓ 6 callersMethodrun
(self, task: Task, commissions=0.0)
backtest/backtrader_engine.py:261
↓ 5 callersMethodnext_cell
(self)
alphalens/tears.py:47
↓ 3 callersMethodHHV
Calculate highest value over N periods
panda_factor/generate/factor_utils.py:422
↓ 3 callersMethod_prepare_run
(self, symbols, start_date, end_date, commissions=0.0)
backtest/backtrader_engine.py:217
↓ 3 callersMethodcalc_formula
计算单个因子表达式 Args: df: 输入数据 expr: 因子表达式 Returns: 计算结果Series或Series列表
panda_factor/generate/factor_engine.py:180
↓ 3 callersMethodget_factor_df
(self, col)
backtest/backtrader_engine.py:92
↓ 3 callersFunctionload_data
(symbols=None, start_date='20200101', end_date=datetime.now().strftime('%Y%m%d'))
datafeed/sqlite_dataloader.py:9
↓ 2 callersMethodSMA
Calculate Chinese-style SMA, needs 120 periods for accuracy (180 on XueQiu), alpha=1/(1+com)
panda_factor/generate/factor_utils.py:452
↓ 2 callersMethod_create_result_series
创建结果Series
panda_factor/generate/factor_engine.py:161
↓ 2 callersMethod_get_cached_expression
缓存表达式处理结果
panda_factor/generate/factor_engine.py:176
↓ 2 callersMethod_load_config
加载配置文件
config.py:83
↓ 2 callersMethod_preprocess_dataframe
预处理DataFrame
panda_factor/generate/factor_engine.py:123
↓ 2 callersFunctionfactor_cumulative_returns
Simulate a portfolio using the factor in input and returns the cumulative returns of the simulated portfolio Parameters ----------
alphalens/performance.py:900
↓ 2 callersFunctionfactor_returns
Computes period wise returns for portfolio weighted by factor values. Parameters ---------- factor_data : pd.DataFrame - MultiIn
alphalens/performance.py:210
↓ 2 callersFunctionfactor_weights
Computes asset weights by factor values and dividing by the sum of their absolute value (achieving gross leverage of 1). Positive factor valu
alphalens/performance.py:131
↓ 2 callersFunctionget_bond_daily
(symbol,start_date='20200101')
datafeed/ts_utils.py:40
↓ 2 callersFunctionmake_naive_ts
(t)
alphalens/utils.py:1011
↓ 1 callersMethodAVEDEV
Calculate average absolute deviation (mean absolute difference from mean)
panda_factor/generate/factor_utils.py:467
↓ 1 callersMethodCOUNT
COUNT(CLOSE>O, N): Count number of True values in last N days
panda_factor/generate/factor_utils.py:508
↓ 1 callersMethodLAST
Check if S_BOOL condition holds from A periods ago to B periods ago, requires A>B & A>0 & B>=0
panda_factor/generate/factor_utils.py:482
↓ 1 callersMethodLLV
Calculate lowest value over N periods
panda_factor/generate/factor_utils.py:427
↓ 1 callersMethod__init__
(self, dfs_dict: dict[str,pd.DataFrame], commission=0.0001)
backtest/backtrader_engine.py:100
↓ 1 callersMethod_build_context
构建安全的执行上下文
panda_factor/generate/factor_engine.py:43
↓ 1 callersMethod_calculate_erc_weights
调用ffn计算ERC权重
backtest/backtrader_strategy.py:79
↓ 1 callersMethod_create_config_dir
创建配置目录
config.py:54
↓ 1 callersMethod_create_config_file
创建配置文件
config.py:64
↓ 1 callersMethod_create_data_context
为特定数据创建上下文
panda_factor/generate/factor_engine.py:94
↓ 1 callersMethod_get_algos
(self, task: Task)
backtest/backtrader_engine.py:145
↓ 1 callersMethod_get_config_dir
获取跨平台的配置目录
config.py:34
↓ 1 callersMethod_import_functions
从模块导入函数
panda_factor/generate/factor_engine.py:68
↓ 1 callersMethod_init_config
初始化配置系统
config.py:43
↓ 1 callersMethod_init_engine
(self)
backtest/backtrader_engine.py:203
↓ 1 callersMethod_log_debug_info
记录调试信息
panda_factor/generate/factor_engine.py:223
↓ 1 callersMethod_parse_rules
(self, task: Task)
backtest/backtrader_engine.py:106
↓ 1 callersMethod_postprocess_result
后处理计算结果
panda_factor/generate/factor_engine.py:143
↓ 1 callersMethod_prepare_returns
收集历史数据并计算收益率
backtest/backtrader_strategy.py:99
↓ 1 callersMethod_remove_unsafe_functions
移除不安全的函数
panda_factor/generate/factor_engine.py:82
↓ 1 callersMethod_save_config
保存配置到文件
config.py:111
↓ 1 callersMethod_validate_dataframe
验证输入DataFrame的格式
panda_factor/generate/factor_engine.py:110
↓ 1 callersFunctionaxes_style
Create alphalens default axes style context. Under the hood, calls and returns seaborn.axes_style() with some custom settings. Usually you wo
alphalens/plotting.py:97
↓ 1 callersMethodcalc_formulas
批量计算多个因子表达式 Args: dfs: 股票数据字典 {symbol: dataframe} expr_list: 表达式列表 skip_existing: 是否跳过已存在的列
panda_factor/generate/factor_engine.py:229
↓ 1 callersFunctioncommon_start_returns
A date and equity pair is extracted from each index row in the factor dataframe and for each of these pairs a return series is built starting
alphalens/performance.py:668
↓ 1 callersFunctioncompute_forward_returns
Finds the N period forward returns (as percent change) for each asset provided. Parameters ---------- factor : pd.Series - Multi
alphalens/utils.py:227
↓ 1 callersFunctioncreate_event_returns_tear_sheet
Creates a tear sheet to view the average cumulative returns for a factor within a window (pre and post event). Parameters ----------
alphalens/tears.py:508
↓ 1 callersFunctioncreate_information_tear_sheet
Creates a tear sheet for information analysis of a factor. Parameters ---------- factor_data : pd.DataFrame - MultiIndex A M
alphalens/tears.py:333
↓ 1 callersFunctioncreate_returns_tear_sheet
Creates a tear sheet for returns analysis of a factor. Parameters ---------- factor_data : pd.DataFrame - MultiIndex A Multi
alphalens/tears.py:172
↓ 1 callersFunctioncreate_summary_tear_sheet
Creates a small summary tear sheet with returns, information, and turnover analysis. Parameters ---------- factor_data : pd.Data
alphalens/tears.py:62
↓ 1 callersFunctioncreate_turnover_tear_sheet
Creates a tear sheet for analyzing the turnover properties of a factor. Parameters ---------- factor_data : pd.DataFrame - MultiInde
alphalens/tears.py:391
↓ 1 callersFunctioncumulative_return_around_event
(q_fact, demean_by)
alphalens/performance.py:821
↓ 1 callersFunctioncumulative_returns
Computes cumulative returns from simple daily returns. Parameters ---------- returns: pd.Series pd.Series containing daily f
alphalens/performance.py:344
↓ 1 callersFunctiondiff_custom_calendar_timedeltas
Compute the difference between two pd.Timedelta taking into consideration custom frequency, which is used to deal with custom calendars, such
alphalens/utils.py:1015
↓ 1 callersFunctionfactor_information_coefficient
Computes the Spearman Rank Correlation based Information Coefficient (IC) between factor values and N period forward returns for each period
alphalens/performance.py:28
↓ 1 callersFunctionfactor_positions
Simulate a portfolio using the factor in input and returns the assets positions as percentage of the total portfolio. Parameters ---
alphalens/performance.py:972
↓ 1 callersFunctionget_clean_factor
Formats the factor data, forward return data, and group mappings into a DataFrame that contains aligned MultiIndex indices of timestamp and a
alphalens/utils.py:472
↓ 1 callersFunctionget_clean_factor_and_forward_returns
Formats the factor data, pricing data, and group mappings into a DataFrame that contains aligned MultiIndex indices of timestamp and asset. T
alphalens/utils.py:682
↓ 1 callersMethodget_config_path
获取配置文件路径信息
config.py:142
↓ 1 callersMethodget_current_holding_datas
(self)
backtest/backtrader_strategy.py:177
↓ 1 callersFunctionget_etf_daily
(symbol, start_date='20200101')
datafeed/ts_utils.py:68
↓ 1 callersFunctionget_forward_returns_columns
Utility that detects and returns the columns that are forward returns
alphalens/utils.py:916
↓ 1 callersFunctioninfer_trading_calendar
Infer the trading calendar from factor and price information. Parameters ---------- factor_idx : pd.DatetimeIndex The factor
alphalens/utils.py:182
↓ 1 callersFunctionmain
()
tests/provider_stream_sample.py:9
↓ 1 callersFunctionmain
()
tests/provider_sample.py:9
↓ 1 callersFunctionmain
()
tests/loop_sample.py:14
↓ 1 callersFunctionmain
()
tests/openai_raw.py:19
↓ 1 callersMethodorder_by
(self, ind='sorter', topK=1, dropN=0, desc=True)
backtest/backtrader_strategy.py:51
↓ 1 callersFunctionplotting_context
Create alphalens default plotting style context. Under the hood, calls and returns seaborn.plotting_context() with some custom settings.
alphalens/plotting.py:53
↓ 1 callersFunctionpositions
Builds net position values time series, the portfolio percentage invested in each position. Parameters ---------- weights: pd.Se
alphalens/performance.py:366
↓ 1 callersFunctionquantize_factor
Computes period wise factor quantiles. Parameters ---------- factor_data : pd.DataFrame - MultiIndex A MultiIndex DataFrame
alphalens/utils.py:91
↓ 1 callersMethodrebalance
根据新权重调整仓位
backtest/backtrader_strategy.py:133
↓ 1 callersFunctionrethrow
Re-raise the last exception that was active in the current scope without losing the stacktrace but adding an additional message. This is
alphalens/utils.py:39
↓ 1 callersMethodstats
(self)
backtest/backtrader_engine.py:404
↓ 1 callersFunctiontimedelta_to_string
Utility that converts a pandas.Timedelta to a string representation compatible with pandas.Timedelta constructor format Parameters -
alphalens/utils.py:938
↓ 1 callersFunctionupdate_all_bond_daily
()
datafeed/daily_builder.py:32
↓ 1 callersFunctionupdate_all_etf_daily
()
datafeed/etf_daily_builder.py:34
↓ 1 callersFunctionupdate_symbol
(symbol)
datafeed/daily_builder.py:6
↓ 1 callersFunctionupdate_symbol
(symbol)
datafeed/etf_daily_builder.py:8
↓ 1 callersMethodweight_equally
(self,selected)
backtest/backtrader_strategy.py:126
MethodADV
Calculate average daily volume
panda_factor/generate/factor_utils.py:201
MethodASI
Calculate ASI indicator, returns ASI line
panda_factor/generate/factor_utils.py:873
MethodAS_FLOAT
Convert boolean condition to float True -> 1.0, False -> 0.0
panda_factor/generate/factor_utils.py:327
MethodATR
Calculate Average True Range
panda_factor/generate/factor_utils.py:692
MethodBARSLAST
Calculate periods since last condition was True
panda_factor/generate/factor_utils.py:537
MethodBARSLASTCOUNT
Count consecutive periods where condition S is True
panda_factor/generate/factor_utils.py:545
MethodBARSSINCEN
Calculate periods since first True condition in last N periods
panda_factor/generate/factor_utils.py:553
MethodBBI
Calculate BBI (Bull and Bear Index)
panda_factor/generate/factor_utils.py:699
MethodBIAS
Calculate BIAS indicator, returns BIAS1 line
panda_factor/generate/factor_utils.py:668
MethodBOLL
Calculate Bollinger Bands, returns middle line
panda_factor/generate/factor_utils.py:674
MethodBRAR
Calculate BRAR indicator, returns AR line
panda_factor/generate/factor_utils.py:753
next →1–100 of 269, ranked by callers