Chaikin Volatility

Overview

Chaikin's volatility indicator calculates the spread between the maximum and minimum prices. It judges the value of volatility basing on the amplitude between the maximum and the minimum. Unlike Average True Range, Chaikin's indicator doesn't take gaps into account.

According to Chaikin's interpretation, a growth of volume indicator in a relatively short space of time means that the prices approach their minimum (like when the securities are sold in panic), while a decrease of volatility in a longer period of time indicates that the prices are on the peak (for example, in the conditions of a mature bull market).

AnyChart Stock allows you to add Chaikin Volatility with desired period to any of your charts.

Mathematical description of the indicator please see at: Mathematical Description of Technical Indicators

to top

Adding indicator

To add any indicator to the chart, you need to use Data Provider with the fields required by the indicator. When such Data Provider is ready - you can add indicator to the chart.

Preparing Data Provider

Chaikin Volatility indicator needs Data Provider with High and Low fields.

Sample XML of Data Provider, which can be used to create Chaikin Volatility indicator:

XML Syntax:

XML/JSON Syntax
Plain code
01 <?xml version="1.0" encoding="UTF-8"?>
02 <stock xmlns="http://anychart.com/products/stock/schemas/1.9.0/schema.xsd">
03   <data>
04     <data_providers>
05       <general_data_providers>
06         <data_provider data_set="dataSet1" id="dp1">
07           <fields>
08             <field type="High" column="2" approximation_type="High" />
09             <field type="Low" column="3" approximation_type="Low" />
10             <field type="Value" column="4" approximation_type="Close" />
11           </fields>
12         </data_provider>
13       </general_data_providers>
14     </data_providers>
15   </data>
16 </stock>
01{
02  data: {
03    dataProviders: {
04      generalDataProviders: [
05        {
06          dataSet: "dataSet1",
07          id: "dp1",
08          fields: [
09            {
10              type: "High",
11              column: 2,
12              approximationType: "High"
13            },
14            {
15              type: "Low",
16              column: 3,
17              approximationType: "Low"
18            },
19            {
20              type: "Value",
21              column: 4,
22              approximationType: "Close"
23            }
24          ]
25        }
26      ]
27    }
28  }
29}

to top

Indicator Declaration

As soon as Data Provider is ready you can add an indicator to a chart.

Chaikin Volatility indicator is usually shown on the chart above or below the chart with data (stock data). So we should declare it in another chart. Learn more about charts and layout in Chart Layout article.

XML for Chaikin Volatility declaration, note that there are two charts defined - one is used to show the stock data, and another one contains technical indicator:

XML/JSON Syntax
Plain code
01 <?xml version="1.0" encoding="UTF-8"?>
02 <stock xmlns="http://anychart.com/products/stock/schemas/1.9.0/schema.xsd">
03   <settings>
04     <charts>
05       <chart>
06         <series_list>
07           <series type="Line" data_provider="dpMsft" />
08         </series_list>
09       </chart>
10       <chart>
11         <technical_indicators>
12           <technical_indicator type="ChaikinVolatility" data_provider="dpMsft" />
13         </technical_indicators>
14       </chart>
15     </charts>
16   </settings>
17 </stock>
01{
02  settings: {
03    charts: [
04      {
05        seriesList: [
06          {
07            type: "Line",
08            dataProvider: "dpMsft"
09          }
10        ]
11      },
12      {
13        technicalIndicators: [
14          {
15            type: "ChaikinVolatility",
16            dataProvider: "dpMsft"
17          }
18        ]
19      }
20    ]
21  }
22}

After all things mentioned above are done, you can create a chart with Chaikin Volatility indicator, see basic Live Sample with it below:

Live Sample:  Technical Indicators - Adding Chaikin Volatility Indicator

to top

Indicator parameters

Chaikin Volatility has two type-specific parameters: period and Rate Of Change Period. They are set in <chaikin_volatility_indicator> node, where all settings for Chaikin Volatility indicator are set.

XML for setting Chaikin Volatility period:

XML/JSON Syntax
Plain code
01 <chart>
03     <technical_indicator type="ChaikinVolatility" data_provider="dpMsft">
04       <chaikin_volatility_indicator period="10" roc_period="10" />
05     </technical_indicator>
07 </chart>
01{
03    {
04      type: "ChaikinVolatility",
05      dataProvider: "dpMsft",
07        period: 10,
08        rocPeriod: 10
09      }
10    }
11  ]
12}

As you can see you just need to set period and roc_period attributes in <chaikin_volatility_indicator> node, these attributes accept any integer greater than 1.

Live sample below shows Chaikin Volatility(20,20):

Live Sample:  Technical Indicators - Chaikin Volatility Parameters

to top

Visualization

To visualize and tune visualization of technical indicators AnyChart Stock Component uses the same methods as for the data series.

By default, Chaikin Volatility is shown as series of Line type, but you can use almost any of available series types to show it on the chart - Spline, Area or Stick, for example.

Chaikin Volatility indicator settings are contained in <chaikin_volatility_indicator> node, also in this node you can put <series> subnode - this node defines how exactly indicator is displayed on the chart. This node is identical to <series> node used to describe data series, so you can do with indicator anything you can do with series.

Sample XML for changing indicator visualization:

XML/JSON Syntax
Plain code
01 <chart>
03     <technical_indicator type="ChaikinVolatility" data_provider="dpMsft">
04       <chaikin_volatility_indicator>
05         <series type="Area" color="#1EA64E">
06           <name><![CDATA[Chaikin Volatility(10,10)]]></name>
07           <area_series>
08             <fill color="%Color" opacity="0.6" />
09             <line thickness="1" color="DarkColor(%Color)" opacity="1" />
10           </area_series>
11         </series>
12       </chaikin_volatility_indicator>
13     </technical_indicator>
15 </chart>
01{
03    {
04      type: "ChaikinVolatility",
05      dataProvider: "dpMsft",
07        series: {
08          type: "Area",
09          color: "#1EA64E",
10          name: "Chaikin Volatility(10,10)",
11          areaSeries: {
12            fill: {
13              color: "%Color",
14              opacity: 0.6
15            },
16            line: {
17              thickness: 1,
18              color: "DarkColor(%Color)",
19              opacity: 1
20            }
21          }
22        }
23      }
24    }
25  ]
26}

Live sample below shows settings shown above:

Live Sample:  Technical Indicators - Chaikin Volatility Visualization Settings

to top

to top