🕯️ Candlestick
Candlestick Pattern Recognition for Rust
A no_std and zero-dependency Rust library for identifying Japanese candlestick patterns in financial markets. Perfect for algorithmic trading, backtesting engines, and technical analysis tools.
✨ Features
- Comprehensive Pattern Coverage: Detects 30+ traditional Japanese candlestick patterns
- Zero Dependencies: Fully
no_stdcompatible with no external dependency - Flexible Architecture:
- Single-candle pattern detection via
CandleSticktrait - Multi-candle pattern analysis via
CandleStream
- Single-candle pattern detection via
- Performance-Oriented: Zero allocation and efficient algorithms
- Simple Integration: Works with any data structure through straightforward trait implementation
📋 Supported Patterns
Single Candle Patterns
- Basic Formations: Bullish/Bearish, Marubozu
- Reversal Signals: Hammer, Inverted Hammer, Hanging Man, Shooting Star
- Indecision Indicators: Spinning Top, Doji and variants (Long-Legged, Dragonfly, Gravestone)
Multi-Candle Patterns
- Reversals: Engulfing, Harami, Morning/Evening Star
- Continuations: Three White Soldiers, Three Black Crows
- Complex Formations: Dark Cloud Cover, Doji Star patterns
🚀 Getting Started
# Cargo.toml
[]
= "0.1.0"
💻 Usage Examples
Basic Pattern Detection
use CandleStick;
// Simple tuple representation: (open, high, low, close)
let candle = ;
// Check for patterns
if candle.is_hammer else if candle.is_doji
Multi-Candle Pattern Analysis
use ;
// Create candles (open, high, low, close)
let candle1 = ; // Day 1
let candle2 = ; // Day 2
// Create a stream and add candles
let mut stream = new;
stream.push.push;
// Check for patterns
if stream.is_bullish_engulfing
Custom Data Structures
use CandleStick;
// Now you can use all pattern detection methods!
let my_candle = MyCandle ;
if my_candle.is_bullish_marubozu
📈 For Traders
This library follows traditional Japanese candlestick pattern definitions and provides detailed context on each pattern's trading significance. Pattern detection is based on mathematically sound ratios that can be customized when needed.
All pattern detection methods include comprehensive documentation explaining:
- Pattern formation characteristics
- Market psychology behind each pattern
- Typical trading signals and significance
- Context where patterns are most reliable
📚 Documentation
For complete API documentation, examples, and pattern explanations, visit: https://docs.rs/candlestick-rs
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
Disclaimer
This software is for informational purposes only. It is not intended as trading or investment advice.