Description
The Waddah Attar Explosion Indicator is built based on the price and can easily be used by the trader to identify when the price of a currency pair or trading asset has started moving either as a trend continuation move or breakout move after a range or as a reversal move after the price has been moving in one direction for a while.
This Indicator is Written Multi Time Frame.
Contact me :
using System;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
namespace cAlgo
{
[Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class Wae : Indicator
{
private BollingerBands _bb;
private ExponentialMovingAverage _fastEma;
private ExponentialMovingAverage _slowEma;
private IndicatorDataSeries _macd;
private Bars _bars;
#region Parameters
[Parameter("Sensitivity", DefaultValue = 250)]
public int Sensitivity { get; set; }
[Parameter("FastEMA Length", Group = "MA", DefaultValue = 50)]
public int FastLength { get; set; }
[Parameter("SlowEMA Length", Group = "MA", DefaultValue = 80)]
public int SlowLength { get; set; }
[Parameter("BB Channel Length", Group = "BB", DefaultValue = 20)]
public int ChannelLength { get; set; }
[Parameter("BB Stdev Multiplier", Group = "BB", DefaultValue = 1.0)]
public double Multi { get; set; }
[Parameter("Time Frame", DefaultValue = "Minute5")]
public TimeFrame IndicatorTimeFrame { get; set; }
#endregion
[Output("Positive Histogram", LineColor = "Green", PlotType = PlotType.Histogram)]
public IndicatorDataSeries PositiveHistogram { get; set; }
[Output("Negetive Histogram", LineColor = "Red", PlotType = PlotType.Histogram)]
public IndicatorDataSeries NegetiveHistogram { get; set; }
[Output("Explosion", LineColor = "White")]
public IndicatorDataSeries Explosion { get; set; }
protected override void Initialize()
{
_bars = MarketData.GetBars(IndicatorTimeFrame);
_bb = Indicators.BollingerBands(_bars.ClosePrices, ChannelLength, Multi, MovingAverageType.Simple);
_fastEma = Indicators.ExponentialMovingAverage(_bars.ClosePrices, FastLength);
_slowEma = Indicators.ExponentialMovingAverage(_bars.ClosePrices, SlowLength);
_macd = CreateDataSeries();
}
public override void Calculate(int index)
{
var idx = _bars.OpenTimes.GetIndexByTime(Bars.OpenTimes[index]);
if (idx == -1)
return;
_macd[idx] = _fastEma.Result[idx] - _slowEma.Result[idx];
var t1 = (_macd[idx] - _macd[idx - 1]) * Sensitivity;
Explosion[index] = _bb.Top[idx] - _bb.Bottom[idx];
PositiveHistogram[index] = t1 > 0 ? t1 : 0;
NegetiveHistogram[index] = t1 < 0 ? -t1 : 0;
}
}
}
AT
atabaki
Joined on 05.08.2021
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: WAE.algo
- Rating: 5
- Installs: 1278
- 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.