[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-2264":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":14,"forks30d":14,"starsTrendScore":18,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":9,"pushedAt":9,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":14,"starSnapshotCount":14,"syncStatus":16,"lastSyncTime":27,"discoverSource":28},2264,"quant-ohlcv-feature","YuxinSUN89\u002Fquant-ohlcv-feature","YuxinSUN89","a collection of 300+ features\u002Ffactors drawn from academic publications and leading industry reports",null,"Python",113,30,108,0,1,2,5,3,4.47,false,"master",true,[],"2026-06-12 02:00:39","# quant-ohlcv-features\n\nA modular library of **335+ technical indicator implementations** for quantitative feature engineering on OHLCV (Open, High, Low, Close, Volume) financial data. Designed for use in machine learning pipelines for cryptocurrency and equity markets.\n\n---\n\n## Overview\n\nEach feature is implemented as a standalone Python function that accepts a pandas DataFrame and returns it with the computed indicator appended as a new column. The library covers seven categories of technical signals:\n\n| Category | Files | Description |\n|---|---|---|\n| `momentum_feature\u002F` | 121 | Rate of change, oscillators, divergence signals |\n| `trend_feature\u002F` | 67 | Moving averages, directional indicators, regression trends |\n| `volatility_feature\u002F` | 72 | Bands, channels, range-based uncertainty metrics |\n| `volume_feature\u002F` | 51 | Accumulation, flow, buying\u002Fselling pressure |\n| `price_feature\u002F` | 9 | VWAP, typical price, weighted close |\n| `liquidity_feature\u002F` | 4 | Market microstructure and illiquidity proxies |\n| `composite_feature\u002F` | 11 | Multi-factor combinations across categories |\n\n---\n\n## Input Data Format\n\nAll indicators expect a pandas DataFrame with the following columns:\n\n| Column | Type | Description |\n|---|---|---|\n| `open` | float | Bar open price |\n| `high` | float | Bar high price |\n| `low` | float | Bar low price |\n| `close` | float | Bar close price |\n| `volume` | float | Base asset volume |\n| `quote_volume` | float | Quote asset volume (used in some indicators) |\n| `taker_buy_quote_asset_volume` | float | Taker buy volume (used in composite features) |\n\nA sample dataset is provided at [`data\u002Fbtcusd_data.csv`](data\u002Fbtcusd_data.csv) (Bitcoin\u002FUSD historical OHLCV, ~6.5 MB).\n\n---\n\n## Usage\n\nEvery feature file exports a single `signal(*args)` function with a consistent signature:\n\n```python\ndf = signal(df, n, factor_name)\n```\n\n| Argument | Description |\n|---|---|\n| `df` | Input DataFrame with OHLCV columns |\n| `n` | Lookback period (integer) |\n| `factor_name` | Name of the output column to write into `df` |\n\n**Example:**\n\n```python\nimport pandas as pd\nfrom momentum_feature.Rsi import signal as rsi\n\ndf = pd.read_csv(\"data\u002Fbtcusd_data.csv\")\ndf = rsi(df, n=14, factor_name=\"rsi_14\")\n\nprint(df[[\"close\", \"rsi_14\"]].tail())\n```\n\nIntermediate calculation columns are cleaned up before returning — only `factor_name` is added to the DataFrame.\n\n---\n\n## Feature Categories\n\n### Momentum (`momentum_feature\u002F`)\n\nMeasures the rate and strength of price change. Useful for identifying overbought\u002Foversold conditions and mean-reversion opportunities.\n\nKey indicators:\n- **RSI variants** (`Rsi.py`, `Rsimean.py`, `Rsih.py`, `Rsiv.py`, `Rsij.py`) — Relative Strength Index with smoothing and variant logic\n- **MACD variants** (`Macd.py`, `Macd_v2.py`, `MacdVol.py`, `Zlmacd.py`) — Trend-momentum crossover signals\n- **Stochastic** (`Skdj.py`, `KdjK.py`, `KdjD.py`, `KdjJ.py`) — Stochastic oscillator components\n- **Bias** (`Bias.py`, `BiasVol.py`, `Rbias.py`, `TmaBias.py`) — Price deviation from moving average\n- **CCI** (`Cci.py`, `CciMagic.py`, `MagicCci.py`) — Commodity Channel Index variants\n- **ROC \u002F PPO** (`Roc.py`, `RocVol.py`, `Sroc.py`, `Ppo.py`) — Rate of change and percentage oscillators\n- **MTM** (`Mtm.py`, `MtmMax.py`, `MtmMean.py`, `MtmBull.py`, `MtmBear.py`) — Momentum aggregates\n- **DBCD** (`Dbcd.py`, `Dbcd_v2.py`, `Dbcd_taker.py`) — Divergence-based momentum\n- **Other** — CMO, Fisher Transform, KST, DPO, Coppock Curve\n\n---\n\n### Trend (`trend_feature\u002F`)\n\nIdentifies directional bias and trend persistence. Includes adaptive averages that self-adjust to market conditions.\n\nKey indicators:\n- **Moving averages** (`Ma.py`, `Dema.py`, `Tema.py`, `Tma.py`, `Hma.py`, `T3.py`) — Simple, double, triple, hull, and T3 MAs\n- **Adaptive MAs** (`Kama.py`, `Vidya.py`) — Kaufman AMA and variable-index dynamic average\n- **ADX system** (`Adx.py`, `AdxDi+.py`, `AdxDi-.py`, `Adxr.py`) — Average Directional Index components\n- **Regression trends** (`Reg.py`, `RegEma.py`, `RegTema.py`, `Mreg.py`) — Linear regression-based trend lines\n- **Ichimoku** (`Ic.py`, `Ic_v2.py`, `Ic_v3.py`, `Ic_v4.py`) — Cloud indicator components\n- **Signals** (`MaSignal.py`, `HmaSignal.py`) — Trend confirmation signals\n- **Other** — Aroon, BBI, MAC, Gapped trend, CSE\n\n---\n\n### Volatility (`volatility_feature\u002F`)\n\nMeasures price uncertainty and range expansion. Used for position sizing, breakout detection, and regime identification.\n\nKey indicators:\n- **Bollinger Bands** (`Bolling.py`, `BollingWidth.py`, `Bolling_fancy.py`) — Standard deviation channels\n- **ATR** (`Atr.py`, `AtrPct.py`, `AtrUpper.py`, `AtrLower.py`) — Average True Range and derived bands\n- **Keltner Channel** (`KcUpper.py`, `KcLower.py`, `KcSignal.py`) — ATR-based envelope\n- **Donchian Channel** (`Dc.py`, `DcSignal.py`) — High\u002Flow breakout bands\n- **Fibonacci Bands** (`FbUpper.py`, `FbLower.py`) — Golden ratio volatility levels\n- **APZ** (`Apz.py`, `ApzUpper.py`, `ApzLower.py`) — Adaptive Price Zone\n- **PAC** (`Pac.py`, `PacUpper.py`, `PacLower.py`) — Price Acceleration Channel\n- **Envelope** (`EnvUpper.py`, `EnvLower.py`, `EnvSignal.py`) — Percentage-based envelope\n- **Other** — VIX-inspired bandwidth, PFE, MSSI, historical volatility, volume\u002Fchange standard deviation\n\n---\n\n### Volume (`volume_feature\u002F`)\n\nTracks accumulation, distribution, and the balance between buying and selling pressure.\n\nKey indicators:\n- **OBV \u002F AD** (`Obv.py`, `Adosc.py`) — On-Balance Volume and A\u002FD oscillator\n- **CMF \u002F MFI** (`Cmf.py`, `Mfi.py`) — Chaikin Money Flow and Money Flow Index\n- **Force \u002F EMV** (`Fi.py`, `Emv.py`) — Force Index and Ease of Movement\n- **PVT** (`Pvt.py`, `Pvt_v2.py`, `Pvt_v3.py`) — Price-Volume Trend\n- **Taker ratios** (`TakerByRatio.py`, `TakerByRatioPerTrade.py`) — Aggressive buyer\u002Fseller ratio\n- **Volume rate of change** (`Pvo.py`) — Volume momentum\n- **WAD \u002F WVAD** (`Wad.py`, `Wvad.py`) — Williams Accumulation\u002FDistribution\n- **V1 variants** (`V1.py`, `V1Up.py`, `V1Dn.py`) — Directional volume components\n- **Fancy features** (`BuyVolRatio_fancy.py`, `NetVol_fancy.py`, `UpNum_fancy.py`, `VolPerTrade_fancy.py`)\n\n---\n\n### Price (`price_feature\u002F`)\n\nDerived from raw OHLC prices, providing normalized reference levels.\n\n| File | Description |\n|---|---|\n| `Vwap.py` | Volume-Weighted Average Price (CLV-adjusted) |\n| `VwapSignal.py` | VWAP signal line |\n| `Vwapbias.py` | Price deviation from VWAP |\n| `AvgPrice.py` | Volume-weighted average price normalization |\n| `Typ.py` | Typical price: `(HIGH + LOW + CLOSE) \u002F 3` |\n| `Wc.py` | Weighted close: `(HIGH + 2×CLOSE + LOW) \u002F 4` |\n| `AvgPriceToHigh.py` | Price position relative to session high |\n| `AvgPriceToLow.py` | Price position relative to session low |\n| `LowPrice.py` | Low price derived metric |\n\n---\n\n### Liquidity (`liquidity_feature\u002F`)\n\nMicrostructure features capturing trade execution efficiency and market depth.\n\n| File | Description |\n|---|---|\n| `Amihud.py` | Amihud illiquidity ratio — quote volume per unit of intraday price path |\n| `Liquidity_v3.py` | General liquidity proxy v3 |\n| `MarketPl.py` | Market placement metric |\n| `MarketPl_v2.py` | Market placement metric v2 |\n\n**Amihud formula:**\n\n```\nROUTE1 = 2*(HIGH - LOW) + (OPEN - CLOSE)\nROUTE2 = 2*(HIGH - LOW) + (CLOSE - OPEN)\nSHORTEST_PATH = MIN(ROUTE1, ROUTE2)\nNORM_PATH = SHORTEST_PATH \u002F OPEN\nLIQUIDITY_PREMIUM = QUOTE_VOLUME \u002F NORM_PATH\nresult = MA(LIQUIDITY_PREMIUM, N)\n```\n\nHigher values indicate greater liquidity (more volume per unit of price movement).\n\n---\n\n### Composite (`composite_feature\u002F`)\n\nMulti-factor signals combining signals across categories for stronger predictive features.\n\n| File | Description |\n|---|---|\n| `Damaov10.py` | Momentum × Volatility × ATR composite |\n| `Msbt.py` | Momentum × Std-Momentum × BBW × Taker-Buy |\n| `Adx+mtm.py` | ADX + Momentum combination (bullish) |\n| `Adx-mtm.py` | ADX + Momentum combination (bearish) |\n| `CoppAtrBull.py` | Coppock Curve × ATR momentum-volatility |\n| `Fbnq_pct_v5.py` | Fibonacci-based composite |\n| `FearGreed_Yidai_v1.py` | Sentiment-style composite |\n| `PriceVolumeResist.py` | Price-volume resistance level |\n| `Pmarp_Yidai_v1.py` | Proprietary multi-factor signal |\n| `Cbr_v1.py` | Custom multi-factor signal |\n| `Cvr_v0.py` | Volatility-ratio composite |\n\n---\n\n## Dependencies\n\nInstall all dependencies with:\n\n```bash\npip install -r requirements.txt\n```\n\n> **Note:** TA-Lib requires the underlying C library before `pip install` will work:\n> - macOS: `brew install ta-lib`\n> - Ubuntu\u002FDebian: `apt-get install libta-lib-dev`\n> - Windows: use the pre-built wheel from [ta-lib-python releases](https:\u002F\u002Fgithub.com\u002FTA-Lib\u002Fta-lib-python\u002Freleases)\n\nEach indicator file is self-contained with no cross-file imports.\n\n---\n\n## Design Principles\n\n- **Self-contained**: Each file is an independent module with no dependencies on other feature files.\n- **Uniform interface**: All indicators share the same `signal(df, n, factor_name)` signature, making them easy to iterate over in a pipeline.\n- **Side-effect-free cleanup**: Intermediate columns created during calculation are deleted before returning `df`.\n- **Division-by-zero safety**: A small epsilon (`eps = 1e-8`) is applied wherever denominators may be zero.\n- **Relative outputs**: Most indicators produce normalized or ratio-based outputs to avoid scale mismatch in downstream models.\n\n---\n\n## Repository Structure\n\n```\nquant-ohlcv-features\u002F\n├── data\u002F\n│   └── btcusd_data.csv          # Sample BTC\u002FUSD OHLCV data\n├── momentum_feature\u002F            # 121 momentum indicators\n├── trend_feature\u002F               # 67 trend indicators\n├── volatility_feature\u002F          # 72 volatility indicators\n├── volume_feature\u002F              # 51 volume indicators\n├── price_feature\u002F               # 9 price-derived indicators\n├── liquidity_feature\u002F           # 4 liquidity\u002Fmicrostructure indicators\n└── composite_feature\u002F           # 11 multi-factor composite signals\n```\n","该项目是一个包含300多个金融特征\u002F因子的集合，这些特征和因子来源于学术出版物和领先的行业报告。它提供了一个模块化的Python库，实现了超过335种技术指标，适用于基于OHLCV（开盘价、最高价、最低价、收盘价、成交量）数据的量化特征工程。核心功能包括动量、趋势、波动性、成交量等七大类技术信号的独立计算函数，每个函数接收一个pandas DataFrame并返回带有新增计算指标列的数据框。该库非常适合用于构建机器学习流水线，特别是在加密货币和股票市场的分析场景中。","2026-06-11 02:49:11","CREATED_QUERY"]