Candlestick
Ordered open-high-low-close observations with conventional increase and decrease treatments.
- Purpose
- Compare open, high, low, and close values across ordered periods.
- Use when
- Use for financial or similarly structured ranges where intraperiod movement matters.
- Avoid when
- Avoid for a single value per period or when a simple trend line communicates the question more directly.
- Equivalent data
- The adjacent disclosure states increase or decrease in text and preserves exact OHLC and trend values, so meaning never depends on candle color.
Exact OHLC values
Increase means close is greater than or equal to open; decrease means close is below open. Detected patterns are named in text and do not depend on color.
| Period | Direction | Open | High | Low | Close |
|---|---|---|---|---|---|
| Day 1 | Increase | 100 | 110 | 95 | 105 |
| Day 2 | Increase | 105 | 115 | 100 | 112 |
| Day 3 | Increase | 112 | 118 | 108 | 115 |
| Day 4 | Decrease | 115 | 120 | 104 | 108 |
| Day 5 | Increase | 108 | 113 | 105 | 109 |
| Day 6 | Increase | 109 | 116 | 106 | 114 |
| Day 7 | Increase | 114 | 121 | 111 | 119 |
@candlestick.Candlestick(candlestick.Config{
Label: "Seven-day stock price",
Title: "Candlestick Chart",
SeriesName: "Stock Price",
Data: []candlestick.Datum{
{Label: "Day 1", Open: 100, High: 110, Low: 95, Close: 105},
{Label: "Day 2", Open: 105, High: 115, Low: 100, Close: 112},
{Label: "Day 3", Open: 112, High: 118, Low: 108, Close: 115},
{Label: "Day 4", Open: 115, High: 120, Low: 104, Close: 108},
{Label: "Day 5", Open: 108, High: 113, Low: 105, Close: 109},
{Label: "Day 6", Open: 109, High: 116, Low: 106, Close: 114},
{Label: "Day 7", Open: 114, High: 121, Low: 111, Close: 119},
},
})Extended basic series
The second upstream construction style adds an eighth daily candle, larger title text, explicit padding, and 800x600 geometry. It remains the same typed component rather than exposing construction functions.
Exact OHLC values
Increase means close is greater than or equal to open; decrease means close is below open. Detected patterns are named in text and do not depend on color.
| Period | Direction | Open | High | Low | Close |
|---|---|---|---|---|---|
| Day 1 | Increase | 100 | 110 | 95 | 105 |
| Day 2 | Increase | 105 | 115 | 100 | 112 |
| Day 3 | Increase | 112 | 118 | 108 | 115 |
| Day 4 | Decrease | 115 | 120 | 104 | 108 |
| Day 5 | Increase | 108 | 113 | 105 | 109 |
| Day 6 | Increase | 109 | 116 | 106 | 114 |
| Day 7 | Increase | 114 | 121 | 111 | 119 |
| Day 8 | Increase | 119 | 125 | 116 | 122 |
cfg := sampleBasicCandlestick()
cfg.Label = "Eight-day stock price"
cfg.Data = append(cfg.Data,
candlestick.Datum{Label: "Day 8", Open: 119, High: 125, Low: 116, Close: 122},
)
cfg.Options = candlestick.Options{
TitleFontSize: 18,
YUnit: 1,
Padding: candlestick.Padding{Top: 20, Right: 20, Bottom: 20, Left: 20},
}
cfg.Width, cfg.Height = 800, 600
@candlestick.Candlestick(cfg)Multiple aligned series
The pinned upstream comparison keeps three named OHLC populations together and demonstrates filled, traditional, and outline bodies. Exact tables separate each series.
Exact OHLC values for all series
Increase means close is greater than or equal to open; decrease means close is below open. Detected patterns are named in text and do not depend on color.
Stock A observations (Filled bodies)
| Period | Direction | Open | High | Low | Close |
|---|---|---|---|---|---|
| Day 1 | Increase | 100 | 110 | 95 | 105 |
| Day 2 | Increase | 105 | 115 | 100 | 112 |
| Day 3 | Increase | 112 | 118 | 108 | 115 |
| Day 4 | Decrease | 115 | 120 | 104 | 108 |
| Day 5 | Increase | 108 | 113 | 105 | 109 |
Stock B observations (Traditional bodies)
| Period | Direction | Open | High | Low | Close |
|---|---|---|---|---|---|
| Day 1 | Increase | 150 | 160 | 145 | 155 |
| Day 2 | Increase | 155 | 165 | 150 | 162 |
| Day 3 | Increase | 162 | 168 | 158 | 165 |
| Day 4 | Decrease | 165 | 170 | 154 | 158 |
| Day 5 | Increase | 158 | 163 | 155 | 159 |
Stock C observations (Outline bodies)
| Period | Direction | Open | High | Low | Close |
|---|---|---|---|---|---|
| Day 1 | Increase | 200 | 210 | 195 | 205 |
| Day 2 | Increase | 205 | 215 | 200 | 212 |
| Day 3 | Increase | 212 | 218 | 208 | 215 |
| Day 4 | Decrease | 215 | 220 | 204 | 208 |
| Day 5 | Increase | 208 | 213 | 205 | 209 |
@candlestick.Candlestick(candlestick.Config{
Label: "Three aligned stock series",
Series: []candlestick.Series{
{Name: "Stock A", Data: stockA, BodyStyle: candlestick.BodyStyleFilled},
{Name: "Stock B", Data: stockB, BodyStyle: candlestick.BodyStyleTraditional},
{Name: "Stock C", Data: stockC, BodyStyle: candlestick.BodyStyleOutline},
},
Options: candlestick.Options{
YUnit: 1,
Padding: candlestick.Padding{Top: 20, Right: 20, Bottom: 20, Left: 20},
},
Width: 1000, Height: 700,
})Candle geometry and wicks
Typed width, spacing, wick thickness, chart-level visibility, and per-series visibility options preserve automatic defaults while allowing compact or emphasis treatments.
Exact OHLC values for all series
Increase means close is greater than or equal to open; decrease means close is below open. Detected patterns are named in text and do not depend on color.
Stock A observations (Filled bodies)
| Period | Direction | Open | High | Low | Close |
|---|---|---|---|---|---|
| Day 1 | Increase | 100 | 110 | 95 | 105 |
| Day 2 | Increase | 105 | 115 | 100 | 112 |
| Day 3 | Increase | 112 | 118 | 108 | 115 |
| Day 4 | Decrease | 115 | 120 | 104 | 108 |
| Day 5 | Increase | 108 | 113 | 105 | 109 |
Stock B observations (Traditional bodies)
| Period | Direction | Open | High | Low | Close |
|---|---|---|---|---|---|
| Day 1 | Increase | 150 | 160 | 145 | 155 |
| Day 2 | Increase | 155 | 165 | 150 | 162 |
| Day 3 | Increase | 162 | 168 | 158 | 165 |
| Day 4 | Decrease | 165 | 170 | 154 | 158 |
| Day 5 | Increase | 158 | 163 | 155 | 159 |
Stock C observations (Outline bodies)
| Period | Direction | Open | High | Low | Close |
|---|---|---|---|---|---|
| Day 1 | Increase | 200 | 210 | 195 | 205 |
| Day 2 | Increase | 205 | 215 | 200 | 212 |
| Day 3 | Increase | 212 | 218 | 208 | 215 |
| Day 4 | Decrease | 215 | 220 | 204 | 208 |
| Day 5 | Increase | 208 | 213 | 205 | 209 |
showWicks, hideWicks, seriesGap := true, false, 0.08
cfg := sampleCandlestickMultipleSeries()
cfg.Options.Geometry = candlestick.Geometry{
CandleWidth: 0.58,
WickWidth: 2,
SeriesGap: &seriesGap,
ShowWicks: &showWicks,
}
cfg.Series[2].ShowWicks = &hideWicks
@candlestick.Candlestick(cfg)Aggregation
Compare the original ordered candles with fixed-size OHLC windows. The first open, highest high, lowest low, and final close define each aggregated candle.
Exact source and aggregated OHLC values
Increase means close is greater than or equal to open; decrease means close is below open. Detected patterns are named in text and do not depend on color.
Source observations
| Period | Direction | Open | High | Low | Close |
|---|---|---|---|---|---|
| 1 | Increase | 100 | 102 | 99 | 101 |
| 2 | Increase | 101 | 103 | 100 | 102 |
| 3 | Increase | 102 | 105 | 101 | 104 |
| 4 | Increase | 104 | 106 | 103 | 105 |
| 5 | Increase | 105 | 107 | 104 | 106 |
| 6 | Increase | 106 | 108 | 105 | 107 |
| 7 | Increase | 107 | 109 | 106 | 108 |
| 8 | Increase | 108 | 110 | 107 | 109 |
| 9 | Increase | 109 | 111 | 108 | 110 |
| 10 | Increase | 110 | 112 | 109 | 111 |
| 11 | Increase | 111 | 113 | 110 | 112 |
| 12 | Increase | 112 | 114 | 111 | 113 |
| 13 | Increase | 113 | 115 | 112 | 114 |
| 14 | Increase | 114 | 116 | 113 | 115 |
| 15 | Increase | 115 | 117 | 114 | 116 |
Aggregated observations
| Period | Direction | Open | High | Low | Close |
|---|---|---|---|---|---|
| 1-5 | Increase | 100 | 107 | 99 | 106 |
| 6-10 | Increase | 106 | 112 | 105 | 111 |
| 11-15 | Increase | 111 | 117 | 110 | 116 |
@candlestick.Candlestick(candlestick.Config{
Label: "Candlestick aggregation",
Title: "1-Minute Candles (Before Aggregation)",
SeriesName: "1-Minute",
Data: []candlestick.Datum{
{Label: "1", Open: 100, High: 102, Low: 99, Close: 101},
{Label: "2", Open: 101, High: 103, Low: 100, Close: 102},
{Label: "3", Open: 102, High: 105, Low: 101, Close: 104},
{Label: "4", Open: 104, High: 106, Low: 103, Close: 105},
{Label: "5", Open: 105, High: 107, Low: 104, Close: 106},
{Label: "6", Open: 106, High: 108, Low: 105, Close: 107},
{Label: "7", Open: 107, High: 109, Low: 106, Close: 108},
{Label: "8", Open: 108, High: 110, Low: 107, Close: 109},
{Label: "9", Open: 109, High: 111, Low: 108, Close: 110},
{Label: "10", Open: 110, High: 112, Low: 109, Close: 111},
{Label: "11", Open: 111, High: 113, Low: 110, Close: 112},
{Label: "12", Open: 112, High: 114, Low: 111, Close: 113},
{Label: "13", Open: 113, High: 115, Low: 112, Close: 114},
{Label: "14", Open: 114, High: 116, Low: 113, Close: 115},
{Label: "15", Open: 115, High: 117, Low: 114, Close: 116},
},
Aggregation: candlestick.AggregationOptions{
WindowSize: 5,
Title: "5-Minute Aggregated Candles",
SeriesName: "5-Minute",
},
Options: candlestick.Options{
TitleFontSize: 16,
YUnit: 1,
Padding: candlestick.Padding{Top: 20, Right: 20, Bottom: 20, Left: 20},
},
Width: 1200,
Height: 800,
})Bollinger Bands
Twenty OHLC observations with period-five upper, middle, and lower close-price trends. Distinct accessible theme tokens adapt across Goshtoso and AraiHu light and dark modes.
Exact OHLC values
Increase means close is greater than or equal to open; decrease means close is below open. Detected patterns are named in text and do not depend on color.
| Period | Direction | Open | High | Low | Close | Bollinger upper | SMA middle | Bollinger lower |
|---|---|---|---|---|---|---|---|---|
| 1 | Increase | 100 | 110 | 95 | 105 | 119.046537 | 110.666667 | 102.286797 |
| 2 | Increase | 105 | 115 | 100 | 112 | 123.862780 | 113.000000 | 102.137220 |
| 3 | Increase | 112 | 118 | 108 | 115 | 129.058697 | 115.400000 | 101.741303 |
| 4 | Increase | 115 | 125 | 110 | 120 | 133.459862 | 120.400000 | 107.340138 |
| 5 | Increase | 120 | 130 | 115 | 125 | 139.142136 | 125.000000 | 110.857864 |
| 6 | Increase | 125 | 135 | 120 | 130 | 144.142136 | 130.000000 | 115.857864 |
| 7 | Increase | 130 | 140 | 125 | 135 | 149.142136 | 135.000000 | 120.857864 |
| 8 | Increase | 135 | 145 | 130 | 140 | 154.142136 | 140.000000 | 125.857864 |
| 9 | Increase | 140 | 150 | 135 | 145 | 154.525200 | 143.600000 | 132.674800 |
| 10 | Increase | 145 | 155 | 140 | 150 | 152.540920 | 145.800000 | 139.059080 |
| 11 | Decrease | 150 | 160 | 145 | 148 | 150.908132 | 146.600000 | 142.291868 |
| 12 | Decrease | 148 | 153 | 143 | 146 | 151.656854 | 146.000000 | 140.343146 |
| 13 | Decrease | 146 | 151 | 141 | 144 | 149.656854 | 144.000000 | 138.343146 |
| 14 | Decrease | 144 | 149 | 139 | 142 | 147.656854 | 142.000000 | 136.343146 |
| 15 | Decrease | 142 | 147 | 137 | 140 | 145.656854 | 140.000000 | 134.343146 |
| 16 | Decrease | 140 | 145 | 135 | 138 | 143.656854 | 138.000000 | 132.343146 |
| 17 | Decrease | 138 | 143 | 133 | 136 | 141.656854 | 136.000000 | 130.343146 |
| 18 | Decrease | 136 | 141 | 131 | 134 | 139.656854 | 134.000000 | 128.343146 |
| 19 | Decrease | 134 | 139 | 129 | 132 | 137.472136 | 133.000000 | 128.527864 |
| 20 | Decrease | 132 | 137 | 127 | 130 | 135.265986 | 132.000000 | 128.734014 |
@candlestick.Candlestick(candlestick.Config{
Label: "Candlestick Chart with Bollinger Bands",
Title: "Candlestick Chart with Bollinger Bands",
SeriesName: "Price",
Data: []candlestick.Datum{
{Label: "1", Open: 100, High: 110, Low: 95, Close: 105},
{Label: "2", Open: 105, High: 115, Low: 100, Close: 112},
{Label: "3", Open: 112, High: 118, Low: 108, Close: 115},
{Label: "4", Open: 115, High: 125, Low: 110, Close: 120},
{Label: "5", Open: 120, High: 130, Low: 115, Close: 125},
{Label: "6", Open: 125, High: 135, Low: 120, Close: 130},
{Label: "7", Open: 130, High: 140, Low: 125, Close: 135},
{Label: "8", Open: 135, High: 145, Low: 130, Close: 140},
{Label: "9", Open: 140, High: 150, Low: 135, Close: 145},
{Label: "10", Open: 145, High: 155, Low: 140, Close: 150},
{Label: "11", Open: 150, High: 160, Low: 145, Close: 148},
{Label: "12", Open: 148, High: 153, Low: 143, Close: 146},
{Label: "13", Open: 146, High: 151, Low: 141, Close: 144},
{Label: "14", Open: 144, High: 149, Low: 139, Close: 142},
{Label: "15", Open: 142, High: 147, Low: 137, Close: 140},
{Label: "16", Open: 140, High: 145, Low: 135, Close: 138},
{Label: "17", Open: 138, High: 143, Low: 133, Close: 136},
{Label: "18", Open: 136, High: 141, Low: 131, Close: 134},
{Label: "19", Open: 134, High: 139, Low: 129, Close: 132},
{Label: "20", Open: 132, High: 137, Low: 127, Close: 130},
},
TrendLines: []candlestick.TrendLine{
{Type: candlestick.TrendTypeBollingerUpper, Period: 5},
{Type: candlestick.TrendTypeSimpleMovingAverage, Period: 5},
{Type: candlestick.TrendTypeBollingerLower, Period: 5},
},
Options: candlestick.Options{
TitleFontSize: 18,
YUnit: 1,
Padding: candlestick.Padding{Top: 20, Right: 20, Bottom: 20, Left: 20},
},
Width: 800,
Height: 600,
})Presentation overrides
Caller colors or classes may style candle directions and individual trend lines; each mark accepts one override mechanism at a time.
Exact OHLC values
Increase means close is greater than or equal to open; decrease means close is below open. Detected patterns are named in text and do not depend on color.
| Period | Direction | Open | High | Low | Close | Bollinger upper | SMA middle | Bollinger lower |
|---|---|---|---|---|---|---|---|---|
| 1 | Increase | 100 | 110 | 95 | 105 | 119.046537 | 110.666667 | 102.286797 |
| 2 | Increase | 105 | 115 | 100 | 112 | 123.862780 | 113.000000 | 102.137220 |
| 3 | Increase | 112 | 118 | 108 | 115 | 129.058697 | 115.400000 | 101.741303 |
| 4 | Increase | 115 | 125 | 110 | 120 | 133.459862 | 120.400000 | 107.340138 |
| 5 | Increase | 120 | 130 | 115 | 125 | 139.142136 | 125.000000 | 110.857864 |
| 6 | Increase | 125 | 135 | 120 | 130 | 144.142136 | 130.000000 | 115.857864 |
| 7 | Increase | 130 | 140 | 125 | 135 | 149.142136 | 135.000000 | 120.857864 |
| 8 | Increase | 135 | 145 | 130 | 140 | 154.142136 | 140.000000 | 125.857864 |
| 9 | Increase | 140 | 150 | 135 | 145 | 154.525200 | 143.600000 | 132.674800 |
| 10 | Increase | 145 | 155 | 140 | 150 | 152.540920 | 145.800000 | 139.059080 |
| 11 | Decrease | 150 | 160 | 145 | 148 | 150.908132 | 146.600000 | 142.291868 |
| 12 | Decrease | 148 | 153 | 143 | 146 | 151.656854 | 146.000000 | 140.343146 |
| 13 | Decrease | 146 | 151 | 141 | 144 | 149.656854 | 144.000000 | 138.343146 |
| 14 | Decrease | 144 | 149 | 139 | 142 | 147.656854 | 142.000000 | 136.343146 |
| 15 | Decrease | 142 | 147 | 137 | 140 | 145.656854 | 140.000000 | 134.343146 |
| 16 | Decrease | 140 | 145 | 135 | 138 | 143.656854 | 138.000000 | 132.343146 |
| 17 | Decrease | 138 | 143 | 133 | 136 | 141.656854 | 136.000000 | 130.343146 |
| 18 | Decrease | 136 | 141 | 131 | 134 | 139.656854 | 134.000000 | 128.343146 |
| 19 | Decrease | 134 | 139 | 129 | 132 | 137.472136 | 133.000000 | 128.527864 |
| 20 | Decrease | 132 | 137 | 127 | 130 | 135.265986 | 132.000000 | 128.734014 |
cfg := sampleCandlestickBollingerBands()
cfg.Options.Increasing.Color = "#14532d"
cfg.Options.Decreasing.Class = "caller-decreasing-candles"
cfg.TrendLines[0].Color = "#1d4ed8"
cfg.TrendLines[1].Class = "caller-middle-band"
@candlestick.Candlestick(cfg)Pattern annotations
Show all, core, or bullish patterns while the adjacent table names every detection.
Exact OHLC values
Increase means close is greater than or equal to open; decrease means close is below open. Detected patterns are named in text and do not depend on color.
| Period | Direction | Open | High | Low | Close | Detected patterns |
|---|---|---|---|---|---|---|
| 1 | Increase | 100 | 110 | 95 | 105 | |
| 2 | Increase | 105 | 108 | 102 | 105.1 | Doji |
| 3 | Decrease | 108 | 109 | 98 | 107 | Hammer |
| 4 | Decrease | 107 | 108 | 103 | 104 | |
| 5 | Increase | 102 | 115 | 101 | 113 | Bullish Engulfing |
| 6 | Increase | 113 | 125 | 112 | 114 | Shooting Star, Inverted Hammer |
| 7 | Increase | 114 | 118 | 113 | 117 | |
| 8 | Decrease | 119 | 120 | 108 | 110 | Bearish Engulfing |
| 9 | Decrease | 110 | 113 | 107 | 109.9 | Doji |
| 10 | Increase | 109 | 118 | 108 | 116 | Bullish Engulfing |
@candlestick.Candlestick(candlestick.Config{
Label: "Candlestick patterns",
Title: "Candlestick Patterns",
SeriesName: "Stock Price with Patterns",
Data: []candlestick.Datum{
{Label: "1", Open: 100, High: 110, Low: 95, Close: 105},
{Label: "2", Open: 105, High: 108, Low: 102, Close: 105.1},
{Label: "3", Open: 108, High: 109, Low: 98, Close: 107},
{Label: "4", Open: 107, High: 108, Low: 103, Close: 104},
{Label: "5", Open: 102, High: 115, Low: 101, Close: 113},
{Label: "6", Open: 113, High: 125, Low: 112, Close: 114},
{Label: "7", Open: 114, High: 118, Low: 113, Close: 117},
{Label: "8", Open: 119, High: 120, Low: 108, Close: 110},
{Label: "9", Open: 110, High: 113, Low: 107, Close: 109.9},
{Label: "10", Open: 109, High: 118, Low: 108, Close: 116},
},
Patterns: candlestick.PatternOptions{
Selection: candlestick.PatternSelectionAll,
References: []candlestick.CloseReferenceType{
candlestick.CloseReferenceAverage,
candlestick.CloseReferenceMinimum,
},
},
Options: candlestick.Options{TitleFontSize: 16, YUnit: 1, Padding: candlestick.Padding{Top: 20, Right: 20, Bottom: 20, Left: 20}},
Width: 900, Height: 650,
})Core, bullish, and label variants
Core and bullish selections use the same ten observations, making differences in highlighted patterns easy to compare.
Exact OHLC values
Increase means close is greater than or equal to open; decrease means close is below open. Detected patterns are named in text and do not depend on color.
| Period | Direction | Open | High | Low | Close | Detected patterns |
|---|---|---|---|---|---|---|
| 1 | Increase | 100 | 110 | 95 | 105 | |
| 2 | Increase | 105 | 108 | 102 | 105.1 | |
| 3 | Decrease | 108 | 109 | 98 | 107 | Hammer |
| 4 | Decrease | 107 | 108 | 103 | 104 | |
| 5 | Increase | 102 | 115 | 101 | 113 | Bullish Engulfing |
| 6 | Increase | 113 | 125 | 112 | 114 | Shooting Star |
| 7 | Increase | 114 | 118 | 113 | 117 | |
| 8 | Decrease | 119 | 120 | 108 | 110 | Bearish Engulfing |
| 9 | Decrease | 110 | 113 | 107 | 109.9 | |
| 10 | Increase | 109 | 118 | 108 | 116 | Bullish Engulfing |
cfg.Patterns.Selection = candlestick.PatternSelectionCore
// Other groups: Bullish, Bearish, Reversal, or Trend.
// Enabled selects an explicit ordered subset instead of a group.
cfg.Patterns.DojiThreshold = 0.05
cfg.Patterns.ShadowTolerance = 0.01
cfg.Patterns.ShadowRatio = 2
cfg.Patterns.EngulfingMinSize = 1
cfg.Patterns.PreferLabels = true
cfg.Patterns.Label = candlestick.PatternLabelStyle{
Text: candlestick.PatternLabelTextNameWithCount,
Color: "#ffffff", BackgroundColor: "#1d4ed8", FontSize: 8, CornerRadius: 2,
}
@candlestick.Candlestick(cfg)Preferred pattern labels
A selected pattern label can show its first name and count with explicit text and background colors.
Exact OHLC values
Increase means close is greater than or equal to open; decrease means close is below open. Detected patterns are named in text and do not depend on color.
| Period | Direction | Open | High | Low | Close | Detected patterns |
|---|---|---|---|---|---|---|
| 1 | Increase | 100 | 110 | 95 | 105 | |
| 2 | Increase | 105 | 108 | 102 | 105.1 | Doji |
| 3 | Decrease | 108 | 109 | 98 | 107 | Hammer |
| 4 | Decrease | 107 | 108 | 103 | 104 | |
| 5 | Increase | 102 | 115 | 101 | 113 | Bullish Engulfing |
| 6 | Increase | 113 | 125 | 112 | 114 | Shooting Star, Inverted Hammer |
| 7 | Increase | 114 | 118 | 113 | 117 | |
| 8 | Decrease | 119 | 120 | 108 | 110 | Bearish Engulfing |
| 9 | Decrease | 110 | 113 | 107 | 109.9 | Doji |
| 10 | Increase | 109 | 118 | 108 | 116 | Bullish Engulfing |
cfg.Patterns.Selection = candlestick.PatternSelectionCore
// Other groups: Bullish, Bearish, Reversal, or Trend.
// Enabled selects an explicit ordered subset instead of a group.
cfg.Patterns.DojiThreshold = 0.05
cfg.Patterns.ShadowTolerance = 0.01
cfg.Patterns.ShadowRatio = 2
cfg.Patterns.EngulfingMinSize = 1
cfg.Patterns.PreferLabels = true
cfg.Patterns.Label = candlestick.PatternLabelStyle{
Text: candlestick.PatternLabelTextNameWithCount,
Color: "#ffffff", BackgroundColor: "#1d4ed8", FontSize: 8, CornerRadius: 2,
}
@candlestick.Candlestick(cfg)Bullish patterns
Bullish-only selection keeps only the bullish pattern vocabulary while preserving source order and exact values.
Exact OHLC values
Increase means close is greater than or equal to open; decrease means close is below open. Detected patterns are named in text and do not depend on color.
| Period | Direction | Open | High | Low | Close | Detected patterns |
|---|---|---|---|---|---|---|
| 1 | Increase | 100 | 110 | 95 | 105 | |
| 2 | Increase | 105 | 108 | 102 | 105.1 | |
| 3 | Decrease | 108 | 109 | 98 | 107 | Hammer |
| 4 | Decrease | 107 | 108 | 103 | 104 | |
| 5 | Increase | 102 | 115 | 101 | 113 | Bullish Engulfing |
| 6 | Increase | 113 | 125 | 112 | 114 | Inverted Hammer |
| 7 | Increase | 114 | 118 | 113 | 117 | |
| 8 | Decrease | 119 | 120 | 108 | 110 | |
| 9 | Decrease | 110 | 113 | 107 | 109.9 | |
| 10 | Increase | 109 | 118 | 108 | 116 | Bullish Engulfing |
cfg.Patterns.Selection = candlestick.PatternSelectionCore
// Other groups: Bullish, Bearish, Reversal, or Trend.
// Enabled selects an explicit ordered subset instead of a group.
cfg.Patterns.DojiThreshold = 0.05
cfg.Patterns.ShadowTolerance = 0.01
cfg.Patterns.ShadowRatio = 2
cfg.Patterns.EngulfingMinSize = 1
cfg.Patterns.PreferLabels = true
cfg.Patterns.Label = candlestick.PatternLabelStyle{
Text: candlestick.PatternLabelTextNameWithCount,
Color: "#ffffff", BackgroundColor: "#1d4ed8", FontSize: 8, CornerRadius: 2,
}
@candlestick.Candlestick(cfg)Static/vector behavior
Candlestick renders inline SVG on the server, follows Goshtoso and AraiHu tokens in light and dark mode, remains useful in print or without JavaScript, and provides resolved SVG plus opaque or transparent PNG download through the shared wrapper. Use the exact tables for comparisons that cannot be judged from geometry; shared chart controls and chart modes guides document lifecycle and delivery choices.
Go API
v0.0.1The examples above cover behavior and composition. pkg.go.dev is the canonical reference for exported types, functions, methods, and Go documentation.
github.com/araihu/goshtoso-charts/components/candlestickEnabled, disabled, hidden, and omitted wrapper behavior, controls, export, and client transitions are shared by every chart. Review chart controls, then compare static/vector and interactive capabilities.