Trading with Aroon Oscillator involves the following signals:
The further the Oscillator line is from Zero level, the stronger the trend.
When values are near Zero line, the market is trending nowhere.
Aroon oscillator is based on Aroon Indicator. Aroon Oscillator is a trend-following indicator that illustrates the strength of a current trend and its potentials to last.
An oscillator that oscillate between -100 and 100.
It oscillates around zero line, defining times when AroonUp and AroonDown lines of Aroon Indicator cross each other.
The positive value of Aroon Oscillator indicates an uptrend, while the negative value indicates a downtrend. The higher the absolute value of Aroon Oscillator, the stronger the trend.
using System; using System.Collections; using System.Collections.Generic; using System.Text; using PTLRuntime.NETScript; using System.Drawing; namespace ind { //--------------------------------------------------- // Project: Aroon // Type: Indicator // Author: PFSoft LLC // Company: PFSoft LLC /www.pfsoft.com/ // Copyright: (C) PFSoft LLC Dnepopetrovsk. Ukraine // Created: Nov, 28,2006 //--------------------------------------------------- public class AROON : NETIndicator { public AROON() : base() { ProjectName = "Aroon"; Comments = "Reveals the beginning of a new trend"; SetIndicatorLine("line1", Color.Lime, 1, LineStyle.SimpleChart); SetIndicatorLine("line2", Color.Teal, 1, LineStyle.IsoDotChart); SetIndicatorLine("line3", Color.Red, 1, LineStyle.SimpleChart); SetIndicatorLine("line4", Color.Red, 1, LineStyle.IsoDotChart); SeparateWindow = true; } [InputParameter("Period of loking back:", 0)] public int IndPeriod = 14; [InputParameter("Up signal line:", 1, 1, 100, 2, 1)] public double UpSignalLine = 70; [InputParameter("Down signal line:", 2, 1, 100, 2, 1)] public double DownSignalLine = 30; public const int AROON_UP_LINE = 0; public const int AROON_DOWN_LINE = 1; public const int UP_SIG_LINE = 2; public const int DOWN_SIG_LINE = 3; public override void OnQuote() { // Setting value of signal lines platform.SetValue(UP_SIG_LINE, 0, UpSignalLine); platform.SetValue(DOWN_SIG_LINE, 0, DownSignalLine); // Getting max and min prices for period int count = platform.BarsCount(platform.Symbol, platform.Period); int i = 0; int period = 0; double high = ptl.High; double low = ptl.Low; int perHigh = 0; int perLow = 0; while( (i<count) && (period<IndPeriod)) { // Skipping empty bar if(!ptl.IsEmpty(i)) { double price; price = ptl.High[i]; if(price>high) { high = price; perHigh = period; }; price = ptl.Low[i]; if(price<low) { low = price; perLow = period; }; period += 1; }; i += 1; }; // Getting Aroon up and down lines double dPeriod = IndPeriod; // Here we're transforming integer value to double for real division platform.SetValue(AROON_UP_LINE, 0, (1.0 - perHigh/dPeriod)*100.0); platform.SetValue(AROON_DOWN_LINE, 0, (1.0 - perLow/dPeriod)*100.0); } } }
Comments