price-action-lib


Nameprice-action-lib JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/nashit8421/price-action-lib
SummaryA comprehensive price action analysis library for Indian stock market
upload_time2025-09-02 01:52:17
maintainerNone
docs_urlNone
authorNashit
requires_python>=3.7
licenseMIT License Copyright (c) 2024 Price Action Library Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords price action trading stock market candlestick patterns technical analysis indian stocks nse bse
VCS
bugtrack_url
requirements pandas numpy scipy
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Price Action Library

A comprehensive Python library for pure price action analysis, specifically optimized for the Indian stock market. Generate **95+ columns** of price action analysis with a single function call!

[![Python 3.7+](https://img.shields.io/badge/python-3.7+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## 🚀 Key Features

- **30+ Candlestick Patterns** - From basic doji to complex triple formations
- **15+ Chart Patterns** - Head & shoulders, triangles, wedges, flags, and more
- **Advanced Market Structure** - BOS, ChoCh, Fair Value Gaps, Order Blocks
- **Support & Resistance** - Multiple detection methods with confluence analysis
- **Volume Analysis** - Volume Spread Analysis (VSA) and volume patterns
- **Price Action Setups** - Pin bars, inside bars, fakey patterns, springs
- **Gap Analysis** - All gap types with classification and tracking
- **Session Analysis** - Indian market hours optimization (9:15 AM - 3:30 PM IST)
- **Multi-Timeframe** - Analyze across different time horizons
- **Machine Learning Ready** - Structured output perfect for ML models

## 🎯 Perfect For

- **Systematic Trading** - Algorithm development and backtesting
- **Market Research** - Comprehensive price action studies  
- **Machine Learning** - Feature engineering for ML models
- **Professional Trading** - Real-time pattern recognition
- **Education** - Learning price action concepts

## âš¡ Quick Start

### Installation

```bash
# Install dependencies
pip install pandas numpy scipy

# Install the library
pip install .
```

### Basic Usage

```python
from price_action_lib import PriceActionAnalyzer
import pandas as pd

# Initialize analyzer
analyzer = PriceActionAnalyzer()

# Load your OHLCV data (1-minute timeframe recommended)
# df should have columns: open, high, low, close, volume with DateTime index

# Get comprehensive analysis - 95+ columns!
result = analyzer.fetch_all(df)

print(f"Generated {result.shape[1]} columns of analysis!")
print(f"Analyzed {result.shape[0]} time periods")

# Individual analysis methods also available
patterns = analyzer.detect_candlestick_patterns(df)
structure = analyzer.analyze_market_structure(df)
levels = analyzer.find_support_resistance(df)
```

### Sample Output

The `fetch_all()` method returns a DataFrame with 95+ columns including:

- **Original OHLCV** (optional)
- **44+ Candlestick patterns** (`pattern_doji`, `pattern_hammer`, etc.)
- **14+ Chart patterns** (`chart_head_and_shoulders`, `chart_triangle`, etc.)
- **Market structure** (`structure_trend`, `structure_bos`, etc.)
- **Fair Value Gaps** (`fvg_bullish`, `fvg_bearish`)
- **Order Blocks** (`order_block_bullish`, `order_block_bearish`)
- **Price Action Setups** (`setup_pin_bar`, `setup_inside_bar`, etc.)
- **Support/Resistance** (`near_support`, `near_resistance`)
- **Volume Analysis** (`volume_spike`, `volume_climax`, etc.)
- **Gap Analysis** (`gap_breakaway`, `gap_exhaustion`, etc.)
- **Metadata** (ATR, volatility, trend classification, price zones)

## 📊 Example Analysis

```python
# Find high-probability trading setups
strong_signals = result[
    (result['near_support'] == True) &      # At key support level
    (result['setup_pin_bar'] == True) &     # Pin bar setup
    (result['volume_spike'] == True) &      # Volume confirmation
    (result['pattern_hammer'] != '')        # Hammer pattern
]

print(f"Found {len(strong_signals)} high-probability setups!")

# Analyze market structure
current_trend = result['structure_trend'].iloc[-1]
trend_strength = result['structure_trend_strength'].iloc[-1]
print(f"Current trend: {current_trend} (strength: {trend_strength:.2f})")
```

## 🇮🇳 Indian Market Optimization

- **Market Hours**: 9:15 AM - 3:30 PM IST
- **Session Analysis**: Pre-open, opening, regular, closing sessions
- **Holiday Handling**: Automatic weekend and holiday filtering
- **NSE/BSE Compatible**: Optimized for Indian stock exchanges

## 📈 Performance

- **Fast Processing**: 400+ bars/second on typical hardware
- **Memory Efficient**: Only 308KB package size
- **Vectorized Operations**: Optimized pandas/numpy operations
- **Scalable**: Handles datasets from 100 to 10,000+ bars

## 📚 Comprehensive Documentation

For detailed documentation, see **[DOCUMENTATION.md](DOCUMENTATION.md)** which includes:

- **Complete API Reference** - All methods with parameters and examples
- **Pattern Recognition Guide** - Details on all 30+ candlestick patterns
- **Market Structure Analysis** - BOS, ChoCh, FVGs, Order Blocks explained
- **Advanced Features** - Multi-timeframe, volume analysis, gap analysis
- **Best Practices** - Data preparation, performance optimization
- **Troubleshooting** - Common issues and solutions
- **Real-world Examples** - Complete trading workflows

## 🔧 Requirements

- **Python**: 3.7 or higher
- **pandas**: >= 1.3.0
- **numpy**: >= 1.21.0  
- **scipy**: >= 1.7.0

## 📋 Data Format

Your DataFrame should have:

```python
                     open    high     low   close  volume
2024-01-15 09:15:00  1000.0  1002.5   999.0  1001.5  25000
2024-01-15 09:16:00  1001.5  1003.0  1000.5  1002.0  18000
# ... with DateTime index and proper OHLC relationships
```

## 🚦 Quick Test

Verify your installation:

```python
from price_action_lib import PriceActionAnalyzer
analyzer = PriceActionAnalyzer()
print("✅ Price Action Library installed successfully!")
```

## 📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

## 🎉 Ready to Get Started?

1. **Install** the library following the instructions above
2. **Read** the comprehensive [DOCUMENTATION.md](DOCUMENTATION.md)
3. **Load** your OHLCV data into a pandas DataFrame
4. **Run** `analyzer.fetch_all(df)` and get 95+ columns of analysis!

**Happy Trading!** 📈💰

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/nashit8421/price-action-lib",
    "name": "price-action-lib",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "price action, trading, stock market, candlestick patterns, technical analysis, indian stocks, NSE, BSE",
    "author": "Nashit",
    "author_email": "Nashit <nashit8421@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/01/1a/e4c4b8effe6140039b3db9460003c7be20939ddd5f042e0ad34e3c2b98fc/price_action_lib-1.0.1.tar.gz",
    "platform": null,
    "description": "# Price Action Library\n\nA comprehensive Python library for pure price action analysis, specifically optimized for the Indian stock market. Generate **95+ columns** of price action analysis with a single function call!\n\n[![Python 3.7+](https://img.shields.io/badge/python-3.7+-blue.svg)](https://www.python.org/downloads/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## \ud83d\ude80 Key Features\n\n- **30+ Candlestick Patterns** - From basic doji to complex triple formations\n- **15+ Chart Patterns** - Head & shoulders, triangles, wedges, flags, and more\n- **Advanced Market Structure** - BOS, ChoCh, Fair Value Gaps, Order Blocks\n- **Support & Resistance** - Multiple detection methods with confluence analysis\n- **Volume Analysis** - Volume Spread Analysis (VSA) and volume patterns\n- **Price Action Setups** - Pin bars, inside bars, fakey patterns, springs\n- **Gap Analysis** - All gap types with classification and tracking\n- **Session Analysis** - Indian market hours optimization (9:15 AM - 3:30 PM IST)\n- **Multi-Timeframe** - Analyze across different time horizons\n- **Machine Learning Ready** - Structured output perfect for ML models\n\n## \ud83c\udfaf Perfect For\n\n- **Systematic Trading** - Algorithm development and backtesting\n- **Market Research** - Comprehensive price action studies  \n- **Machine Learning** - Feature engineering for ML models\n- **Professional Trading** - Real-time pattern recognition\n- **Education** - Learning price action concepts\n\n## \u26a1 Quick Start\n\n### Installation\n\n```bash\n# Install dependencies\npip install pandas numpy scipy\n\n# Install the library\npip install .\n```\n\n### Basic Usage\n\n```python\nfrom price_action_lib import PriceActionAnalyzer\nimport pandas as pd\n\n# Initialize analyzer\nanalyzer = PriceActionAnalyzer()\n\n# Load your OHLCV data (1-minute timeframe recommended)\n# df should have columns: open, high, low, close, volume with DateTime index\n\n# Get comprehensive analysis - 95+ columns!\nresult = analyzer.fetch_all(df)\n\nprint(f\"Generated {result.shape[1]} columns of analysis!\")\nprint(f\"Analyzed {result.shape[0]} time periods\")\n\n# Individual analysis methods also available\npatterns = analyzer.detect_candlestick_patterns(df)\nstructure = analyzer.analyze_market_structure(df)\nlevels = analyzer.find_support_resistance(df)\n```\n\n### Sample Output\n\nThe `fetch_all()` method returns a DataFrame with 95+ columns including:\n\n- **Original OHLCV** (optional)\n- **44+ Candlestick patterns** (`pattern_doji`, `pattern_hammer`, etc.)\n- **14+ Chart patterns** (`chart_head_and_shoulders`, `chart_triangle`, etc.)\n- **Market structure** (`structure_trend`, `structure_bos`, etc.)\n- **Fair Value Gaps** (`fvg_bullish`, `fvg_bearish`)\n- **Order Blocks** (`order_block_bullish`, `order_block_bearish`)\n- **Price Action Setups** (`setup_pin_bar`, `setup_inside_bar`, etc.)\n- **Support/Resistance** (`near_support`, `near_resistance`)\n- **Volume Analysis** (`volume_spike`, `volume_climax`, etc.)\n- **Gap Analysis** (`gap_breakaway`, `gap_exhaustion`, etc.)\n- **Metadata** (ATR, volatility, trend classification, price zones)\n\n## \ud83d\udcca Example Analysis\n\n```python\n# Find high-probability trading setups\nstrong_signals = result[\n    (result['near_support'] == True) &      # At key support level\n    (result['setup_pin_bar'] == True) &     # Pin bar setup\n    (result['volume_spike'] == True) &      # Volume confirmation\n    (result['pattern_hammer'] != '')        # Hammer pattern\n]\n\nprint(f\"Found {len(strong_signals)} high-probability setups!\")\n\n# Analyze market structure\ncurrent_trend = result['structure_trend'].iloc[-1]\ntrend_strength = result['structure_trend_strength'].iloc[-1]\nprint(f\"Current trend: {current_trend} (strength: {trend_strength:.2f})\")\n```\n\n## \ud83c\uddee\ud83c\uddf3 Indian Market Optimization\n\n- **Market Hours**: 9:15 AM - 3:30 PM IST\n- **Session Analysis**: Pre-open, opening, regular, closing sessions\n- **Holiday Handling**: Automatic weekend and holiday filtering\n- **NSE/BSE Compatible**: Optimized for Indian stock exchanges\n\n## \ud83d\udcc8 Performance\n\n- **Fast Processing**: 400+ bars/second on typical hardware\n- **Memory Efficient**: Only 308KB package size\n- **Vectorized Operations**: Optimized pandas/numpy operations\n- **Scalable**: Handles datasets from 100 to 10,000+ bars\n\n## \ud83d\udcda Comprehensive Documentation\n\nFor detailed documentation, see **[DOCUMENTATION.md](DOCUMENTATION.md)** which includes:\n\n- **Complete API Reference** - All methods with parameters and examples\n- **Pattern Recognition Guide** - Details on all 30+ candlestick patterns\n- **Market Structure Analysis** - BOS, ChoCh, FVGs, Order Blocks explained\n- **Advanced Features** - Multi-timeframe, volume analysis, gap analysis\n- **Best Practices** - Data preparation, performance optimization\n- **Troubleshooting** - Common issues and solutions\n- **Real-world Examples** - Complete trading workflows\n\n## \ud83d\udd27 Requirements\n\n- **Python**: 3.7 or higher\n- **pandas**: >= 1.3.0\n- **numpy**: >= 1.21.0  \n- **scipy**: >= 1.7.0\n\n## \ud83d\udccb Data Format\n\nYour DataFrame should have:\n\n```python\n                     open    high     low   close  volume\n2024-01-15 09:15:00  1000.0  1002.5   999.0  1001.5  25000\n2024-01-15 09:16:00  1001.5  1003.0  1000.5  1002.0  18000\n# ... with DateTime index and proper OHLC relationships\n```\n\n## \ud83d\udea6 Quick Test\n\nVerify your installation:\n\n```python\nfrom price_action_lib import PriceActionAnalyzer\nanalyzer = PriceActionAnalyzer()\nprint(\"\u2705 Price Action Library installed successfully!\")\n```\n\n## \ud83d\udcc4 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## \ud83c\udf89 Ready to Get Started?\n\n1. **Install** the library following the instructions above\n2. **Read** the comprehensive [DOCUMENTATION.md](DOCUMENTATION.md)\n3. **Load** your OHLCV data into a pandas DataFrame\n4. **Run** `analyzer.fetch_all(df)` and get 95+ columns of analysis!\n\n**Happy Trading!** \ud83d\udcc8\ud83d\udcb0\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2024 Price Action Library\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.",
    "summary": "A comprehensive price action analysis library for Indian stock market",
    "version": "1.0.1",
    "project_urls": {
        "Documentation": "https://github.com/nashit8421/price-action-lib#readme",
        "Homepage": "https://github.com/nashit8421/price-action-lib",
        "Issues": "https://github.com/nashit8421/price-action-lib/issues",
        "Repository": "https://github.com/nashit8421/price-action-lib.git"
    },
    "split_keywords": [
        "price action",
        " trading",
        " stock market",
        " candlestick patterns",
        " technical analysis",
        " indian stocks",
        " nse",
        " bse"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a3c752bd5acc85812162a5698e11f0b7e728f51fffce44a002d1ce2afd6f05c6",
                "md5": "1df4b9ac8227c0b7de1180b62a5a14dd",
                "sha256": "971bf003cd384663c7c9b2e58bb2bf5f6ff68ae762fa0841c15e6cdf39b689d4"
            },
            "downloads": -1,
            "filename": "price_action_lib-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1df4b9ac8227c0b7de1180b62a5a14dd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 57620,
            "upload_time": "2025-09-02T01:52:16",
            "upload_time_iso_8601": "2025-09-02T01:52:16.417303Z",
            "url": "https://files.pythonhosted.org/packages/a3/c7/52bd5acc85812162a5698e11f0b7e728f51fffce44a002d1ce2afd6f05c6/price_action_lib-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "011ae4c4b8effe6140039b3db9460003c7be20939ddd5f042e0ad34e3c2b98fc",
                "md5": "ff76fd99a16b14ce39b7a322ec8da531",
                "sha256": "83e009a633a763984f0e1b51cdc3f61c91c56f240fa037afac06341037e3955d"
            },
            "downloads": -1,
            "filename": "price_action_lib-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "ff76fd99a16b14ce39b7a322ec8da531",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 60799,
            "upload_time": "2025-09-02T01:52:17",
            "upload_time_iso_8601": "2025-09-02T01:52:17.881432Z",
            "url": "https://files.pythonhosted.org/packages/01/1a/e4c4b8effe6140039b3db9460003c7be20939ddd5f042e0ad34e3c2b98fc/price_action_lib-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-02 01:52:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nashit8421",
    "github_project": "price-action-lib",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "pandas",
            "specs": [
                [
                    ">=",
                    "1.3.0"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    ">=",
                    "1.21.0"
                ]
            ]
        },
        {
            "name": "scipy",
            "specs": [
                [
                    ">=",
                    "1.7.0"
                ]
            ]
        }
    ],
    "lcname": "price-action-lib"
}
        
Elapsed time: 1.01381s