Technical Indicators
28 Feb 20226 minutes to read
A technical indicator is a mathematical calculation based on historic price, volume or open interest information that aims to forecast financial market direction.
Stock Chart supports 10 types of technical indicators namely Accumulation Distribution
, ATR
, EMA
,SMA
,TMA
,Momentum
,MACD
,RSI
,Stochastic
,Bollinger Band
. By using indicator dropdown box you can add an remove the required indicators types.
Accumulation Distribution
Accumulation Distribution combines price and volume to show how money may be flowing into or out of stock.
To render a Accumulation Distribution Indicator, use indicator Type
as AccumulationDistribution
.
To calculate the signal line Volume
field is additionally added with DataSource
.
Average True Range (ATR)
ATR measures the stock volatility by comparing the current value with the previous value.
To render a Average True Range (ATR) Indicator, use indicator Type
as Atr
.
Exponential Moving Average (EMA)
Moving average Indicators are used to define the direction of the trend. To render a EMA Indicator, use indicator Type
as Ema
.
Momentum
Momentum shows the speed at which the price of the stock is changing. To render a Momentum indicator, use indicator Type
as Momentum
. Momentum indicator will be represented by two lines (upperLine, signalLine).In momentum indicator the upperBand value is always renders at the value 100.
Moving Average Convergence Divergence (MACD)
MACD is based on the difference between two EMA’s. To render a MACD Indicator, use indicator Type
as Macd
.MACD indicator will be represented by MACD line,signal line, MACD histogram. MACD histogram is used to differentiate MACD line and signal line.
Relative Strength Index (RSI)
RSI shows how strongly a stock is moving in its current direction. To render a RSI Indicator, use indicator Type
as Rsi
.RSI indicator will be represented by three lines (upperBand, lowerBand, signalLine). The upperBand and lowerBand values are customized by OverBought
and OverSold
properties of indicator and the signalLine is calculated by RSI formula.
Simple Moving Average (SMA)
Moving average Indicators are used to define the direction of the trend. To render a SMA Indicator, use indicator Type
as Sma
.
Stochastic
It shows how a stock is, when compared to previous state. To render a Stochastic indicator, use indicator Type
as Stochastic
.
Stochastic indicator will be represented by four lines (upperLine, lowerLine, periodLine, signalLine).
In stochastic indicator the upperBand value and lowerBand value is customized by OverBought
and OverSold
properties of indicators and the periodLine and signalLine is render based on stochastic formula.
Triangular Moving Average (TMA)
Moving average Indicators are used to define the direction of the trend. To render a TMA Indicator, use indicator Type
as Tma
.
Bollinger Band
A Stock Chart overlay that shows the upper and lower limits of normal price movements based on the standard deviation of prices.
To render a Bollinger Band, use indicator Type
as BollingerBand
.Bollinger band will be represented by three lines (upperLine, lowerLine, signalLine).(https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Charts.StockChartStockChartIndicator.html#Syncfusion_EJ2_Charts_StockChartStockChartIndicator_Type) and StandardDeviations
is 2.
<script src="~/financial-data.js"></script>
<div class="control-section">
<div id="control-container">
@(Html.EJS().StockChart("container").Load("stockload")Title("AAPL Stock Price").ExportType(new List<Object>() { }).TrendlineType(new List<Object>() { })
.Series(sr =>
{
sr.Type(Syncfusion.EJ2.Charts.ChartSeriesType.Candle).Name("Apple Inc").DataSource("data").Add();
})
.Render())
<script>
var data = window.chartData;
function stockload(args) {
args.stockChart.series[0].indicators = [
{
type: 'BollingerBands', field: 'close', seriesName: 'Apple Inc',
period: 10, upperLine: { color: '#ffb735', width: 1 },
lowerLine: { color: '#f2ec2f', width: 1 }
}]
}
</script>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace EJ2CoreSampleBrowser.Controllers.StockChart
{
public partial class StockChartController : Controller
{
public IActionResult Default()
{
return View();
}
}
}