Description
This indicator developed by Volker Knapp. It is calculated as the moving average of the values of the internal bars strength that represent the ratio (close-low)/(high-low) * 100% for each of them
The crossing of 60% level means the overbuying and the crossing of 40% level means overselling, and so they are the signals for selling and buying respectively.
using System;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
namespace cAlgo
{
[Levels(40,50,60)]
[Indicator(AccessRights = AccessRights.None)]
public class mInternalBarStrength : Indicator
{
[Parameter("Periods (5)", DefaultValue = 5)]
public int inpPeriods { get; set; }
[Parameter("SmoothType (sma)", DefaultValue = MovingAverageType.Simple)]
public MovingAverageType inpSmoothType { get; set; }
[Output("Internal Bar Strength", LineColor = "Black", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
public IndicatorDataSeries outIBS { get; set; }
private IndicatorDataSeries _deltahl, _rawibs;
private MovingAverage _smoothibs;
protected override void Initialize()
{
_deltahl = CreateDataSeries();
_rawibs = CreateDataSeries();
_smoothibs = Indicators.MovingAverage(_rawibs, inpPeriods, inpSmoothType);
}
public override void Calculate(int i)
{
_deltahl[i] = Bars.HighPrices[i] - Bars.LowPrices[i];
_rawibs[i] = _deltahl[i] > 0 ? (Bars.ClosePrices[i] - Bars.LowPrices[i]) / _deltahl[i] : 0;
outIBS[i] = 100.0 * _smoothibs.Result[i];
}
}
}
mfejza
Joined on 25.01.2022
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: mInternalBarStrength.algo
- Rating: 5
- Installs: 563
- Modified: 18/02/2023 12:10
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.