Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ailabx/alphalab
/ functions
Functions
269 in github.com/ailabx/alphalab
⨍
Functions
269
◇
Types & classes
26
↓ 19 callers
Method
MA
Calculate N-period simple moving average
panda_factor/generate/factor_utils.py:442
↓ 18 callers
Method
REF
Shift entire series by N periods (generates NAN), preserving index
panda_factor/generate/factor_utils.py:393
↓ 14 callers
Method
next_row
(self)
alphalens/tears.py:39
↓ 14 callers
Method
plot
(self)
backtest/backtrader_engine.py:408
↓ 10 callers
Method
ABS
Calculate absolute value
panda_factor/generate/factor_utils.py:334
↓ 10 callers
Method
SUM
Calculate rolling sum
panda_factor/generate/factor_utils.py:135
↓ 10 callers
Method
close
(self)
alphalens/tears.py:55
↓ 10 callers
Method
log
(self, txt, dt=None)
backtest/backtrader_strategy.py:19
↓ 8 callers
Method
EMA
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 callers
Method
IF
Conditional selection function
panda_factor/generate/factor_utils.py:125
↓ 6 callers
Method
MAX
Calculate element-wise maximum of two series or series and scalar
panda_factor/generate/factor_utils.py:314
↓ 6 callers
Method
RD
Round to D decimal places while preserving index
panda_factor/generate/factor_utils.py:383
↓ 6 callers
Method
run
(self, task: Task, commissions=0.0)
backtest/backtrader_engine.py:261
↓ 5 callers
Method
next_cell
(self)
alphalens/tears.py:47
↓ 3 callers
Method
HHV
Calculate highest value over N periods
panda_factor/generate/factor_utils.py:422
↓ 3 callers
Method
_prepare_run
(self, symbols, start_date, end_date, commissions=0.0)
backtest/backtrader_engine.py:217
↓ 3 callers
Method
calc_formula
计算单个因子表达式 Args: df: 输入数据 expr: 因子表达式 Returns: 计算结果Series或Series列表
panda_factor/generate/factor_engine.py:180
↓ 3 callers
Method
get_factor_df
(self, col)
backtest/backtrader_engine.py:92
↓ 3 callers
Function
load_data
(symbols=None, start_date='20200101', end_date=datetime.now().strftime('%Y%m%d'))
datafeed/sqlite_dataloader.py:9
↓ 2 callers
Method
SMA
Calculate Chinese-style SMA, needs 120 periods for accuracy (180 on XueQiu), alpha=1/(1+com)
panda_factor/generate/factor_utils.py:452
↓ 2 callers
Method
_create_result_series
创建结果Series
panda_factor/generate/factor_engine.py:161
↓ 2 callers
Method
_get_cached_expression
缓存表达式处理结果
panda_factor/generate/factor_engine.py:176
↓ 2 callers
Method
_load_config
加载配置文件
config.py:83
↓ 2 callers
Method
_preprocess_dataframe
预处理DataFrame
panda_factor/generate/factor_engine.py:123
↓ 2 callers
Function
factor_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 callers
Function
factor_returns
Computes period wise returns for portfolio weighted by factor values. Parameters ---------- factor_data : pd.DataFrame - MultiIn
alphalens/performance.py:210
↓ 2 callers
Function
factor_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 callers
Function
get_bond_daily
(symbol,start_date='20200101')
datafeed/ts_utils.py:40
↓ 2 callers
Function
make_naive_ts
(t)
alphalens/utils.py:1011
↓ 1 callers
Method
AVEDEV
Calculate average absolute deviation (mean absolute difference from mean)
panda_factor/generate/factor_utils.py:467
↓ 1 callers
Method
COUNT
COUNT(CLOSE>O, N): Count number of True values in last N days
panda_factor/generate/factor_utils.py:508
↓ 1 callers
Method
LAST
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 callers
Method
LLV
Calculate lowest value over N periods
panda_factor/generate/factor_utils.py:427
↓ 1 callers
Method
__init__
(self, dfs_dict: dict[str,pd.DataFrame], commission=0.0001)
backtest/backtrader_engine.py:100
↓ 1 callers
Method
_build_context
构建安全的执行上下文
panda_factor/generate/factor_engine.py:43
↓ 1 callers
Method
_calculate_erc_weights
调用ffn计算ERC权重
backtest/backtrader_strategy.py:79
↓ 1 callers
Method
_create_config_dir
创建配置目录
config.py:54
↓ 1 callers
Method
_create_config_file
创建配置文件
config.py:64
↓ 1 callers
Method
_create_data_context
为特定数据创建上下文
panda_factor/generate/factor_engine.py:94
↓ 1 callers
Method
_get_algos
(self, task: Task)
backtest/backtrader_engine.py:145
↓ 1 callers
Method
_get_config_dir
获取跨平台的配置目录
config.py:34
↓ 1 callers
Method
_import_functions
从模块导入函数
panda_factor/generate/factor_engine.py:68
↓ 1 callers
Method
_init_config
初始化配置系统
config.py:43
↓ 1 callers
Method
_init_engine
(self)
backtest/backtrader_engine.py:203
↓ 1 callers
Method
_log_debug_info
记录调试信息
panda_factor/generate/factor_engine.py:223
↓ 1 callers
Method
_parse_rules
(self, task: Task)
backtest/backtrader_engine.py:106
↓ 1 callers
Method
_postprocess_result
后处理计算结果
panda_factor/generate/factor_engine.py:143
↓ 1 callers
Method
_prepare_returns
收集历史数据并计算收益率
backtest/backtrader_strategy.py:99
↓ 1 callers
Method
_remove_unsafe_functions
移除不安全的函数
panda_factor/generate/factor_engine.py:82
↓ 1 callers
Method
_save_config
保存配置到文件
config.py:111
↓ 1 callers
Method
_validate_dataframe
验证输入DataFrame的格式
panda_factor/generate/factor_engine.py:110
↓ 1 callers
Function
axes_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 callers
Method
calc_formulas
批量计算多个因子表达式 Args: dfs: 股票数据字典 {symbol: dataframe} expr_list: 表达式列表 skip_existing: 是否跳过已存在的列
panda_factor/generate/factor_engine.py:229
↓ 1 callers
Function
common_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 callers
Function
compute_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 callers
Function
create_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 callers
Function
create_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 callers
Function
create_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 callers
Function
create_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 callers
Function
create_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 callers
Function
cumulative_return_around_event
(q_fact, demean_by)
alphalens/performance.py:821
↓ 1 callers
Function
cumulative_returns
Computes cumulative returns from simple daily returns. Parameters ---------- returns: pd.Series pd.Series containing daily f
alphalens/performance.py:344
↓ 1 callers
Function
diff_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 callers
Function
factor_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 callers
Function
factor_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 callers
Function
get_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 callers
Function
get_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 callers
Method
get_config_path
获取配置文件路径信息
config.py:142
↓ 1 callers
Method
get_current_holding_datas
(self)
backtest/backtrader_strategy.py:177
↓ 1 callers
Function
get_etf_daily
(symbol, start_date='20200101')
datafeed/ts_utils.py:68
↓ 1 callers
Function
get_forward_returns_columns
Utility that detects and returns the columns that are forward returns
alphalens/utils.py:916
↓ 1 callers
Function
infer_trading_calendar
Infer the trading calendar from factor and price information. Parameters ---------- factor_idx : pd.DatetimeIndex The factor
alphalens/utils.py:182
↓ 1 callers
Function
main
()
tests/provider_stream_sample.py:9
↓ 1 callers
Function
main
()
tests/provider_sample.py:9
↓ 1 callers
Function
main
()
tests/loop_sample.py:14
↓ 1 callers
Function
main
()
tests/openai_raw.py:19
↓ 1 callers
Method
order_by
(self, ind='sorter', topK=1, dropN=0, desc=True)
backtest/backtrader_strategy.py:51
↓ 1 callers
Function
plotting_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 callers
Function
positions
Builds net position values time series, the portfolio percentage invested in each position. Parameters ---------- weights: pd.Se
alphalens/performance.py:366
↓ 1 callers
Function
quantize_factor
Computes period wise factor quantiles. Parameters ---------- factor_data : pd.DataFrame - MultiIndex A MultiIndex DataFrame
alphalens/utils.py:91
↓ 1 callers
Method
rebalance
根据新权重调整仓位
backtest/backtrader_strategy.py:133
↓ 1 callers
Function
rethrow
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 callers
Method
stats
(self)
backtest/backtrader_engine.py:404
↓ 1 callers
Function
timedelta_to_string
Utility that converts a pandas.Timedelta to a string representation compatible with pandas.Timedelta constructor format Parameters -
alphalens/utils.py:938
↓ 1 callers
Function
update_all_bond_daily
()
datafeed/daily_builder.py:32
↓ 1 callers
Function
update_all_etf_daily
()
datafeed/etf_daily_builder.py:34
↓ 1 callers
Function
update_symbol
(symbol)
datafeed/daily_builder.py:6
↓ 1 callers
Function
update_symbol
(symbol)
datafeed/etf_daily_builder.py:8
↓ 1 callers
Method
weight_equally
(self,selected)
backtest/backtrader_strategy.py:126
Method
ADV
Calculate average daily volume
panda_factor/generate/factor_utils.py:201
Method
ASI
Calculate ASI indicator, returns ASI line
panda_factor/generate/factor_utils.py:873
Method
AS_FLOAT
Convert boolean condition to float True -> 1.0, False -> 0.0
panda_factor/generate/factor_utils.py:327
Method
ATR
Calculate Average True Range
panda_factor/generate/factor_utils.py:692
Method
BARSLAST
Calculate periods since last condition was True
panda_factor/generate/factor_utils.py:537
Method
BARSLASTCOUNT
Count consecutive periods where condition S is True
panda_factor/generate/factor_utils.py:545
Method
BARSSINCEN
Calculate periods since first True condition in last N periods
panda_factor/generate/factor_utils.py:553
Method
BBI
Calculate BBI (Bull and Bear Index)
panda_factor/generate/factor_utils.py:699
Method
BIAS
Calculate BIAS indicator, returns BIAS1 line
panda_factor/generate/factor_utils.py:668
Method
BOLL
Calculate Bollinger Bands, returns middle line
panda_factor/generate/factor_utils.py:674
Method
BRAR
Calculate BRAR indicator, returns AR line
panda_factor/generate/factor_utils.py:753
next →
1–100 of 269, ranked by callers