tulip_rs 0.1.11

High-performance technical analysis library — 100+ indicators and 60+ candlestick patterns with SIMD acceleration
Documentation
//! Candlestick patterns - auto-generated registry
//!
//! This module includes the auto-generated pattern registry that is created
//! at build time by scanning all pattern modules.
//!
//! ## Adding a New Pattern
//!
//! 1. Create a new module file in the appropriate directory:
//!    - `candle_patterns/one_bar/*.rs` for 1-bar patterns
//!    - `candle_patterns/two_bar/*.rs` for 2-bar patterns
//!    - `candle_patterns/three_bar/*.rs` for 3-bar patterns
//!    - etc.
//!
//! 2. Use the `#[pattern_template]` attribute macro:
//!
//! ```rust,ignore
//! use tulip_rs_macros::pattern_template;
//!
//! #[pattern_template(
//!     name = "MyPattern",
//!     forecast = "BullishReversal",
//!     bar(colour = "GREEN", fill = "SOLID"),
//! )]
//! pub fn calc(
//!     open: &[f64],
//!     high: &[f64],
//!     low: &[f64],
//!     close: &[f64],
//!     i: usize,
//!     state: &EmaState,
//!     _bars: &[CandleBits],
//! ) -> bool {
//!     // Your pattern logic here
//!     true
//! }
//!
//! pub fn info() -> CandleInfo {
//!     CandleInfo {
//!         name: "mypattern",
//!         full_name: "My Pattern",
//!         forecast: ForecastType::BullishReversal,
//!         bars: 1,
//!         japanese_name: "",
//!     }
//! }
//! ```
//!
//! 3. Build the project - the pattern is automatically registered!
//!
//! ## What Gets Generated
//!
//! The build script scans all pattern modules and generates:
//! - `CandlePattern` enum with all pattern variants
//! - `PATTERN_DEFINITIONS` grouped by bar count
//! - `FORECAST_PATTERN_INDICES` grouped by forecast type
//! - `PATTERN_REGISTRY` - the complete const registry
//! - Pattern dispatch implementations (calc, get_info)
//!
//! ## No Manual Wiring Required
//!
//! Everything is automatic:
//! - Pattern definitions are in their own modules
//! - Build script finds them and generates the registry
//! - Zero boilerplate, zero manual maintenance

// Pattern module directories
pub mod five_bar;
pub mod four_bar;
pub mod one_bar;
pub mod three_bar;
pub mod two_bar;

// Include the auto-generated registry
// This file is created by build.rs at compile time
#[cfg(not(rust_analyzer))]
include!(concat!(env!("OUT_DIR"), "/generated_registry.rs"));

#[cfg(rust_analyzer)]
mod generated_stub {
    #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
    pub enum CandlePattern {
        // Stub - actual enum generated by build.rs
    }
}