Skip to main content

quantwave_core/indicators/
pattern.rs

1use crate::indicators::metadata::IndicatorMetadata;
2#[allow(unused_imports)]
3use crate::traits::Next;
4talib_cdl!(CDLDOJI, talib_rs::pattern::cdl_doji);
5impl Default for CDLDOJI {
6    fn default() -> Self {
7        Self::new()
8    }
9}
10talib_cdl!(CDLHAMMER, talib_rs::pattern::cdl_hammer);
11impl Default for CDLHAMMER {
12    fn default() -> Self {
13        Self::new()
14    }
15}
16talib_cdl!(CDLENGULFING, talib_rs::pattern::cdl_engulfing);
17impl Default for CDLENGULFING {
18    fn default() -> Self {
19        Self::new()
20    }
21}
22talib_cdl!(CDLCLOSINGMARUBOZU, talib_rs::pattern::cdl_closingmarubozu);
23impl Default for CDLCLOSINGMARUBOZU {
24    fn default() -> Self {
25        Self::new()
26    }
27}
28talib_cdl!(CDLDRAGONFLYDOJI, talib_rs::pattern::cdl_dragonflydoji);
29impl Default for CDLDRAGONFLYDOJI {
30    fn default() -> Self {
31        Self::new()
32    }
33}
34talib_cdl!(CDLGRAVESTONEDOJI, talib_rs::pattern::cdl_gravestonedoji);
35impl Default for CDLGRAVESTONEDOJI {
36    fn default() -> Self {
37        Self::new()
38    }
39}
40talib_cdl!(CDLHIGHWAVE, talib_rs::pattern::cdl_highwave);
41impl Default for CDLHIGHWAVE {
42    fn default() -> Self {
43        Self::new()
44    }
45}
46talib_cdl!(CDLLONGLEGGEDDOJI, talib_rs::pattern::cdl_longleggeddoji);
47impl Default for CDLLONGLEGGEDDOJI {
48    fn default() -> Self {
49        Self::new()
50    }
51}
52talib_cdl!(CDLLONGLINE, talib_rs::pattern::cdl_longline);
53impl Default for CDLLONGLINE {
54    fn default() -> Self {
55        Self::new()
56    }
57}
58talib_cdl!(CDLMARUBOZU, talib_rs::pattern::cdl_marubozu);
59impl Default for CDLMARUBOZU {
60    fn default() -> Self {
61        Self::new()
62    }
63}
64talib_cdl!(CDLRICKSHAWMAN, talib_rs::pattern::cdl_rickshawman);
65impl Default for CDLRICKSHAWMAN {
66    fn default() -> Self {
67        Self::new()
68    }
69}
70talib_cdl!(CDLSHORTLINE, talib_rs::pattern::cdl_shortline);
71impl Default for CDLSHORTLINE {
72    fn default() -> Self {
73        Self::new()
74    }
75}
76talib_cdl!(CDLSPINNINGTOP, talib_rs::pattern::cdl_spinningtop);
77impl Default for CDLSPINNINGTOP {
78    fn default() -> Self {
79        Self::new()
80    }
81}
82talib_cdl!(CDLTAKURI, talib_rs::pattern::cdl_takuri);
83impl Default for CDLTAKURI {
84    fn default() -> Self {
85        Self::new()
86    }
87}
88talib_cdl!(CDL2CROWS, talib_rs::pattern::cdl_2crows);
89impl Default for CDL2CROWS {
90    fn default() -> Self {
91        Self::new()
92    }
93}
94talib_cdl!(CDLCOUNTERATTACK, talib_rs::pattern::cdl_counterattack);
95impl Default for CDLCOUNTERATTACK {
96    fn default() -> Self {
97        Self::new()
98    }
99}
100talib_cdl!(CDLDARKCLOUDCOVER, talib_rs::pattern::cdl_darkcloudcover);
101impl Default for CDLDARKCLOUDCOVER {
102    fn default() -> Self {
103        Self::new()
104    }
105}
106talib_cdl!(CDLDOJISTAR, talib_rs::pattern::cdl_dojistar);
107impl Default for CDLDOJISTAR {
108    fn default() -> Self {
109        Self::new()
110    }
111}
112talib_cdl!(CDLHANGINGMAN, talib_rs::pattern::cdl_hangingman);
113impl Default for CDLHANGINGMAN {
114    fn default() -> Self {
115        Self::new()
116    }
117}
118talib_cdl!(CDLHARAMI, talib_rs::pattern::cdl_harami);
119impl Default for CDLHARAMI {
120    fn default() -> Self {
121        Self::new()
122    }
123}
124talib_cdl!(CDLHARAMICROSS, talib_rs::pattern::cdl_haramicross);
125impl Default for CDLHARAMICROSS {
126    fn default() -> Self {
127        Self::new()
128    }
129}
130talib_cdl!(CDLHIKKAKE, talib_rs::pattern::cdl_hikkake);
131impl Default for CDLHIKKAKE {
132    fn default() -> Self {
133        Self::new()
134    }
135}
136talib_cdl!(CDLHIKKAKEMOD, talib_rs::pattern::cdl_hikkakemod);
137impl Default for CDLHIKKAKEMOD {
138    fn default() -> Self {
139        Self::new()
140    }
141}
142talib_cdl!(CDLHOMINGPIGEON, talib_rs::pattern::cdl_homingpigeon);
143impl Default for CDLHOMINGPIGEON {
144    fn default() -> Self {
145        Self::new()
146    }
147}
148talib_cdl!(CDLINNECK, talib_rs::pattern::cdl_inneck);
149impl Default for CDLINNECK {
150    fn default() -> Self {
151        Self::new()
152    }
153}
154talib_cdl!(CDLINVERTEDHAMMER, talib_rs::pattern::cdl_invertedhammer);
155impl Default for CDLINVERTEDHAMMER {
156    fn default() -> Self {
157        Self::new()
158    }
159}
160talib_cdl!(CDLKICKING, talib_rs::pattern::cdl_kicking);
161impl Default for CDLKICKING {
162    fn default() -> Self {
163        Self::new()
164    }
165}
166talib_cdl!(CDLKICKINGBYLENGTH, talib_rs::pattern::cdl_kickingbylength);
167impl Default for CDLKICKINGBYLENGTH {
168    fn default() -> Self {
169        Self::new()
170    }
171}
172talib_cdl!(CDLMATCHINGLOW, talib_rs::pattern::cdl_matchinglow);
173impl Default for CDLMATCHINGLOW {
174    fn default() -> Self {
175        Self::new()
176    }
177}
178talib_cdl!(CDLONNECK, talib_rs::pattern::cdl_onneck);
179impl Default for CDLONNECK {
180    fn default() -> Self {
181        Self::new()
182    }
183}
184talib_cdl!(CDLPIERCING, talib_rs::pattern::cdl_piercing);
185impl Default for CDLPIERCING {
186    fn default() -> Self {
187        Self::new()
188    }
189}
190talib_cdl!(CDLSEPARATINGLINES, talib_rs::pattern::cdl_separatinglines);
191impl Default for CDLSEPARATINGLINES {
192    fn default() -> Self {
193        Self::new()
194    }
195}
196talib_cdl!(CDLSHOOTINGSTAR, talib_rs::pattern::cdl_shootingstar);
197impl Default for CDLSHOOTINGSTAR {
198    fn default() -> Self {
199        Self::new()
200    }
201}
202talib_cdl!(CDLSTICKSANDWICH, talib_rs::pattern::cdl_sticksandwich);
203impl Default for CDLSTICKSANDWICH {
204    fn default() -> Self {
205        Self::new()
206    }
207}
208talib_cdl!(CDLTHRUSTING, talib_rs::pattern::cdl_thrusting);
209impl Default for CDLTHRUSTING {
210    fn default() -> Self {
211        Self::new()
212    }
213}
214talib_cdl!(CDLBELTHOLD, talib_rs::pattern::cdl_belthold);
215impl Default for CDLBELTHOLD {
216    fn default() -> Self {
217        Self::new()
218    }
219}
220talib_cdl!(CDL3BLACKCROWS, talib_rs::pattern::cdl_3blackcrows);
221impl Default for CDL3BLACKCROWS {
222    fn default() -> Self {
223        Self::new()
224    }
225}
226talib_cdl!(CDL3INSIDE, talib_rs::pattern::cdl_3inside);
227impl Default for CDL3INSIDE {
228    fn default() -> Self {
229        Self::new()
230    }
231}
232talib_cdl!(CDL3LINESTRIKE, talib_rs::pattern::cdl_3linestrike);
233impl Default for CDL3LINESTRIKE {
234    fn default() -> Self {
235        Self::new()
236    }
237}
238talib_cdl!(CDL3OUTSIDE, talib_rs::pattern::cdl_3outside);
239impl Default for CDL3OUTSIDE {
240    fn default() -> Self {
241        Self::new()
242    }
243}
244talib_cdl!(CDL3STARSINSOUTH, talib_rs::pattern::cdl_3starsinsouth);
245impl Default for CDL3STARSINSOUTH {
246    fn default() -> Self {
247        Self::new()
248    }
249}
250talib_cdl!(CDL3WHITESOLDIERS, talib_rs::pattern::cdl_3whitesoldiers);
251impl Default for CDL3WHITESOLDIERS {
252    fn default() -> Self {
253        Self::new()
254    }
255}
256talib_cdl!(CDLABANDONEDBABY, talib_rs::pattern::cdl_abandonedbaby);
257impl Default for CDLABANDONEDBABY {
258    fn default() -> Self {
259        Self::new()
260    }
261}
262talib_cdl!(CDLADVANCEBLOCK, talib_rs::pattern::cdl_advanceblock);
263impl Default for CDLADVANCEBLOCK {
264    fn default() -> Self {
265        Self::new()
266    }
267}
268talib_cdl!(CDLBREAKAWAY, talib_rs::pattern::cdl_breakaway);
269impl Default for CDLBREAKAWAY {
270    fn default() -> Self {
271        Self::new()
272    }
273}
274talib_cdl!(CDLCONCEALBABYSWALL, talib_rs::pattern::cdl_concealbabyswall);
275impl Default for CDLCONCEALBABYSWALL {
276    fn default() -> Self {
277        Self::new()
278    }
279}
280talib_cdl!(CDLEVENINGDOJISTAR, talib_rs::pattern::cdl_eveningdojistar);
281impl Default for CDLEVENINGDOJISTAR {
282    fn default() -> Self {
283        Self::new()
284    }
285}
286talib_cdl!(CDLEVENINGSTAR, talib_rs::pattern::cdl_eveningstar);
287impl Default for CDLEVENINGSTAR {
288    fn default() -> Self {
289        Self::new()
290    }
291}
292talib_cdl!(CDLGAPSIDESIDEWHITE, talib_rs::pattern::cdl_gapsidesidewhite);
293impl Default for CDLGAPSIDESIDEWHITE {
294    fn default() -> Self {
295        Self::new()
296    }
297}
298talib_cdl!(CDLIDENTICAL3CROWS, talib_rs::pattern::cdl_identical3crows);
299impl Default for CDLIDENTICAL3CROWS {
300    fn default() -> Self {
301        Self::new()
302    }
303}
304talib_cdl!(CDLLADDERBOTTOM, talib_rs::pattern::cdl_ladderbottom);
305impl Default for CDLLADDERBOTTOM {
306    fn default() -> Self {
307        Self::new()
308    }
309}
310talib_cdl!(CDLMATHOLD, talib_rs::pattern::cdl_mathold);
311impl Default for CDLMATHOLD {
312    fn default() -> Self {
313        Self::new()
314    }
315}
316talib_cdl!(CDLMORNINGDOJISTAR, talib_rs::pattern::cdl_morningdojistar);
317impl Default for CDLMORNINGDOJISTAR {
318    fn default() -> Self {
319        Self::new()
320    }
321}
322talib_cdl!(CDLMORNINGSTAR, talib_rs::pattern::cdl_morningstar);
323impl Default for CDLMORNINGSTAR {
324    fn default() -> Self {
325        Self::new()
326    }
327}
328talib_cdl!(CDLRISEFALL3METHODS, talib_rs::pattern::cdl_risefall3methods);
329impl Default for CDLRISEFALL3METHODS {
330    fn default() -> Self {
331        Self::new()
332    }
333}
334talib_cdl!(CDLSTALLEDPATTERN, talib_rs::pattern::cdl_stalledpattern);
335impl Default for CDLSTALLEDPATTERN {
336    fn default() -> Self {
337        Self::new()
338    }
339}
340talib_cdl!(CDLTASUKIGAP, talib_rs::pattern::cdl_tasukigap);
341impl Default for CDLTASUKIGAP {
342    fn default() -> Self {
343        Self::new()
344    }
345}
346talib_cdl!(CDLTRISTAR, talib_rs::pattern::cdl_tristar);
347impl Default for CDLTRISTAR {
348    fn default() -> Self {
349        Self::new()
350    }
351}
352talib_cdl!(CDLUNIQUE3RIVER, talib_rs::pattern::cdl_unique3river);
353impl Default for CDLUNIQUE3RIVER {
354    fn default() -> Self {
355        Self::new()
356    }
357}
358talib_cdl!(CDLUPSIDEGAP2CROWS, talib_rs::pattern::cdl_upsidegap2crows);
359impl Default for CDLUPSIDEGAP2CROWS {
360    fn default() -> Self {
361        Self::new()
362    }
363}
364talib_cdl!(CDLXSIDEGAP3METHODS, talib_rs::pattern::cdl_xsidegap3methods);
365impl Default for CDLXSIDEGAP3METHODS {
366    fn default() -> Self {
367        Self::new()
368    }
369}
370
371#[cfg(test)]
372mod tests {
373    use super::*;
374    use crate::traits::Next;
375    use proptest::prelude::*;
376
377    proptest! {
378        #[test]
379        fn test_cdl_doji_parity(
380            o in prop::collection::vec(10.0..100.0, 1..100),
381            h in prop::collection::vec(10.0..100.0, 1..100),
382            l in prop::collection::vec(10.0..100.0, 1..100),
383            c in prop::collection::vec(10.0..100.0, 1..100)
384        ) {
385            let len = o.len().min(h.len()).min(l.len()).min(c.len());
386            if len == 0 { return Ok(()); }
387
388            let mut doji = CDLDOJI::new();
389            let streaming_results: Vec<f64> = (0..len).map(|i| doji.next((o[i], h[i], l[i], c[i]))).collect();
390            let batch_results = talib_rs::pattern::cdl_doji(&o[..len], &h[..len], &l[..len], &c[..len]).unwrap_or_else(|_| vec![0; len]);
391
392            for (s, b) in streaming_results.iter().zip(batch_results.iter()) {
393                assert_eq!(*s as i32, *b);
394            }
395        }
396
397        #[test]
398        fn test_cdl_hammer_parity(
399            o in prop::collection::vec(10.0..100.0, 1..100),
400            h in prop::collection::vec(10.0..100.0, 1..100),
401            l in prop::collection::vec(10.0..100.0, 1..100),
402            c in prop::collection::vec(10.0..100.0, 1..100)
403        ) {
404            let len = o.len().min(h.len()).min(l.len()).min(c.len());
405            if len == 0 { return Ok(()); }
406
407            let mut hammer = CDLHAMMER::new();
408            let streaming_results: Vec<f64> = (0..len).map(|i| hammer.next((o[i], h[i], l[i], c[i]))).collect();
409            let batch_results = talib_rs::pattern::cdl_hammer(&o[..len], &h[..len], &l[..len], &c[..len]).unwrap_or_else(|_| vec![0; len]);
410
411            for (s, b) in streaming_results.iter().zip(batch_results.iter()) {
412                assert_eq!(*s as i32, *b);
413            }
414        }
415    }
416}
417
418
419pub const CDLDOJI_METADATA: IndicatorMetadata = IndicatorMetadata {
420    name: "Doji",
421    description: "A candlestick pattern where the open and close are virtually equal.",
422    usage: "Indicates indecision between buyers and sellers.",
423    keywords: &["pattern", "candlestick", "classic"],
424    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
425    params: &[],
426    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
427    formula_latex: r#"
428\text{Pattern Recognition Logic (TA-Lib Internal)}
429"#,
430    gold_standard_file: "cdldoji.json",
431    category: "Patterns",
432};
433
434pub const CDLHAMMER_METADATA: IndicatorMetadata = IndicatorMetadata {
435    name: "Hammer",
436    description: "A bullish reversal pattern with a small body and long lower shadow.",
437    usage: "Signals a potential bottom after a downtrend.",
438    keywords: &["pattern", "candlestick", "classic"],
439    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
440    params: &[],
441    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
442    formula_latex: r#"
443\text{Pattern Recognition Logic (TA-Lib Internal)}
444"#,
445    gold_standard_file: "cdlhammer.json",
446    category: "Patterns",
447};
448
449pub const CDLENGULFING_METADATA: IndicatorMetadata = IndicatorMetadata {
450    name: "Engulfing",
451    description: "A pattern where a larger candle completely covers the previous smaller candle.",
452    usage: "Signals a strong shift in momentum.",
453    keywords: &["pattern", "candlestick", "classic"],
454    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
455    params: &[],
456    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
457    formula_latex: r#"
458\text{Pattern Recognition Logic (TA-Lib Internal)}
459"#,
460    gold_standard_file: "cdlengulfing.json",
461    category: "Patterns",
462};
463
464pub const CDLCLOSINGMARUBOZU_METADATA: IndicatorMetadata = IndicatorMetadata {
465    name: "Closing Marubozu",
466    description: "A candle with no shadow at the closing end.",
467    usage: "Indicates strong conviction in the direction of the close.",
468    keywords: &["pattern", "candlestick", "classic"],
469    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
470    params: &[],
471    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
472    formula_latex: r#"
473\text{Pattern Recognition Logic (TA-Lib Internal)}
474"#,
475    gold_standard_file: "cdlclosingmarubozu.json",
476    category: "Patterns",
477};
478
479pub const CDLDRAGONFLYDOJI_METADATA: IndicatorMetadata = IndicatorMetadata {
480    name: "Dragonfly Doji",
481    description: "A doji with a long lower shadow and no upper shadow.",
482    usage: "Signals a potential bullish reversal.",
483    keywords: &["pattern", "candlestick", "classic"],
484    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
485    params: &[],
486    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
487    formula_latex: r#"
488\text{Pattern Recognition Logic (TA-Lib Internal)}
489"#,
490    gold_standard_file: "cdldragonflydoji.json",
491    category: "Patterns",
492};
493
494pub const CDLGRAVESTONEDOJI_METADATA: IndicatorMetadata = IndicatorMetadata {
495    name: "Gravestone Doji",
496    description: "A doji with a long upper shadow and no lower shadow.",
497    usage: "Signals a potential bearish reversal.",
498    keywords: &["pattern", "candlestick", "classic"],
499    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
500    params: &[],
501    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
502    formula_latex: r#"
503\text{Pattern Recognition Logic (TA-Lib Internal)}
504"#,
505    gold_standard_file: "cdlgravestonedoji.json",
506    category: "Patterns",
507};
508
509pub const CDLHIGHWAVE_METADATA: IndicatorMetadata = IndicatorMetadata {
510    name: "High-Wave Candle",
511    description: "A candle with very long shadows and a small body.",
512    usage: "Indicates extreme market confusion and volatility.",
513    keywords: &["pattern", "candlestick", "classic"],
514    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
515    params: &[],
516    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
517    formula_latex: r#"
518\text{Pattern Recognition Logic (TA-Lib Internal)}
519"#,
520    gold_standard_file: "cdlhighwave.json",
521    category: "Patterns",
522};
523
524pub const CDLLONGLEGGEDDOJI_METADATA: IndicatorMetadata = IndicatorMetadata {
525    name: "Long-Legged Doji",
526    description: "A doji with long shadows on both sides.",
527    usage: "Indicates a significant struggle between bulls and bears.",
528    keywords: &["pattern", "candlestick", "classic"],
529    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
530    params: &[],
531    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
532    formula_latex: r#"
533\text{Pattern Recognition Logic (TA-Lib Internal)}
534"#,
535    gold_standard_file: "cdllongleggeddoji.json",
536    category: "Patterns",
537};
538
539pub const CDLLONGLINE_METADATA: IndicatorMetadata = IndicatorMetadata {
540    name: "Long Line Candle",
541    description: "A candle with an unusually long body.",
542    usage: "Indicates strong momentum in the direction of the candle.",
543    keywords: &["pattern", "candlestick", "classic"],
544    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
545    params: &[],
546    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
547    formula_latex: r#"
548\text{Pattern Recognition Logic (TA-Lib Internal)}
549"#,
550    gold_standard_file: "cdllongline.json",
551    category: "Patterns",
552};
553
554pub const CDLMARUBOZU_METADATA: IndicatorMetadata = IndicatorMetadata {
555    name: "Marubozu",
556    description: "A candle with no shadows at either end.",
557    usage: "Indicates total dominance by one side for the entire period.",
558    keywords: &["pattern", "candlestick", "classic"],
559    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
560    params: &[],
561    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
562    formula_latex: r#"
563\text{Pattern Recognition Logic (TA-Lib Internal)}
564"#,
565    gold_standard_file: "cdlmarubozu.json",
566    category: "Patterns",
567};
568
569pub const CDLRICKSHAWMAN_METADATA: IndicatorMetadata = IndicatorMetadata {
570    name: "Rickshaw Man",
571    description: "A long-legged doji where the body is in the center of the range.",
572    usage: "Indicates total equilibrium and indecision.",
573    keywords: &["pattern", "candlestick", "classic"],
574    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
575    params: &[],
576    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
577    formula_latex: r#"
578\text{Pattern Recognition Logic (TA-Lib Internal)}
579"#,
580    gold_standard_file: "cdlrickshawman.json",
581    category: "Patterns",
582};
583
584pub const CDLSHORTLINE_METADATA: IndicatorMetadata = IndicatorMetadata {
585    name: "Short Line Candle",
586    description: "A candle with a small body and small shadows.",
587    usage: "Indicates low volatility and consolidation.",
588    keywords: &["pattern", "candlestick", "classic"],
589    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
590    params: &[],
591    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
592    formula_latex: r#"
593\text{Pattern Recognition Logic (TA-Lib Internal)}
594"#,
595    gold_standard_file: "cdlshortline.json",
596    category: "Patterns",
597};
598
599pub const CDLSPINNINGTOP_METADATA: IndicatorMetadata = IndicatorMetadata {
600    name: "Spinning Top",
601    description: "A candle with a small body and long shadows.",
602    usage: "Indicates indecision after a strong move.",
603    keywords: &["pattern", "candlestick", "classic"],
604    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
605    params: &[],
606    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
607    formula_latex: r#"
608\text{Pattern Recognition Logic (TA-Lib Internal)}
609"#,
610    gold_standard_file: "cdlspinningtop.json",
611    category: "Patterns",
612};
613
614pub const CDLTAKURI_METADATA: IndicatorMetadata = IndicatorMetadata {
615    name: "Takuri",
616    description: "A dragonfly doji with an exceptionally long lower shadow.",
617    usage: "Indicates a very strong rejection of lower prices.",
618    keywords: &["pattern", "candlestick", "classic"],
619    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
620    params: &[],
621    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
622    formula_latex: r#"
623\text{Pattern Recognition Logic (TA-Lib Internal)}
624"#,
625    gold_standard_file: "cdltakuri.json",
626    category: "Patterns",
627};
628
629pub const CDL2CROWS_METADATA: IndicatorMetadata = IndicatorMetadata {
630    name: "Two Crows",
631    description: "A bearish reversal pattern consisting of three candles.",
632    usage: "Signals a potential top in an uptrend.",
633    keywords: &["pattern", "candlestick", "classic"],
634    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
635    params: &[],
636    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
637    formula_latex: r#"
638\text{Pattern Recognition Logic (TA-Lib Internal)}
639"#,
640    gold_standard_file: "cdl2crows.json",
641    category: "Patterns",
642};
643
644pub const CDL3BLACKCROWS_METADATA: IndicatorMetadata = IndicatorMetadata {
645    name: "Three Black Crows",
646    description: "A bearish reversal pattern with three long red candles.",
647    usage: "Signals a major trend reversal to the downside.",
648    keywords: &["pattern", "candlestick", "classic"],
649    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
650    params: &[],
651    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
652    formula_latex: r#"
653\text{Pattern Recognition Logic (TA-Lib Internal)}
654"#,
655    gold_standard_file: "cdl3blackcrows.json",
656    category: "Patterns",
657};
658
659pub const CDL3INSIDE_METADATA: IndicatorMetadata = IndicatorMetadata {
660    name: "Three Inside Up/Down",
661    description: "A reversal pattern confirmed by a third candle.",
662    usage: "Signals a more reliable trend change than a simple harami.",
663    keywords: &["pattern", "candlestick", "classic"],
664    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
665    params: &[],
666    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
667    formula_latex: r#"
668\text{Pattern Recognition Logic (TA-Lib Internal)}
669"#,
670    gold_standard_file: "cdl3inside.json",
671    category: "Patterns",
672};
673
674pub const CDL3LINESTRIKE_METADATA: IndicatorMetadata = IndicatorMetadata {
675    name: "Three-Line Strike",
676    description: "A continuation pattern where four candles are involved.",
677    usage: "Signals a temporary pause before the trend continues.",
678    keywords: &["pattern", "candlestick", "classic"],
679    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
680    params: &[],
681    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
682    formula_latex: r#"
683\text{Pattern Recognition Logic (TA-Lib Internal)}
684"#,
685    gold_standard_file: "cdl3linestrike.json",
686    category: "Patterns",
687};
688
689pub const CDL3OUTSIDE_METADATA: IndicatorMetadata = IndicatorMetadata {
690    name: "Three Outside Up/Down",
691    description: "A reversal pattern confirmed by a third candle.",
692    usage: "Signals a more reliable trend change than a simple engulfing.",
693    keywords: &["pattern", "candlestick", "classic"],
694    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
695    params: &[],
696    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
697    formula_latex: r#"
698\text{Pattern Recognition Logic (TA-Lib Internal)}
699"#,
700    gold_standard_file: "cdl3outside.json",
701    category: "Patterns",
702};
703
704pub const CDL3STARSINSOUTH_METADATA: IndicatorMetadata = IndicatorMetadata {
705    name: "Three Stars In The South",
706    description: "A rare bullish reversal pattern in a downtrend.",
707    usage: "Indicates a gradual exhaustion of selling pressure.",
708    keywords: &["pattern", "candlestick", "classic"],
709    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
710    params: &[],
711    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
712    formula_latex: r#"
713\text{Pattern Recognition Logic (TA-Lib Internal)}
714"#,
715    gold_standard_file: "cdl3starsinsouth.json",
716    category: "Patterns",
717};
718
719pub const CDL3WHITESOLDIERS_METADATA: IndicatorMetadata = IndicatorMetadata {
720    name: "Three White Soldiers",
721    description: "A bullish reversal pattern with three long green candles.",
722    usage: "Signals a major trend reversal to the upside.",
723    keywords: &["pattern", "candlestick", "classic"],
724    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
725    params: &[],
726    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
727    formula_latex: r#"
728\text{Pattern Recognition Logic (TA-Lib Internal)}
729"#,
730    gold_standard_file: "cdl3whitesoldiers.json",
731    category: "Patterns",
732};
733
734pub const CDLABANDONEDBABY_METADATA: IndicatorMetadata = IndicatorMetadata {
735    name: "Abandoned Baby",
736    description: "A very rare reversal pattern with a doji gapping away.",
737    usage: "One of the most reliable reversal signals.",
738    keywords: &["pattern", "candlestick", "classic"],
739    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
740    params: &[],
741    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
742    formula_latex: r#"
743\text{Pattern Recognition Logic (TA-Lib Internal)}
744"#,
745    gold_standard_file: "cdlabandonedbaby.json",
746    category: "Patterns",
747};
748
749pub const CDLADVANCEBLOCK_METADATA: IndicatorMetadata = IndicatorMetadata {
750    name: "Advance Block",
751    description: "A bearish reversal pattern in an uptrend.",
752    usage: "Indicates weakening momentum in an upward move.",
753    keywords: &["pattern", "candlestick", "classic"],
754    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
755    params: &[],
756    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
757    formula_latex: r#"
758\text{Pattern Recognition Logic (TA-Lib Internal)}
759"#,
760    gold_standard_file: "cdladvanceblock.json",
761    category: "Patterns",
762};
763
764pub const CDLBELTHOLD_METADATA: IndicatorMetadata = IndicatorMetadata {
765    name: "Belt-Hold",
766    description: "A single candle pattern signaling a reversal.",
767    usage: "Indicates a strong opening in the opposite direction of the trend.",
768    keywords: &["pattern", "candlestick", "classic"],
769    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
770    params: &[],
771    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
772    formula_latex: r#"
773\text{Pattern Recognition Logic (TA-Lib Internal)}
774"#,
775    gold_standard_file: "cdlbelthold.json",
776    category: "Patterns",
777};
778
779pub const CDLBREAKAWAY_METADATA: IndicatorMetadata = IndicatorMetadata {
780    name: "Breakaway",
781    description: "A five-candle reversal pattern.",
782    usage: "Signals the breakout from a short-term consolidation.",
783    keywords: &["pattern", "candlestick", "classic"],
784    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
785    params: &[],
786    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
787    formula_latex: r#"
788\text{Pattern Recognition Logic (TA-Lib Internal)}
789"#,
790    gold_standard_file: "cdlbreakaway.json",
791    category: "Patterns",
792};
793
794pub const CDLCONCEALBABYSWALL_METADATA: IndicatorMetadata = IndicatorMetadata {
795    name: "Concealed Baby Swallow",
796    description: "A rare bullish reversal pattern.",
797    usage: "Indicates a final 'flush out' before a reversal.",
798    keywords: &["pattern", "candlestick", "classic"],
799    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
800    params: &[],
801    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
802    formula_latex: r#"
803\text{Pattern Recognition Logic (TA-Lib Internal)}
804"#,
805    gold_standard_file: "cdlconcealbabyswall.json",
806    category: "Patterns",
807};
808
809pub const CDLCOUNTERATTACK_METADATA: IndicatorMetadata = IndicatorMetadata {
810    name: "Counterattack",
811    description: "A reversal pattern where the second candle closes at the same level as the first.",
812    usage: "Signals a stalemate after a strong move.",
813    keywords: &["pattern", "candlestick", "classic"],
814    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
815    params: &[],
816    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
817    formula_latex: r#"
818\text{Pattern Recognition Logic (TA-Lib Internal)}
819"#,
820    gold_standard_file: "cdlcounterattack.json",
821    category: "Patterns",
822};
823
824pub const CDLDARKCLOUDCOVER_METADATA: IndicatorMetadata = IndicatorMetadata {
825    name: "Dark Cloud Cover",
826    description: "A bearish reversal pattern in an uptrend.",
827    usage: "Indicates a significant rejection of higher prices.",
828    keywords: &["pattern", "candlestick", "classic"],
829    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
830    params: &[],
831    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
832    formula_latex: r#"
833\text{Pattern Recognition Logic (TA-Lib Internal)}
834"#,
835    gold_standard_file: "cdldarkcloudcover.json",
836    category: "Patterns",
837};
838
839pub const CDLDOJISTAR_METADATA: IndicatorMetadata = IndicatorMetadata {
840    name: "Doji Star",
841    description: "A reversal pattern where a doji gaps away.",
842    usage: "Signals a potential shift in trend momentum.",
843    keywords: &["pattern", "candlestick", "classic"],
844    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
845    params: &[],
846    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
847    formula_latex: r#"
848\text{Pattern Recognition Logic (TA-Lib Internal)}
849"#,
850    gold_standard_file: "cdldojistar.json",
851    category: "Patterns",
852};
853
854pub const CDLEVENINGDOJISTAR_METADATA: IndicatorMetadata = IndicatorMetadata {
855    name: "Evening Doji Star",
856    description: "A bearish reversal pattern involving a doji.",
857    usage: "A highly reliable signal of a market top.",
858    keywords: &["pattern", "candlestick", "classic"],
859    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
860    params: &[],
861    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
862    formula_latex: r#"
863\text{Pattern Recognition Logic (TA-Lib Internal)}
864"#,
865    gold_standard_file: "cdleveningdojistar.json",
866    category: "Patterns",
867};
868
869pub const CDLEVENINGSTAR_METADATA: IndicatorMetadata = IndicatorMetadata {
870    name: "Evening Star",
871    description: "A bearish reversal pattern with three candles.",
872    usage: "Signals a peak in an uptrend.",
873    keywords: &["pattern", "candlestick", "classic"],
874    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
875    params: &[],
876    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
877    formula_latex: r#"
878\text{Pattern Recognition Logic (TA-Lib Internal)}
879"#,
880    gold_standard_file: "cdleveningstar.json",
881    category: "Patterns",
882};
883
884pub const CDLGAPSIDESIDEWHITE_METADATA: IndicatorMetadata = IndicatorMetadata {
885    name: "Up/Down-Gap Side-By-Side White Lines",
886    description: "A continuation pattern involving gaps.",
887    usage: "Signals that the current trend is likely to continue.",
888    keywords: &["pattern", "candlestick", "classic"],
889    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
890    params: &[],
891    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
892    formula_latex: r#"
893\text{Pattern Recognition Logic (TA-Lib Internal)}
894"#,
895    gold_standard_file: "cdlgapsidesidewhite.json",
896    category: "Patterns",
897};
898
899pub const CDLHANGINGMAN_METADATA: IndicatorMetadata = IndicatorMetadata {
900    name: "Hanging Man",
901    description: "A bearish reversal pattern at the top of an uptrend.",
902    usage: "Signals a potential breakdown after a period of buying.",
903    keywords: &["pattern", "candlestick", "classic"],
904    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
905    params: &[],
906    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
907    formula_latex: r#"
908\text{Pattern Recognition Logic (TA-Lib Internal)}
909"#,
910    gold_standard_file: "cdlhangingman.json",
911    category: "Patterns",
912};
913
914pub const CDLHARAMI_METADATA: IndicatorMetadata = IndicatorMetadata {
915    name: "Harami",
916    description: "A two-candle reversal pattern where the second is inside the first.",
917    usage: "Signals a potential trend exhaustion.",
918    keywords: &["pattern", "candlestick", "classic"],
919    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
920    params: &[],
921    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
922    formula_latex: r#"
923\text{Pattern Recognition Logic (TA-Lib Internal)}
924"#,
925    gold_standard_file: "cdlharami.json",
926    category: "Patterns",
927};
928
929pub const CDLHARAMICROSS_METADATA: IndicatorMetadata = IndicatorMetadata {
930    name: "Harami Cross",
931    description: "A harami where the second candle is a doji.",
932    usage: "A more reliable reversal signal than a standard harami.",
933    keywords: &["pattern", "candlestick", "classic"],
934    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
935    params: &[],
936    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
937    formula_latex: r#"
938\text{Pattern Recognition Logic (TA-Lib Internal)}
939"#,
940    gold_standard_file: "cdlharamicross.json",
941    category: "Patterns",
942};
943
944pub const CDLHIKKAKE_METADATA: IndicatorMetadata = IndicatorMetadata {
945    name: "Hikkake Pattern",
946    description: "A trap pattern used to identify false breakouts.",
947    usage: "Signals a move in the opposite direction of the trap.",
948    keywords: &["pattern", "candlestick", "classic"],
949    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
950    params: &[],
951    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
952    formula_latex: r#"
953\text{Pattern Recognition Logic (TA-Lib Internal)}
954"#,
955    gold_standard_file: "cdlhikkake.json",
956    category: "Patterns",
957};
958
959pub const CDLHIKKAKEMOD_METADATA: IndicatorMetadata = IndicatorMetadata {
960    name: "Modified Hikkake Pattern",
961    description: "A more conservative version of the Hikkake.",
962    usage: "Provides a higher probability signal.",
963    keywords: &["pattern", "candlestick", "classic"],
964    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
965    params: &[],
966    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
967    formula_latex: r#"
968\text{Pattern Recognition Logic (TA-Lib Internal)}
969"#,
970    gold_standard_file: "cdlhikkakemod.json",
971    category: "Patterns",
972};
973
974pub const CDLHOMINGPIGEON_METADATA: IndicatorMetadata = IndicatorMetadata {
975    name: "Homing Pigeon",
976    description: "A bullish reversal pattern in a downtrend.",
977    usage: "Signals a potential bottom.",
978    keywords: &["pattern", "candlestick", "classic"],
979    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
980    params: &[],
981    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
982    formula_latex: r#"
983\text{Pattern Recognition Logic (TA-Lib Internal)}
984"#,
985    gold_standard_file: "cdlhomingpigeon.json",
986    category: "Patterns",
987};
988
989pub const CDLIDENTICAL3CROWS_METADATA: IndicatorMetadata = IndicatorMetadata {
990    name: "Identical Three Crows",
991    description: "A bearish reversal pattern with three identical candles.",
992    usage: "Signals a very strong trend change.",
993    keywords: &["pattern", "candlestick", "classic"],
994    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
995    params: &[],
996    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
997    formula_latex: r#"
998\text{Pattern Recognition Logic (TA-Lib Internal)}
999"#,
1000    gold_standard_file: "cdlidentical3crows.json",
1001    category: "Patterns",
1002};
1003
1004pub const CDLINNECK_METADATA: IndicatorMetadata = IndicatorMetadata {
1005    name: "In-Neck Pattern",
1006    description: "A bearish continuation pattern.",
1007    usage: "Indicates that the downward move is not yet over.",
1008    keywords: &["pattern", "candlestick", "classic"],
1009    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1010    params: &[],
1011    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1012    formula_latex: r#"
1013\text{Pattern Recognition Logic (TA-Lib Internal)}
1014"#,
1015    gold_standard_file: "cdlinneck.json",
1016    category: "Patterns",
1017};
1018
1019pub const CDLINVERTEDHAMMER_METADATA: IndicatorMetadata = IndicatorMetadata {
1020    name: "Inverted Hammer",
1021    description: "A bullish reversal pattern at the bottom of a downtrend.",
1022    usage: "Signals a potential move to the upside.",
1023    keywords: &["pattern", "candlestick", "classic"],
1024    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1025    params: &[],
1026    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1027    formula_latex: r#"
1028\text{Pattern Recognition Logic (TA-Lib Internal)}
1029"#,
1030    gold_standard_file: "cdlinvertedhammer.json",
1031    category: "Patterns",
1032};
1033
1034pub const CDLKICKING_METADATA: IndicatorMetadata = IndicatorMetadata {
1035    name: "Kicking",
1036    description: "A two-candle reversal pattern involving a gap.",
1037    usage: "Signals a violent shift in market sentiment.",
1038    keywords: &["pattern", "candlestick", "classic"],
1039    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1040    params: &[],
1041    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1042    formula_latex: r#"
1043\text{Pattern Recognition Logic (TA-Lib Internal)}
1044"#,
1045    gold_standard_file: "cdlkicking.json",
1046    category: "Patterns",
1047};
1048
1049pub const CDLKICKINGBYLENGTH_METADATA: IndicatorMetadata = IndicatorMetadata {
1050    name: "Kicking - bull/bear determined by longer marubozu",
1051    description: "A variation of the kicking pattern.",
1052    usage: "Focuses on the relative strength of the marubozus.",
1053    keywords: &["pattern", "candlestick", "classic"],
1054    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1055    params: &[],
1056    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1057    formula_latex: r#"
1058\text{Pattern Recognition Logic (TA-Lib Internal)}
1059"#,
1060    gold_standard_file: "cdlkickingbylength.json",
1061    category: "Patterns",
1062};
1063
1064pub const CDLLADDERBOTTOM_METADATA: IndicatorMetadata = IndicatorMetadata {
1065    name: "Ladder Bottom",
1066    description: "A five-candle bullish reversal pattern.",
1067    usage: "Signals a major bottom after a steady decline.",
1068    keywords: &["pattern", "candlestick", "classic"],
1069    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1070    params: &[],
1071    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1072    formula_latex: r#"
1073\text{Pattern Recognition Logic (TA-Lib Internal)}
1074"#,
1075    gold_standard_file: "cdlladderbottom.json",
1076    category: "Patterns",
1077};
1078
1079pub const CDLMATCHINGLOW_METADATA: IndicatorMetadata = IndicatorMetadata {
1080    name: "Matching Low",
1081    description: "A bullish reversal pattern with two identical lows.",
1082    usage: "Signals support at a specific price level.",
1083    keywords: &["pattern", "candlestick", "classic"],
1084    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1085    params: &[],
1086    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1087    formula_latex: r#"
1088\text{Pattern Recognition Logic (TA-Lib Internal)}
1089"#,
1090    gold_standard_file: "cdlmatchinglow.json",
1091    category: "Patterns",
1092};
1093
1094pub const CDLMATHOLD_METADATA: IndicatorMetadata = IndicatorMetadata {
1095    name: "Mat Hold",
1096    description: "A bullish continuation pattern.",
1097    usage: "Signals a strong trend that is likely to persist.",
1098    keywords: &["pattern", "candlestick", "classic"],
1099    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1100    params: &[],
1101    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1102    formula_latex: r#"
1103\text{Pattern Recognition Logic (TA-Lib Internal)}
1104"#,
1105    gold_standard_file: "cdlmathold.json",
1106    category: "Patterns",
1107};
1108
1109pub const CDLMORNINGDOJISTAR_METADATA: IndicatorMetadata = IndicatorMetadata {
1110    name: "Morning Doji Star",
1111    description: "A bullish reversal pattern involving a doji.",
1112    usage: "A highly reliable signal of a market bottom.",
1113    keywords: &["pattern", "candlestick", "classic"],
1114    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1115    params: &[],
1116    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1117    formula_latex: r#"
1118\text{Pattern Recognition Logic (TA-Lib Internal)}
1119"#,
1120    gold_standard_file: "cdlmorningdojistar.json",
1121    category: "Patterns",
1122};
1123
1124pub const CDLMORNINGSTAR_METADATA: IndicatorMetadata = IndicatorMetadata {
1125    name: "Morning Star",
1126    description: "A bullish reversal pattern with three candles.",
1127    usage: "Signals a trough in a downtrend.",
1128    keywords: &["pattern", "candlestick", "classic"],
1129    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1130    params: &[],
1131    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1132    formula_latex: r#"
1133\text{Pattern Recognition Logic (TA-Lib Internal)}
1134"#,
1135    gold_standard_file: "cdlmorningstar.json",
1136    category: "Patterns",
1137};
1138
1139pub const CDLONNECK_METADATA: IndicatorMetadata = IndicatorMetadata {
1140    name: "On-Neck Pattern",
1141    description: "A bearish continuation pattern.",
1142    usage: "A weak signal that the downtrend will continue.",
1143    keywords: &["pattern", "candlestick", "classic"],
1144    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1145    params: &[],
1146    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1147    formula_latex: r#"
1148\text{Pattern Recognition Logic (TA-Lib Internal)}
1149"#,
1150    gold_standard_file: "cdlonneck.json",
1151    category: "Patterns",
1152};
1153
1154pub const CDLPIERCING_METADATA: IndicatorMetadata = IndicatorMetadata {
1155    name: "Piercing Pattern",
1156    description: "A bullish reversal pattern in a downtrend.",
1157    usage: "Indicates a significant entry of buyers.",
1158    keywords: &["pattern", "candlestick", "classic"],
1159    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1160    params: &[],
1161    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1162    formula_latex: r#"
1163\text{Pattern Recognition Logic (TA-Lib Internal)}
1164"#,
1165    gold_standard_file: "cdlpiercing.json",
1166    category: "Patterns",
1167};
1168
1169pub const CDLRISEFALL3METHODS_METADATA: IndicatorMetadata = IndicatorMetadata {
1170    name: "Rising/Falling Three Methods",
1171    description: "A strong continuation pattern.",
1172    usage: "Signals a minor consolidation before the trend resumes.",
1173    keywords: &["pattern", "candlestick", "classic"],
1174    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1175    params: &[],
1176    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1177    formula_latex: r#"
1178\text{Pattern Recognition Logic (TA-Lib Internal)}
1179"#,
1180    gold_standard_file: "cdlrisefall3methods.json",
1181    category: "Patterns",
1182};
1183
1184pub const CDLSEPARATINGLINES_METADATA: IndicatorMetadata = IndicatorMetadata {
1185    name: "Separating Lines",
1186    description: "A continuation pattern where candles move in opposite directions.",
1187    usage: "Signals trend persistence.",
1188    keywords: &["pattern", "candlestick", "classic"],
1189    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1190    params: &[],
1191    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1192    formula_latex: r#"
1193\text{Pattern Recognition Logic (TA-Lib Internal)}
1194"#,
1195    gold_standard_file: "cdlseparatinglines.json",
1196    category: "Patterns",
1197};
1198
1199pub const CDLSHOOTINGSTAR_METADATA: IndicatorMetadata = IndicatorMetadata {
1200    name: "Shooting Star",
1201    description: "A bearish reversal pattern at the top of an uptrend.",
1202    usage: "Signals a potential move to the downside.",
1203    keywords: &["pattern", "candlestick", "classic"],
1204    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1205    params: &[],
1206    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1207    formula_latex: r#"
1208\text{Pattern Recognition Logic (TA-Lib Internal)}
1209"#,
1210    gold_standard_file: "cdlshootingstar.json",
1211    category: "Patterns",
1212};
1213
1214pub const CDLSTALLEDPATTERN_METADATA: IndicatorMetadata = IndicatorMetadata {
1215    name: "Stalled Pattern",
1216    description: "A bearish reversal pattern in an uptrend.",
1217    usage: "Indicates that the upward momentum is slowing down.",
1218    keywords: &["pattern", "candlestick", "classic"],
1219    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1220    params: &[],
1221    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1222    formula_latex: r#"
1223\text{Pattern Recognition Logic (TA-Lib Internal)}
1224"#,
1225    gold_standard_file: "cdlstalledpattern.json",
1226    category: "Patterns",
1227};
1228
1229pub const CDLSTICKSANDWICH_METADATA: IndicatorMetadata = IndicatorMetadata {
1230    name: "Stick Sandwich",
1231    description: "A reversal pattern with alternating candle colors.",
1232    usage: "Signals a potential support or resistance level.",
1233    keywords: &["pattern", "candlestick", "classic"],
1234    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1235    params: &[],
1236    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1237    formula_latex: r#"
1238\text{Pattern Recognition Logic (TA-Lib Internal)}
1239"#,
1240    gold_standard_file: "cdlsticksandwich.json",
1241    category: "Patterns",
1242};
1243
1244pub const CDLTASUKIGAP_METADATA: IndicatorMetadata = IndicatorMetadata {
1245    name: "Tasuki Gap",
1246    description: "A continuation pattern involving a gap.",
1247    usage: "Signals trend strength.",
1248    keywords: &["pattern", "candlestick", "classic"],
1249    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1250    params: &[],
1251    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1252    formula_latex: r#"
1253\text{Pattern Recognition Logic (TA-Lib Internal)}
1254"#,
1255    gold_standard_file: "cdltasukigap.json",
1256    category: "Patterns",
1257};
1258
1259pub const CDLTHRUSTING_METADATA: IndicatorMetadata = IndicatorMetadata {
1260    name: "Thrusting Pattern",
1261    description: "A bearish continuation pattern.",
1262    usage: "A weak signal of trend persistence.",
1263    keywords: &["pattern", "candlestick", "classic"],
1264    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1265    params: &[],
1266    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1267    formula_latex: r#"
1268\text{Pattern Recognition Logic (TA-Lib Internal)}
1269"#,
1270    gold_standard_file: "cdlthrusting.json",
1271    category: "Patterns",
1272};
1273
1274pub const CDLTRISTAR_METADATA: IndicatorMetadata = IndicatorMetadata {
1275    name: "Tristar Pattern",
1276    description: "A rare reversal pattern consisting of three dojis.",
1277    usage: "Signals an extreme shift in momentum.",
1278    keywords: &["pattern", "candlestick", "classic"],
1279    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1280    params: &[],
1281    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1282    formula_latex: r#"
1283\text{Pattern Recognition Logic (TA-Lib Internal)}
1284"#,
1285    gold_standard_file: "cdltristar.json",
1286    category: "Patterns",
1287};
1288
1289pub const CDLUNIQUE3RIVER_METADATA: IndicatorMetadata = IndicatorMetadata {
1290    name: "Unique 3 River",
1291    description: "A bullish reversal pattern.",
1292    usage: "Signals a potential bottom.",
1293    keywords: &["pattern", "candlestick", "classic"],
1294    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1295    params: &[],
1296    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1297    formula_latex: r#"
1298\text{Pattern Recognition Logic (TA-Lib Internal)}
1299"#,
1300    gold_standard_file: "cdlunique3river.json",
1301    category: "Patterns",
1302};
1303
1304pub const CDLUPSIDEGAP2CROWS_METADATA: IndicatorMetadata = IndicatorMetadata {
1305    name: "Upside Gap Two Crows",
1306    description: "A bearish reversal pattern.",
1307    usage: "Signals a potential top in an uptrend.",
1308    keywords: &["pattern", "candlestick", "classic"],
1309    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1310    params: &[],
1311    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1312    formula_latex: r#"
1313\text{Pattern Recognition Logic (TA-Lib Internal)}
1314"#,
1315    gold_standard_file: "cdlupsidegap2crows.json",
1316    category: "Patterns",
1317};
1318
1319pub const CDLXSIDEGAP3METHODS_METADATA: IndicatorMetadata = IndicatorMetadata {
1320    name: "Up/Down-Gap Three Methods",
1321    description: "A continuation pattern.",
1322    usage: "Signals that the trend is likely to continue after a gap.",
1323    keywords: &["pattern", "candlestick", "classic"],
1324    ehlers_summary: "Candlestick patterns were popularized in the West by Steve Nison in his 1991 book 'Japanese Candlestick Charting Techniques'. These patterns provide a visual representation of market psychology and the balance of power between buyers and sellers at key price levels.",
1325    params: &[],
1326    formula_source: "https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp",
1327    formula_latex: r#"
1328\text{Pattern Recognition Logic (TA-Lib Internal)}
1329"#,
1330    gold_standard_file: "cdlxsidegap3methods.json",
1331    category: "Patterns",
1332};
1333