Japanese Candlestick Chart
Overview
A Japanese candlestick chart is a combination of a line and bar chart used to describe price movements of an equity over time, where each bar represents the range of price movement over a given time interval. It is mostly used in technical analysis of equity and currency price patterns.
Candlesticks consist of the body (black or white) and an upper and a lower shadow (wick). The wick illustrates the highest and lowest traded prices of a stock, and the body represents the opening and closing trades. If the stock went up, the body is white, with the opening price at the bottom of the body and the closing price at the top. If the stock went down, the body is black, with the opening price at the top and the closing price at the bottom. It is not necessary for a candlestick to have either a body or a wick.
Some traders find candlestick charts easier to read than OHLC charts.
Japanese Candlestick is a series type that is predominantly used for demonstrating the stock market data, due to its specifics. So AnyChart Japanese Candlestick series are also available in AnyStock – see the Japanese Candlestick series in AnyStock article to learn more.
This article explains how to create a basic Japanese Candlestick chart as as well as configure settings that are specific to the type. See the table below to get a brief overview of the Japanese Candlestick chart's characteristics:
API | |
---|---|
Class | anychart.core.cartesian.series.Candlestick |
DATA | |
Data Fields | x, open, high, low, close |
Multiple Series | YES |
OPTIONS | |
Stacked | N/A |
Vertical | Vertical Japanese Candlestick |
3D | N/A |
Error Bars | N/A |
SUPPORTED CHART PLOTS | |
Polar | N/A |
Radar | N/A |
Scatter | N/A |
Stock | Stock Japanese Candlestick |
RELATED TYPES | |
OHLC | |
HiLo | |
SEE ALSO | |
Chartopedia: Japanese Candlestick Chart | |
General Settings |
Quick Start
To create a Japanese Candlestick chart, use the anychart.financial() chart constructor. If you pass the data to this chart constructor, it creates a Candlestick series.
To create a Candlestick series explicitly, call the candlestick() method.
The following sample demonstrates how a basic single-series Japanese Candlestick chart is created:
// create a data set
var data = anychart.data.set([
[Date.UTC(2007, 07, 23), 23.55, 23.88, 23.38, 23.62],
[Date.UTC(2007, 07, 24), 22.65, 23.7, 22.65, 23.36],
[Date.UTC(2007, 07, 25), 22.75, 23.7, 22.69, 23.44],
[Date.UTC(2007, 07, 26), 23.2, 23.39, 22.87, 22.92],
[Date.UTC(2007, 07, 27), 23.98, 24.49, 23.47, 23.49],
[Date.UTC(2007, 07, 30), 23.55, 23.88, 23.38, 23.62],
[Date.UTC(2007, 07, 31), 23.88, 23.93, 23.24, 23.25],
[Date.UTC(2007, 08, 01), 23.17, 23.4, 22.85, 23.25],
[Date.UTC(2007, 08, 02), 22.65, 23.7, 22.65, 23.36],
[Date.UTC(2007, 08, 03), 23.2, 23.39, 22.87, 22.92],
[Date.UTC(2007, 08, 06), 23.03, 23.15, 22.44, 22.97],
[Date.UTC(2007, 08, 07), 22.75, 23.7, 22.69, 23.44]
]);
// create a chart
chart = anychart.financial();
// map the data
var seriesData = data.mapAs({x: [0], open: [1], high: [2], low: [3], close: [4]});
// create a japanese candlestick series and set the data
var series = chart.candlestick(seriesData);
// set the container id
chart.container("container");
// initiate drawing the chart
chart.draw();
General Settings
In AnyChart there are many settings that are configured in the same way for all chart types, including the Area chart (for example, legend and interactivity settings).
Read the overview of general settings: General Settings.
Special Settings
Appearance
You can set the stroke, fill, and hatch fill of falling and rising candlesticks. Use the following methods:
To configure these settings on hover, use:
- hoverFallingStroke(), hoverFallingFill(), hoverFallingHatchFill()
- hoverRisingStroke(), hoverRisingFill(), hoverRisingHatchFill()
To configure these settings on select, use:
- selectFallingStroke(), selectFallingFill(), selectFallingHatchFill()
- selectRisingStroke(), selectRisingFill(), selectRisingHatchFill()
You can learn more from the Appearance Settings section.
In the sample below, there are two Japanese Candlestick series with some of the appearance settings configured:
// configure the visual settings of the first series
series1.risingStroke("#0066cc");
series1.risingFill("#0066cc", 0.3);
series1.hoverRisingStroke("#0066cc", 2);
series1.hoverRisingFill("#0066cc", 0.1);
series1.selectRisingStroke("#0066cc", 4);
series1.selectRisingFill("#0066cc", 0.5);
series1.fallingStroke("#00cc99", 1, "10 5", "round");
series1.fallingFill("#00cc99", 0.3);
series1.hoverFallingStroke("#00cc99", 2, "10 5", "round");
series1.hoverFallingFill("#00cc99", 0.1);
series1.selectFallingStroke("#00cc99", 4, "10 5", "round");
series1.selectFallingFill("#00cc99", 0.5);
// configure the visual settings of the second series
series2.fallingHatchFill("forwardDiagonal");
series2.risingHatchFill("backwardDiagonal");
series2.hoverFallingHatchFill("diagonalCross");
series2.hoverRisingHatchFill("diagonalCross");
series2.selectFallingHatchFill("percent20");
series2.selectRisingHatchFill("percent20");
Labels
Labels are text or image elements that can be placed anywhere on any chart (they can be enabled on a whole series or for a single point). For text labels, font settings and text formatters are available.
Tooltips
A Tooltip is a text box displayed when a point on a chart is hovered. There is a number of visual and other settings available: for example, you can edit the text by using font settings and text formatters, change the style of background, adjust the position of a tooltip, and so on.
Candlestick Patterns
In technical analysis, a candlestick pattern is a movement in prices shown graphically on a candlestick chart. Some believe that it can predict a particular market movement. The recognition of the pattern is subjective, and charting programs have to rely on predefined rules to match the pattern. There are 42 recognized patterns, which can be divided into two groups: simple and complex.
Here are the most popular simple patterns, shown in the sample below:
Pattern | Description |
---|---|
White | The close price is lower than the open price, and both are lower that the high price and upper than the low price. The difference between the values is not significant. |
Black | The open price is lower than the close price, and both are lower that the high price and upper than the low price. The difference between the values is not significant. |
Long lower shadow | The close price is lower than the open price, and both are lower that the high price and upper than the low price, wherein the difference between the low price and the body is quite higher than between the high price and the body. |
Long upper shadow | The open price is lower than the close price, and both are lower that the high price and upper than the low price, wherein the difference between the high price and the body is quite higher than between the low price and the body. |
Hammer | The open price is lower than the close price, and the close price equals the high price. |
Inverted hammer | The close price is lower than the open price, and the close price equals the low price. |
Spinning top white | This pattern indicates the indecision between the buyers and sellers. If a spinning top forms during an uptrend, this usually means there aren’t many buyers left, if a spinning top forms during a downtrend, this means there aren’t many sellers left. Color of the body is not very important. |
Spinning top black | This pattern indicates the indecision between the buyers and sellers. If a spinning top forms during an uptrend, this usually means there aren’t many buyers left, if a spinning top forms during a downtrend, this means there aren’t many sellers left. Color of the body is not very important. |
Four Price Doji | All four prices are equal. |
Long legged doji | Prices moved above and below the open price, but the close price equals the open price. |
Dragonfly doji | The open price equals the close price and they both are the same as the high price. |
Gravestone doji | The open price equals the close price and they both are the same as the low price. |
Marubozu white | The open price equals the low price and the close price equals the high price. |
Marubozu black | The open equals the high and the close equals the low. |