Description
This is a modified version of the famous Awesome Oscillator created by Bill Williams.
The indicator will show the cumulative sum of the difference between the fast and slow SMA (cumulative sum of the normal AO output) for the selected lookback period.
Lookback value 0 & 1 will void function and return normal AO
I have also added a moving average that reads the AO output as input (MA of AO)..
This indicator can be replaced with my more advanced version of MACD
In the picture below, above normal AO and below AO Plus with lookback value of 25 bars. Lookback feature attempts to better interpret the market up and down cycles and longer-term momentum.
using System;
using cAlgo.API;
using cAlgo.API.Indicators;
/*
Indicator was modified by Telegram @Fibonacci2011 on Jan 2020.
This is a modified version of the famous Awesome Oscillator
created by Bill Williams.
The indicator will show the cumulative sum of the difference between
the fast and slow SMA (cumulative sum of the normal AO output) for
the selected lookback period.
Indicator attemps to show momentum and cycles better than the standard AO.
Lookback value 0 & 1 will void function and return normal AO.
I have also added a moving average that reads the AO output as input (MA of AO).
Linda Raschke settings AO periods: 3 & 10 MA on AO period:16
*/
namespace cAlgo.Indicators
{
[Indicator(IsOverlay = false, AccessRights = AccessRights.None)]
public class AwesomeOscillatorPlus : Indicator
{
[Parameter("Fibonacci info only!: ", DefaultValue = "3,5,8,13,21,34,55,89,144,233,377")]
public string indicatorinfo { get; set; }
[Parameter("Fast Period ", DefaultValue = 5)]
public int periodFast { get; set; }
[Parameter("Slow Period ", DefaultValue = 34)]
public int periodSlow { get; set; }
[Parameter("MA Period", Group = "--- MA on AO ---", DefaultValue = 21)]
public int PricePeriod { get; set; }
[Parameter("LookBack Period, Void if 0 ", Group = "--- LookBack ---", DefaultValue = 0, MinValue = 0)]
public int LBPeriod { get; set; }
[Output("Awesome OscillatorGreen", IsHistogram = true, LineColor = "Green")]
public IndicatorDataSeries AwesomeGreen { get; set; }
[Output("Awesome OscillatorRed", IsHistogram = true, LineColor = "Red")]
public IndicatorDataSeries AwesomeRed { get; set; }
[Output("MA on AO", LineColor = "Lime", LineStyle = LineStyle.Solid, Thickness = 2)]
public IndicatorDataSeries MASignal { get; set; }
private SimpleMovingAverage smaSlow;
private SimpleMovingAverage smaFast;
private SimpleMovingAverage smaSignal;
private IndicatorDataSeries smaAlways;
private IndicatorDataSeries medianprice;
private IndicatorDataSeries cumulative;
private SimpleMovingAverage cumulativesmaSignal;
protected override void Initialize()
{
medianprice = CreateDataSeries();
smaSlow = Indicators.SimpleMovingAverage(medianprice, periodSlow);
smaFast = Indicators.SimpleMovingAverage(medianprice, periodFast);
smaAlways = CreateDataSeries();
cumulative = CreateDataSeries();
cumulativesmaSignal = Indicators.SimpleMovingAverage(cumulative, PricePeriod);
}
public override void Calculate(int index)
{
medianprice[index] = (MarketSeries.High[index] + MarketSeries.Low[index]) / 2;
smaAlways[index] = smaFast.Result[index] - smaSlow.Result[index];
cumulative[index] = LBPeriod > 0 ? smaAlways.Sum(LBPeriod) / LBPeriod : smaAlways[index];
//////////////////////////////////// Drawing ///////////////////////////////////
MASignal[index] = cumulativesmaSignal.Result[index];
if (cumulative.IsRising())
AwesomeGreen[index] = LBPeriod > 0 ? smaAlways.Sum(LBPeriod) / LBPeriod : smaAlways[index];
else
AwesomeRed[index] = LBPeriod > 0 ? smaAlways.Sum(LBPeriod) / LBPeriod : smaAlways[index];
}
}
}
jani
Joined on 05.04.2019
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: Awesome Oscillator Plus.algo
- Rating: 0
- Installs: 2511
- Modified: 13/10/2021 09:54
Note that publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section, please use the Copyright Infringement Notification form to submit a claim.
Comments
Log in to add a comment.
No comments found.