File size: 1,969 Bytes
805d268
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: mit
task_categories: [object-detection]
tags: [candlestick, finance, yolo, technical-analysis]
---

# Candlestick pattern detection dataset

640x640 renderings of 20-candle daily OHLC windows, with YOLO-format boxes for
8 candlestick patterns.

## Labels are rule-based, not human-verified

Every box was generated by TA-Lib's `CDLxxx` functions. Nobody annotated these
charts by hand. A model trained here learns to imitate TA-Lib's published
heuristic, which does not always agree with what a discretionary trader would
mark on the same chart. Treat the labels as a reproducible rule, not as truth.

## Splits are chronological, with an embargo

| split | period |
|---|---|
| train | through 2014-12-31 |
| val | 2014-12-31 to 2018-12-31 |
| test | after 2018-12-31 |

Consecutive windows overlap in 19 of 20 candles, so the first
20 windows after each boundary are discarded. Val and test
images therefore share no candle with any training image. Splits are never
random.

## Contents

| class | train | val | test |
|---|---|---|---|
| Hammer | 4798 | 475 | 557 |
| ShootingStar | 2825 | 360 | 570 |
| BullishEngulfing | 8553 | 457 | 1178 |
| BearishEngulfing | 10583 | 673 | 1368 |
| MorningStar | 1354 | 126 | 198 |
| EveningStar | 1106 | 144 | 180 |
| Doji | 32322 | 2957 | 5261 |
| Harami | 20443 | 1696 | 2350 |
| **images** | 12151 | 986 | 1917 |

`train` also contains auxiliary large-cap tickers
(AAPL, MSFT, JPM, XOM, JNJ, KO, GE, WMT, PG, T), included solely to give the rare
three-candle patterns enough examples. `val` and `test` are
SPY-only, so held-out metrics describe the instrument the downstream
study actually uses.

## Layout

```
images/{train,val,test}/TICKER_YYYYMMDD.png
labels/{train,val,test}/TICKER_YYYYMMDD.txt
```

A filename's date is the window's **last** candle: the chart contains bars up to
and including that date and nothing after it.

Code: https://github.com/rohanjain2312/candlestick-pattern-recognition-system