An update for this algorithm is currently pending moderation. Please revisit this page shortly to access the algorithm's latest version.
Description
John Bollinger's Normalized Intraday Intensity Oscillator.
This custom indicator attempts to measure intraday intensity for both bullish and bearish sentiment.
The indicator displays positive values for bullish intensity and negative values for bearish intensity. This custom indicator is also used to identify trade zones.
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
namespace cAlgo
{
[Levels(0)]
[Cloud("NII", "LevelZero", FirstColor = "Green", SecondColor = "Red", Opacity = 0.15)]
[Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class mNormalizedIntradayIntensity : Indicator
{
[Parameter("Period (10)", DefaultValue = 10)]
public int inpPeriod { get; set; }
[Output("NII", IsHistogram = false, LineColor = "Black", Thickness = 1)]
public IndicatorDataSeries outNII { get; set; }
[Output("LevelZero", LineColor = "Transparent", PlotType = PlotType.Line, Thickness = 1)]
public IndicatorDataSeries outLevelZero { get; set; }
private IndicatorDataSeries _raw, _nii;
private MovingAverage _smoothvol, _smoothraw;
protected override void Initialize()
{
_raw = CreateDataSeries();
_nii = CreateDataSeries();
_smoothvol = Indicators.MovingAverage(Bars.TickVolumes, inpPeriod, MovingAverageType.Simple);
_smoothraw = Indicators.MovingAverage(_raw, inpPeriod, MovingAverageType.Simple);
}
public override void Calculate(int i)
{
_raw[i] = (Bars.HighPrices[i] - Bars.LowPrices[i] != 0 ? (2.0 * Bars.ClosePrices[i] - Bars.HighPrices[i] - Bars.LowPrices[i]) / (Bars.HighPrices[i] - Bars.LowPrices[i]) * Bars.TickVolumes[i] : 0);
_nii[i] = _smoothvol.Result[i] != 0 ? _smoothraw.Result[i] / _smoothvol.Result[i] * 100.0 : 0;
outNII[i] = _nii[i];
outLevelZero[i] = 0;
}
}
}
mfejza
Joined on 25.01.2022
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: mNormalizedIntradayIntensity.algo
- Rating: 5
- Installs: 584
- Modified: 09/10/2023 10:06
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.