Gallery
JS Navigator Aroon
<%@ Page Language="C#" Description="dotnetCHARTING Component" %>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.netCHARTING Sample</title>
<script runat="server">
void Page_Load(Object sender, EventArgs e)
{
Chart.JS.Enabled = true;
Chart.Navigator.Enabled = true;
// Demonstrates the use of Aroon indicators.
// The Financial Chart
Chart.TempDirectory = "temp";
Chart.Debug = false;
Chart.ShadingEffect = true;
Chart.LegendBox.Template = "%icon %name";
Chart.Size = "640x400";
Chart.XAxis.Scale = Scale.Time;
Chart.DefaultSeries.Type = SeriesType.Spline;
Chart.DefaultSeries.DefaultElement.Marker.Type = ElementMarkerType.None;
Chart.YAxis.Label.Text = "Price (USD)";
Chart.YAxis.FormatString = "currency";
// Setup the dataEngine to get data.
DataEngine de = new DataEngine(ConfigurationManager.AppSettings["DNCConnectionString"]);
de.ChartObject = Chart;
de.ChartType = ChartType.Financial;
de.DateGrouping = TimeInterval.Day;
de.StartDate = new DateTime(2021, 6, 1);
de.EndDate = new DateTime(2021, 8, 30);
// For this example we import data from the FinancialCompany table from within chartsample.mdb
de.SqlStatement = @"SELECT TransDate, HighPrice, LowPrice, OpenPrice, ClosePrice FROM FinancialCompany WHERE TransDate >= #STARTDATE# AND TransDate <= #ENDDATE# ORDER BY TransDate Desc";
de.DataFields = "xAxis=TransDate,High=HighPrice,Low=LowPrice,Open=OpenPrice,Close=ClosePrice";
// Get prices from the data engine.
SeriesCollection sc = de.GetSeries();
Series prices = null;
if (sc.Count > 0)
prices = sc[0];
else
return;
prices.Type = SeriesTypeFinancial.CandleStick;
prices.Name = "Prices";
Chart.SeriesCollection.Add(prices);
// Trim out weekends from the prices series and add it to the chart.
CalendarPattern cp = new CalendarPattern(TimeInterval.Day, TimeInterval.Week, "1000001");
prices.Trim(cp, ElementValue.XDateTime);
// Here we create a new chart area for displaying the series for Aroon indicators.
// Aroon chart area
ChartArea aroonChartArea = new ChartArea();
aroonChartArea.HeightPercentage = 20;
// A new y axis is assigned in order to loose the original y axis' settings.
aroonChartArea.YAxis = new Axis();
aroonChartArea.YAxis.Label.Text = "Aroon";
Chart.ExtraChartAreas.Add(aroonChartArea);
// AroonUpOverPeriod - measures the relative time since the last highest high over a peroid of five days.
Series aroonUpOverPeriod = FinancialEngine.AroonUpOverPeriod(prices, 5);
aroonUpOverPeriod.Name = " AroonUpOverPeriod5";
aroonUpOverPeriod.DefaultElement.Color = Color.FromArgb(49, 255, 49);
aroonChartArea.SeriesCollection.Add(aroonUpOverPeriod);
// AroonDownOverPeriod - indicator which measures the relative time since the last lowest low over
// a period of five days.
Series aroonDownOverPeriod = FinancialEngine.AroonDownOverPeriod(prices, 5);
aroonDownOverPeriod.Name = " AroonDownOverPeriod5";
aroonDownOverPeriod.DefaultElement.Color = Color.FromArgb(0, 156, 255);
aroonChartArea.SeriesCollection.Add(aroonDownOverPeriod);
// AroonOscillatorOverPeriod - Evaluates the Aroon Oscillator over the last 5 days which is given by the
// following formulae: Aroon Oscillator = (Aroon Up Indicator) - (Aroon DownIndicator).
Series aroonOscillatorOverPeriod = FinancialEngine.AroonOscillatorOverPeriod(prices, 5);
aroonOscillatorOverPeriod.Name = " AroonOscillatorOverPeriod5";
aroonOscillatorOverPeriod.DefaultElement.Color = Color.FromArgb(255, 99, 49);
aroonChartArea.SeriesCollection.Add(aroonOscillatorOverPeriod);
// The Aroon indicator has been developed in order to indicate when a trending
// approach such as moving averages or the trading range approach such as the
// application of oscillators in more appropriate.
Chart.SeriesCollection.Add(FinancialEngine.TriangularMovingAverage(prices, ElementValue.High, 5));
}
</script>
</head>
<body>
<div align="center">
<dotnet:Chart ID="Chart" runat="server" />
</div>
</body>
</html>
<%@ Page Language="vb" Description="dotnetCHARTING Component" %>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.netCHARTING Sample</title>
<script runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Chart.JS.Enabled = True
Chart.Navigator.Enabled = True
' Demonstrates the use of Aroon indicators.
' The Financial Chart
Chart.TempDirectory = "temp"
Chart.Debug = False
Chart.ShadingEffect = True
Chart.LegendBox.Template = "%icon %name"
Chart.Size = "640x400"
Chart.XAxis.Scale = Scale.Time
Chart.DefaultSeries.Type = SeriesType.Spline
Chart.DefaultSeries.DefaultElement.Marker.Type = ElementMarkerType.None
Chart.YAxis.Label.Text = "Price (USD)"
Chart.YAxis.FormatString = "currency"
' Setup the dataEngine to get data.
Dim de As DataEngine = New DataEngine(ConfigurationManager.AppSettings("DNCConnectionString"))
de.ChartObject = Chart
de.ChartType = ChartType.Financial
de.DateGrouping = TimeInterval.Day
de.StartDate = New DateTime(2021, 6, 1)
de.EndDate = New DateTime(2021, 8, 30)
' For this example we import data from the FinancialCompany table from within chartsample.mdb
de.SqlStatement = "SELECT TransDate, HighPrice, LowPrice, OpenPrice, ClosePrice FROM FinancialCompany WHERE TransDate >= #STARTDATE# AND TransDate <= #ENDDATE# ORDER BY TransDate Desc"
de.DataFields = "xAxis=TransDate,High=HighPrice,Low=LowPrice,Open=OpenPrice,Close=ClosePrice"
' Get prices from the data engine.
Dim sc As SeriesCollection = de.GetSeries()
Dim prices As Series = Nothing
If sc.Count > 0 Then
prices = sc(0)
Else
Return
End If
prices.Type = SeriesTypeFinancial.CandleStick
prices.Name = "Prices"
Chart.SeriesCollection.Add(prices)
' Trim out weekends from the prices series and add it to the chart.
Dim cp As CalendarPattern = New CalendarPattern(TimeInterval.Day, TimeInterval.Week, "1000001")
prices.Trim(cp, ElementValue.XDateTime)
' Here we create a new chart area for displaying the series for Aroon indicators.
' Aroon chart area
Dim aroonChartArea As ChartArea = New ChartArea()
aroonChartArea.HeightPercentage = 20
' A new y axis is assigned in order to loose the original y axis' settings.
aroonChartArea.YAxis = New Axis()
aroonChartArea.YAxis.Label.Text = "Aroon"
Chart.ExtraChartAreas.Add(aroonChartArea)
' AroonUpOverPeriod - measures the relative time since the last highest high over a peroid of five days.
Dim aroonUpOverPeriod As Series = FinancialEngine.AroonUpOverPeriod(prices, 5)
aroonUpOverPeriod.Name = " AroonUpOverPeriod5"
aroonUpOverPeriod.DefaultElement.Color = Color.FromArgb(49, 255, 49)
aroonChartArea.SeriesCollection.Add(aroonUpOverPeriod)
' AroonDownOverPeriod - indicator which measures the relative time since the last lowest low over
' a period of five days.
Dim aroonDownOverPeriod As Series = FinancialEngine.AroonDownOverPeriod(prices, 5)
aroonDownOverPeriod.Name = " AroonDownOverPeriod5"
aroonDownOverPeriod.DefaultElement.Color = Color.FromArgb(0, 156, 255)
aroonChartArea.SeriesCollection.Add(aroonDownOverPeriod)
' AroonOscillatorOverPeriod - Evaluates the Aroon Oscillator over the last 5 days which is given by the
' following formulae: Aroon Oscillator = (Aroon Up Indicator) - (Aroon DownIndicator).
Dim aroonOscillatorOverPeriod As Series = FinancialEngine.AroonOscillatorOverPeriod(prices, 5)
aroonOscillatorOverPeriod.Name = " AroonOscillatorOverPeriod5"
aroonOscillatorOverPeriod.DefaultElement.Color = Color.FromArgb(255, 99, 49)
aroonChartArea.SeriesCollection.Add(aroonOscillatorOverPeriod)
' The Aroon indicator has been developed in order to indicate when a trending
' approach such as moving averages or the trading range approach such as the
' application of oscillators in more appropriate.
Chart.SeriesCollection.Add(FinancialEngine.TriangularMovingAverage(prices, ElementValue.High, 5))
End Sub
</script>
</head>
<body>
<div align="center">
<dotnet:Chart ID="Chart" runat="server" />
</div>
</body>
</html>
- Sample FilenameJsNavigatorAroon.aspx
- Version8.0
- Uses DatabaseYes