FIR Slope indicator free

by mfejza in category Oscilator at 12/01/2023
Description

The indicator result, is calculated from FIR (Finite Impulse Response Filter) indicator and price levels

Use histogram as short term trend and dots (green and red) as open position trigger.

For more information about FIR indicator click here

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgocTrader
//this indicator is used as short term trend confirmation

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

namespace cAlgo
{
    [Levels(0)]
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class mFIRslope : Indicator
    {
        [Output("FIR - Finite Impulse Response Filter", IsHistogram =true, LineColor = "Magenta", PlotType = PlotType.Histogram, Thickness = 2)]
        public IndicatorDataSeries outFIRslope { get; set; }
        [Output("OpenLong trigger", LineColor = "Green", PlotType = PlotType.Points, Thickness = 5)]
        public IndicatorDataSeries outLongOpen { get; set; }
        [Output("OpenShort trigger", LineColor = "Red", PlotType = PlotType.Points, Thickness = 5)]
        public IndicatorDataSeries outShortOpen { get; set; }

        private IndicatorDataSeries _price, _fir;


        protected override void Initialize()
        {
            _price = CreateDataSeries();
            _fir = CreateDataSeries();
        }

        public override void Calculate(int i)
        {
            _price[i] = Bars.ClosePrices[i];
            _fir[i] =i>3 ? (_price[i] + 2.0 * _price[i - 1] + 2.0 * _price[i - 2] + _price[i - 3]) / 6.0 : Bars.ClosePrices[i];

            outFIRslope[i] = 0;
            
            if(i>3 && _fir[i] > _fir[i-1] )
                outFIRslope[i] = +0.5;
            if(i>3 && _fir[i] < _fir[i-1] )
                outFIRslope[i] = -0.5;
            if(i>3 && _fir[i] > _fir[i-1] && Bars.ClosePrices[i] > _fir[i])
                outFIRslope[i] = +1.0;
            if(i>3 && _fir[i] < _fir[i-1] && Bars.ClosePrices[i] < _fir[i])
                outFIRslope[i] = -1.0;
                
            outLongOpen[i] = outShortOpen[i] = double.NaN;
            if(i>3 && _fir[i] > _fir[i-1] && Bars.ClosePrices[i] > _fir[i] && Bars.LowPrices[i] < Bars.LowPrices[i-1])
                outLongOpen[i] = +1.0;
            if(i>3 && _fir[i] < _fir[i-1] && Bars.ClosePrices[i] < _fir[i] && Bars.HighPrices[i] > Bars.HighPrices[i-1])
                outShortOpen[i] = -1.0;
        }
    }
}


Comments

robertamano802 - January 13, 2023 @ 17:05

This is exactly what i needed to actually. I write the whole essay about programming and different algorithms and the fact that i can find valuable information is very heartwarming. I also use an app that writes essays for you https://essayshark.com/essay-writing-app.html for help, because you know there are a lot of work, but i think that when time comes, my essay will be ready. So thanks again for the info

estoresharks - January 25, 2023 @ 14:17

eStoreSharks are providing Amazon Storefront Design services. An online store is a window to a business. Customers can see the product, see how the business is run, and see what the business offers. The design of a store will affect whether or not customers choose to shop there. It is important to consider your company’s goals, your budget, and your branding.

0