Category Oscilators  Published on 28/05/2023

Zero Point Force indicator

Description

ZPF (Zero Point Force) is a zero point force indicator that displays the market climate.

If the line for +ZP Force has positive values, it indicates a predominance of a bullish climate in the market. Conversely, if the values are negative, it signifies a bearish climate.

Regarding the line for -ZP Force, the situation is reversed: positive values indicate a bearish climate, while negative values indicate a bullish climate.


using System;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;

namespace cAlgo
{
    [Levels(0)]
    [Cloud("ZPF Bulls", "ZPF Bears", FirstColor = "Green", SecondColor = "Red", Opacity = 0.1)]  
    [Indicator(IsOverlay = false, AutoRescale = false, AccessRights = AccessRights.None)]
    public class mZeroPointForce : Indicator
    {
        [Parameter("Fast Periods (12)", DefaultValue = 12)]
        public int inpPeriodsFast { get; set; }
        [Parameter("Fast Smooth Type (sma)", DefaultValue = MovingAverageType.Simple)]
        public MovingAverageType inpTypeSmoothFast { get; set; }
        [Parameter("Slow Periods (24)", DefaultValue = 24)]
        public int inpPeriodsSlow { get; set; }
        [Parameter("Slow Smooth Type (sma)", DefaultValue = MovingAverageType.Simple)]
        public MovingAverageType inpTypeSmoothSlow { get; set; }
        [Parameter("Volume Periods (12)", DefaultValue = 12)]
        public int inpPeriodsVolume { get; set; }
        [Parameter("Volume Smooth Type (sma)", DefaultValue = MovingAverageType.Simple)]
        public MovingAverageType inpTypeSmoothVolume { get; set; }

        [Output("ZPF Bulls", LineColor = "Green", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
        public IndicatorDataSeries outZPFbulls { get; set; }
        [Output("ZPF Bears", LineColor = "Red", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
        public IndicatorDataSeries outZPFbears { get; set; }
        
        private MovingAverage _smoothfast, _smoothslow, _smoothvol;
        private IndicatorDataSeries _zpf;
        

        protected override void Initialize()
        {
            _smoothfast = Indicators.MovingAverage(Bars.ClosePrices, inpPeriodsFast, inpTypeSmoothFast);
            _smoothslow = Indicators.MovingAverage(Bars.ClosePrices, inpPeriodsSlow, inpTypeSmoothSlow);
            _smoothvol= Indicators.MovingAverage(Bars.TickVolumes, inpPeriodsVolume, inpTypeSmoothVolume);
            _zpf = CreateDataSeries();
        }

        public override void Calculate(int i)
        {
            _zpf[i] = _smoothvol.Result[i] * (_smoothfast.Result[i] - _smoothslow.Result[i]) / (2.0 * Symbol.PipValue);
            
            outZPFbulls[i] = _zpf[i];
            outZPFbears[i] = -_zpf[i];
        }
    }
}

mfejza's avatar
mfejza

Joined on 25.01.2022

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: mZeroPointForce.algo
  • Rating: 5
  • Installs: 586
  • Modified: 28/05/2023 19:21
Comments
Log in to add a comment.
No comments found.