1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//! 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
// Include the auto-generated registry
// This file is created by build.rs at compile time
include!;