MCPcopy Create free account

hub / github.com/ailabx/alphalab / functions

Functions269 in github.com/ailabx/alphalab

MethodCAP
Calculate market capitalization Args: close: Closing price shares: Number of outstanding shares
panda_factor/generate/factor_utils.py:373
MethodCCI
Calculate CCI indicator
panda_factor/generate/factor_utils.py:686
MethodCONST
Return constant series using last value of S
panda_factor/generate/factor_utils.py:417
MethodCORRELATION
Calculate rolling correlation coefficient Args: series1: First series series2: Second series window: Roll
panda_factor/generate/factor_utils.py:104
MethodCOVARIANCE
Calculate rolling covariance
panda_factor/generate/factor_utils.py:285
MethodCROSS
Check for golden cross (upward cross) or death cross (downward cross)
panda_factor/generate/factor_utils.py:559
MethodDECAYLINEAR
Calculate weighted moving average with weights d,d-1,...,1 (normalized to sum to 1)
panda_factor/generate/factor_utils.py:487
MethodDECAY_LINEAR
Calculate linear decay weighted average
panda_factor/generate/factor_utils.py:227
MethodDELAY
Calculate lagged values
panda_factor/generate/factor_utils.py:130
MethodDELTA
Calculate difference
panda_factor/generate/factor_utils.py:196
MethodDFMA
Calculate DFMA indicator, returns DIF line
panda_factor/generate/factor_utils.py:759
MethodDIFF
Calculate difference between current and previous value, generates NAN at start, preserving index
panda_factor/generate/factor_utils.py:402
MethodDMA
Calculate dynamic moving average with smoothing factor A, requires 0<A<1
panda_factor/generate/factor_utils.py:457
MethodDMI
Calculate DMI indicator, returns ADX line
panda_factor/generate/factor_utils.py:705
MethodDPO
Calculate DPO indicator, returns DPO line
panda_factor/generate/factor_utils.py:747
MethodEMV
Calculate EMV indicator, returns EMV line
panda_factor/generate/factor_utils.py:739
MethodEVERY
EVERY(CLOSE>O, 5) Check if all values are True in last N days
panda_factor/generate/factor_utils.py:513
MethodEXIST
EXIST(CLOSE>3010, N=5) Check if condition exists in last N days
panda_factor/generate/factor_utils.py:518
MethodEXPMA
Calculate EXPMA indicator, returns short-term EMA
panda_factor/generate/factor_utils.py:799
MethodFILTER
FILTER function: When S condition is met, set next N periods to 0
panda_factor/generate/factor_utils.py:523
MethodFORCAST
Calculate predicted value using N-period linear regression
panda_factor/generate/factor_utils.py:477
MethodFUTURE_RETURNS
Calculate future returns Args: close: Price series period: Future periods to calculate returns for, default is 1
panda_factor/generate/factor_utils.py:67
MethodHHVBARS
Calculate number of periods since highest value in N periods
panda_factor/generate/factor_utils.py:432
MethodINDUSTRY_NEUTRALIZE
Industry neutralization
panda_factor/generate/factor_utils.py:263
MethodKDJ
Calculate KDJ indicator, returns K line Args: CLOSE: Close price series HIGH: High price series LOW: Low
panda_factor/generate/factor_utils.py:627
MethodKTN
Calculate Keltner Channel, returns middle line
panda_factor/generate/factor_utils.py:726
MethodLLVBARS
Calculate number of periods since lowest value in N periods
panda_factor/generate/factor_utils.py:437
MethodLOG
Calculate natural logarithm
panda_factor/generate/factor_utils.py:275
MethodLONGCROSS
Check if series cross after maintaining relative position for N periods
panda_factor/generate/factor_utils.py:568
MethodMACD
Calculate MACD indicator using EMA, requires 120 days for accuracy Args: CLOSE: Close price series SHORT: Short perio
panda_factor/generate/factor_utils.py:609
MethodMASS
Calculate MASS indicator, returns MASS line
panda_factor/generate/factor_utils.py:771
MethodMFI
Money Flow Index (Volume RSI) MFI is a volume-weighted RSI that shows buying and selling pressure. Uses vectorized operations for bet
panda_factor/generate/factor_utils.py:828
MethodMIN
Calculate element-wise minimum of two series or series and scalar
panda_factor/generate/factor_utils.py:307
MethodMTM
Calculate MTM indicator, returns MTM line
panda_factor/generate/factor_utils.py:765
MethodOBV
On Balance Volume OBV is calculated by adding volume on up days and subtracting volume on down days. Args: CLOSE: Close
panda_factor/generate/factor_utils.py:804
MethodPOWER
Calculate power
panda_factor/generate/factor_utils.py:280
MethodPRODUCT
Calculate rolling product
panda_factor/generate/factor_utils.py:268
MethodPSY
Calculate PSY indicator, returns PSY line
panda_factor/generate/factor_utils.py:680
MethodRANK
Cross-sectional ranking, normalized to [-0.5, 0.5] range
panda_factor/generate/factor_utils.py:10
MethodRET
Return the Nth last value of series while preserving index
panda_factor/generate/factor_utils.py:388
MethodRETURNS
Calculate returns Args: close: Price series period: Return calculation period, default is 1 Returns:
panda_factor/generate/factor_utils.py:46
MethodROC
Calculate Rate of Change (ROC) indicator ROC = (Current Price - Price N periods ago) / Price N periods ago × 100 Args: C
panda_factor/generate/factor_utils.py:777
MethodRSI
Calculate RSI indicator, matches TDX to 2 decimal places
panda_factor/generate/factor_utils.py:655
MethodSCALE
Scale series to [-1, 1] range
panda_factor/generate/factor_utils.py:239
MethodSIGN
Calculate sign(X) for series
panda_factor/generate/factor_utils.py:492
MethodSIGNEDPOWER
Calculate sign(X)*(abs(X)^n)
panda_factor/generate/factor_utils.py:497
MethodSLOPE
Calculate linear regression slope over N periods
panda_factor/generate/factor_utils.py:472
MethodSTD
Calculate N-day standard deviation of series
panda_factor/generate/factor_utils.py:407
MethodSTDDEV
Calculate rolling standard deviation
panda_factor/generate/factor_utils.py:92
MethodSUMIF
Conditional sum
panda_factor/generate/factor_utils.py:532
MethodTAQ
Calculate Tang Aikun Channel indicator, returns upper line
panda_factor/generate/factor_utils.py:720
MethodTRIX
Calculate TRIX indicator, returns TRIX line
panda_factor/generate/factor_utils.py:732
MethodTS_ARGMAX
Calculate time series maximum value position Returns position normalized to [0, 1] range, 0 means earliest, 1 means latest
panda_factor/generate/factor_utils.py:144
MethodTS_ARGMIN
Calculate time series minimum value position
panda_factor/generate/factor_utils.py:216
MethodTS_MAX
Calculate time series maximum
panda_factor/generate/factor_utils.py:211
MethodTS_MEAN
Calculate time series moving average Args: series: Input series window: Moving window size, default 20 Retur
panda_factor/generate/factor_utils.py:889
MethodTS_MIN
Calculate time series minimum
panda_factor/generate/factor_utils.py:206
MethodTS_RANK
Calculate time series rank
panda_factor/generate/factor_utils.py:185
MethodVALUEWHEN
When condition S is True, take current value of X Args: S: Condition series (boolean) X: Value series Return
panda_factor/generate/factor_utils.py:573
MethodVWAP
Calculate volume weighted average price Args: close: Price series volume: Volume series Returns:
panda_factor/generate/factor_utils.py:339
MethodWMA
Calculate N-period weighted moving average: Yn = (1*X1+2*X2+3*X3+...+n*Xn)/(1+2+3+...+Xn)
panda_factor/generate/factor_utils.py:462
MethodWR
Calculate Williams %R indicator, returns WR line
panda_factor/generate/factor_utils.py:662
Method__call__
(self, target)
backtest/backtrader_algos.py:5
Method__call__
(self, target)
backtest/backtrader_algos.py:13
Method__call__
(self, target)
backtest/backtrader_algos.py:27
Method__call__
(self, target)
backtest/backtrader_algos.py:67
Method__call__
(self, target)
backtest/backtrader_algos.py:83
Method__call__
(self, target)
backtest/backtrader_algos.py:100
Method__call__
(self, target)
backtest/backtrader_algos.py:118
Method__call__
(self, target)
backtest/backtrader_algos.py:135
Method__call__
(self, target)
backtest/backtrader_algos.py:153
Method__call__
根据当天信号值排序,丢弃N个信号后选取前K个信号 参数: signal: pd.DataFrame - 信号数据框,索引为日期 N: int - 要丢弃的信号数量 K: int
backtest/backtrader_algos.py:169
Method__call__
(self, target)
backtest/backtrader_algos.py:237
Method__call__
(self, target)
backtest/backtrader_algos.py:256
Method__call__
(self, target)
backtest/backtrader_algos.py:267
Method__init__
(self)
config.py:15
Method__init__
(self, algo_list)
backtest/backtrader_engine.py:61
Method__init__
(self, task: Task)
backtest/backtrader_engine.py:81
Method__init__
(self)
backtest/backtrader_strategy.py:13
Method__init__
(self)
backtest/backtrader_algos.py:10
Method__init__
(self, n, period='days')
backtest/backtrader_algos.py:22
Method__init__
(self)
backtest/backtrader_algos.py:64
Method__init__
(self)
backtest/backtrader_algos.py:80
Method__init__
(self)
backtest/backtrader_algos.py:97
Method__init__
(self)
backtest/backtrader_algos.py:115
Method__init__
(self, signal)
backtest/backtrader_algos.py:132
Method__init__
(self, signal, K=1, drop_top_n=0, b_ascending=False)
backtest/backtrader_algos.py:163
Method__init__
(self)
backtest/backtrader_algos.py:234
Method__init__
(self, weights_dict: dict)
backtest/backtrader_algos.py:250
Method__init__
(self, force_rebalance=False)
backtest/backtrader_algos.py:261
Method__init__
初始化因子表达式引擎 Args: safe_mode: 安全模式,限制可用的函数和操作
panda_factor/generate/factor_engine.py:32
Method__init__
(self, rows, cols)
alphalens/tears.py:31
Method_rules
(rules, at_least)
backtest/backtrader_engine.py:108
Functionadd_custom_calendar_timedelta
Add timedelta to 'input' taking into consideration custom frequency, which is used to deal with custom calendars, such as a trading calendar
alphalens/utils.py:988
Methodapply_valuewhen
(group)
panda_factor/generate/factor_utils.py:587
Functionaverage_cumulative_return
(q_fact, demean_by)
alphalens/performance.py:832
Functionaverage_cumulative_return_by_quantile
Plots average cumulative returns by factor quantiles in the period range defined by -periods_before to periods_after Parameters ----
alphalens/performance.py:758
Functionbackshift_returns_series
Shift a multi-indexed series backwards by N observations in the first level. This can be used to convert backward-looking returns into a
alphalens/utils.py:364
Methodcalculate_future_returns
(group)
panda_factor/generate/factor_utils.py:78
Methodcalculate_returns
(group)
panda_factor/generate/factor_utils.py:57
← previousnext →101–200 of 269, ranked by callers