Momentum
Overview
The Momentum indicator is a speed of movement indicator, that is designed to identify the speed (or strength) of a price movement. The momentum indicator compares the most recent closing price to a previous closing price and may be used as a trend-following oscillator (similar to the Moving Average Convergence/Divergence (MACD)).
The Momentum indicator identifies when the price is moving upwards or downwards, and also by how much the price is moving upwards or downwards. When the momentum indicator is above zero, the price has upwards momentum, and when the momentum indicator is below zero the price has downwards momentum.
Mathematical description of the indicator please see at: Mathematical Description of Technical Indicators
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
Momentum indicator needs Data Provider with Close or Value fields.
Sample XML/JSON of Data Provider, which can be used to create Momentum indicator:
Indicator Declaration
As soon as Data Provider is ready you can add an indicator to a chart.
Momentum indicator is usually
shown on the chart 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/JSON for Momentum declaration, note that there are two charts defined - one is used to show the stock data, and another one contains technical
indicator:
01 |
<?xml version="1.0" encoding="UTF-8"?> |
02 |
< stock xmlns = "http://anychart.com/products/stock/schemas/1.9.0/schema.xsd" > |
After all things mentioned above are done, you can create a chart with Momentum indicator, see basic Live Sample with it below:
Live Sample: Technical Indicators - Adding Momentum Indicator
Indicator parameters
Momentum has only one type specific parameter - period. Period is set in <momentum_indicator> node,
where all settings for Momentum indicator are set.
XML/JSON for setting Momentum period:
As you can see you just need to set period attribute in <momentum_indicator> node,
this attribute accepts any integer greater than 1.
Live sample below shows Momentum(30):
Live Sample: Technical Indicators - Momentum Parameters
Visualization
To visualize and tune visualization of technical indicators AnyChart Stock Component uses the same methods as for
the data series.
By default Momentum 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.
Momentum indicator settings are contained in <momentum_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/JSON for changing indicator visualization:
06 |
< name > <![CDATA[ Momentum(14) ]]> </ name > |
Live sample below shows settings shown above:
Live Sample: Technical Indicators - Momentum Visualization Settings