A comprehensive collection of enhanced Pine Script libraries for TradingView, designed to provide advanced technical analysis tools with greater flexibility and customization options than standard built-in functions.
This repository contains a suite of Pine Script libraries that extend TradingView's capabilities with enhanced technical indicators, candlestick analysis tools, market structure functions, and utility helpers. Each library is designed to be modular, well-documented, and easy to integrate into your scripts.
| Library | Description | Key Features | TradingView Link |
|---|---|---|---|
| TAIndicators | Enhanced technical indicators with customizable moving average types | RSI, MACD, ATR, VWAP, Bollinger Bands, Keltner Channels with flexible smoothing options | View → |
| CandleAnalysis | Comprehensive candlestick pattern recognition and analysis | Pattern detection (Hammer, Doji, Shooting Star), body/wick measurements, directional analysis | View → |
| MarketAnalysis | Fibonacci-based market structure analysis | Fibonacci retracements and extensions for bullish/bearish scenarios | View → |
| Objects | Pine Script object and variable type utilities | Dynamic type detection and object management for debugging and validation | View → |
To use any library in your Pine Script, import it using the TradingView publishing link:
//@version=6
indicator("My Indicator", overlay=true)
// Import the TAIndicators library
import ActiveQuants/TAIndicators/2 as tai
// Use enhanced RSI with EMA smoothing
[rsiValue, smoothedRsi, _, _, bullDiv, bearDiv] = tai.rsi(close, 14, "EMA", 10)
plot(rsiValue, color=color.blue, title="RSI")
plot(smoothedRsi, color=color.orange, title="Smoothed RSI")
Each library folder contains:
- README.md - Detailed documentation and usage examples
- Source Code - Complete Pine Script implementation
- CHANGELOG.md - Version history and breaking changes (where applicable)
- Customizable Moving Averages: Choose from SMA, EMA, WMA, VWMA, SMMA, and more for calculations and smoothing
- Modular Design: Use only the functions you need without bloating your script
- Consistent APIs: Standardized function signatures across all libraries
- Built-in Divergence Detection: Automatic bullish/bearish divergence identification
- Multiple Timeframe Support: Functions designed to work across different timeframes
- Comprehensive Pattern Recognition: Beyond basic patterns with customizable thresholds
- Well-Documented: Clear examples and parameter explanations
- Type Safety: Robust error handling and input validation
- Performance Optimized: Efficient algorithms that don't slow down your charts
Enhanced technical indicators with flexible moving average options:
import ActiveQuants/TAIndicators/2 as tai
// Calculate 20-period WMA, then smooth with 10-period SMA
[wma, smoothedWma] = tai.ma("WMA", close, 20, "SMA", 10)
// RSI with custom smoothing and divergence detection
[rsi, smoothRsi, _, _, bullDiv, bearDiv] = tai.rsi(close, 14, "EMA", 10)
Comprehensive candlestick analysis tools:
import MarcosACH/CandleAnalysis/1 as candle
// Basic candle direction
isBull = candle.isBullish()
isBear = candle.isBearish()
// Pattern recognition
isHammer = candle.isHammer(0.1, 2.0) // 10% body, 2x wick ratio
isDoji = candle.isDoji(0.05) // 5% body threshold
Fibonacci-based market structure analysis:
import MarcosACH/MarketAnalysis/1 as market
// Calculate Fibonacci retracement levels
fib618 = market.bullFibRet(low[20], high[0], 0.618)
fib382 = market.bullFibRet(low[20], high[0], 0.382)
We welcome contributions! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Test your changes thoroughly
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow existing code style and conventions
- Add comprehensive documentation for new functions
- Include usage examples in README files
- Test with multiple timeframes and instruments
If these libraries help your trading analysis, please:
- ⭐ Star this repository
- 🔄 Share with the Pine Script community
- 💬 Leave feedback on TradingView script pages