Category Trend  Published on 10/08/2023

Dynamic Balance Point indicator

An update for this algorithm is currently pending moderation. Please revisit this page shortly to access the algorithm's latest version.
Description

The Balance Point itself can be used as a sort of support/resistance indicator or for dynamic stop/reverse. 

In the case when the indicator value is lower than the current closing price, use the indicator value as support. If the closing price is lower than the indicator value, then use the balance point as resistance. 

One of the most advanced strategies derived from this indicator is to use it over four periods (e.g., 10, 50, 100, 200) and apply the indicator usage rules (see fig.2). If the price is above all indicator values, then the price is considered under bullish pressure, and the support is considered as the value of the nearest indicator below the price. If the price is below all indicator values, then the price is considered under bearish pressure, and the resistance is considered as the value of the nearest indicator above the price. 




mfejza's avatar
mfejza

Joined on 25.01.2022

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: mDynamicBalancePoint.algo
  • Rating: 5
  • Installs: 567
  • Modified: 10/08/2023 11:56
Comments
Log in to add a comment.
mfejza's avatar
mfejza · 1 year ago
using System;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;

namespace cAlgo
{
    [Cloud("Price", "Dynamic Balance Point", FirstColor = "Green", SecondColor = "Red", Opacity = 0.05)]  
    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
    public class mDynamicBalancePoint : Indicator
    {
        [Parameter("Periods (26)", DefaultValue = 26)]
        public int inpPeriods { get; set; }

        [Output("Dynamic Balance Point", LineColor = "Black", Thickness = 2)]
        public IndicatorDataSeries outDBP { get; set; }
        [Output("Price", LineColor = "Transparent", Thickness = 0)]
        public IndicatorDataSeries outPrice { get; set; }
        
        private IndicatorDataSeries _hh, _ll, _close, _dbp;
        

        protected override void Initialize()
        {
            _hh = CreateDataSeries();
            _ll = CreateDataSeries();
            _close = CreateDataSeries();
            _dbp = CreateDataSeries();
        }

        public override void Calculate(int i)
        {
            _hh[i] = Bars.HighPrices.Maximum(inpPeriods);
            _ll[i] = Bars.LowPrices.Minimum(inpPeriods);
            _close[i] = Bars.ClosePrices[i>0 ? i-1 : i];
            _dbp[i] = (_hh[i] + _ll[i] + _close[i]) / 3.0;
            
            outDBP[i] = _dbp[i];
            outPrice[i] = Bars.ClosePrices[i];
        }
    }
}