### Install TA-Lib Wheels Source: https://github.com/wukan1986/polars_ta/blob/main/README.md Guides users on how to install TA-Lib, specifically mentioning that non-official wheels can be downloaded from a provided GitHub releases page. This is a prerequisite for certain functionalities if TA-Lib is used as a backend. ```commandline Non-official `TA-Lib` wheels can be downloaded from `https://github.com/cgohlke/talib-build/releases` ``` -------------------------------- ### Polars TA WQ Factor Examples Source: https://github.com/wukan1986/polars_ta/blob/main/prompt.txt Illustrative examples of quantitative factor implementations using the polars_ta.wq module's operators and basic factors. ```Python alpha_004=-ts_rank(cs_rank(LOW),9) alpha_006=-ts_corr(OPEN,VOLUME,10) alpha_040=-cs_rank(ts_std_dev(HIGH,10))*ts_corr(HIGH,VOLUME,10) alpha_041=power(HIGH*LOW,0.5)-VWAP alpha_042=cs_rank(VWAP-CLOSE)/cs_rank(VWAP+CLOSE) alpha_053=-ts_delta((CLOSE-LOW-(HIGH-CLOSE))/(CLOSE-LOW),9) alpha_057=-((CLOSE-VWAP)/ts_decay_linear(cs_rank(ts_arg_max(CLOSE,30)),2)) alpha_101=(CLOSE-OPEN)/(HIGH-LOW+0.001) ``` -------------------------------- ### Install polars_ta for Debugging Source: https://github.com/wukan1986/polars_ta/blob/main/README.md Provides commands to clone the repository and install the package in editable mode (`pip install -e .`). This setup is typically used for debugging or contributing to the library, allowing changes to be reflected immediately. ```commandline git clone --depth=1 https://github.com/wukan1986/polars_ta.git cd polars_ta pip install -e . ``` -------------------------------- ### Install polars_ta using pip Source: https://github.com/wukan1986/polars_ta/blob/main/README.md Installs the polars_ta library using pip, with options for the official PyPI repository or a mirror in China. This is the standard method for installing the package. ```commandline pip install -i https://pypi.org/simple --upgrade polars_ta pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade polars_ta # Mirror in China ``` -------------------------------- ### Build and Install polars_ta from Source Source: https://github.com/wukan1986/polars_ta/blob/main/README.md Provides instructions to clone the polars_ta repository, build the package using 'python -m build', and then install the generated wheel file. This method is useful for development or when the latest unreleased version is needed. ```commandline git clone --depth=1 https://github.com/wukan1986/polars_ta.git cd polars_ta python -m build cd dist pip install polars_ta-0.1.2-py3-none-any.whl ``` -------------------------------- ### Apply Technical Indicators using polars_ta Source: https://github.com/wukan1986/polars_ta/blob/main/README.md Demonstrates how to use polars_ta to add multiple technical indicators to a polars DataFrame. It shows importing functions from different prefixes (tdx, wq) and applying them using polars expressions, aliasing the results for clarity. ```python # We need to modify the function name by prefixing `ts_` before using them in `expr_coodegen` from polars_ta.prefix.tdx import * # Import functions from `wq` from polars_ta.prefix.wq import * # Example df = df.with_columns([ # Load from `wq` *[ts_returns(CLOSE, i).alias(f'ROCP_{i:03d}') for i in (1, 3, 5, 10, 20, 60, 120)], *[ts_mean(CLOSE, i).alias(f'SMA_{i:03d}') for i in (5, 10, 20, 60, 120)], *[ts_std_dev(CLOSE, i).alias(f'STD_{i:03d}') for i in (5, 10, 20, 60, 120)], *[ts_max(HIGH, i).alias(f'HHV_{i:03d}') for i in (5, 10, 20, 60, 120)], *[ts_min(LOW, i).alias(f'LLV_{i:03d}') for i in (5, 10, 20, 60, 120)], # Load from `tdx` *[ts_RSI(CLOSE, i).alias(f'RSI_{i:03d}') for i in (6, 12, 24)], ]) ``` -------------------------------- ### Python None vs NaN Comparison Source: https://github.com/wukan1986/polars_ta/blob/main/nan_to_null.md Demonstrates the difference in equality comparison between Python's `None` and NumPy's `np.nan`. Highlights the need for `is_null` or `is_nan` functions for reliable checks. ```python None == None # True # (It should be `None is None`) np.nan == np.nan # False ``` -------------------------------- ### Polars Series with nan_to_null Source: https://github.com/wukan1986/polars_ta/blob/main/nan_to_null.md Shows how to create a Polars Series while ensuring NaN values are converted to null. This is often necessary when interfacing with libraries that expect nulls or when converting from NumPy arrays. ```python pl.Series(, nan_to_null=True) ``` -------------------------------- ### Configure Global and Function-Specific Sample Counts Source: https://github.com/wukan1986/polars_ta/blob/main/README.md Illustrates how to set the minimum number of samples required for indicator calculations. It shows both a global setting using `polars_ta.MIN_SAMPLES` and a function-specific override using the `min_samples` parameter, with the latter taking precedence. ```python import polars_ta # Global settings. Priority Low polars_ta.MIN_SAMPLES = 1 # High priority ts_mean(CLOSE, 10, min_samples=1) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.