Category Oscilators  Published on 07/02/2022

Price Cyclicality Function

Description

This oscillator is based of a mathematical model creted by Cristian PĂUNA and Ion LUNGU for the cyclicality of the price evolution. For more detail refer to the following paper:


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

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class PriceCyclicalityFunction : Indicator
    {
        [Parameter("Alpha", DefaultValue = 0.33, MinValue = 0.01)]
        public double Alpha { get; set; }

        [Parameter("MA Short Period", DefaultValue = 20, MinValue = 1)]
        public int MaShortPeriod { get; set; }

        [Parameter("MA Long Period", DefaultValue = 50, MinValue = 1)]
        public int MaLongPeriod { get; set; }

        [Parameter("Cycle Period", DefaultValue = 10, MinValue = 1)]
        public int CyclePeriod { get; set; }

        [Output("PCY")]
        public IndicatorDataSeries Result { get; set; }

        private MovingAverage maShort, maLong;

        private IndicatorDataSeries Delta;


        protected override void Initialize()
        {
            Delta = CreateDataSeries();
            maShort = Indicators.MovingAverage(Bars.TypicalPrices, MaShortPeriod, MovingAverageType.Simple);
            maLong = Indicators.MovingAverage(Bars.TypicalPrices, MaLongPeriod, MovingAverageType.Simple);
        }

        public override void Calculate(int index)
        {
            double delta, maxim, minim;

            if (index < MaShortPeriod || index < MaLongPeriod)
            {
                Result[index] = 0;
                return;
            }

            Delta[index] = maShort.Result[index] - maLong.Result[index];

            if (index > MaShortPeriod + CyclePeriod && index > MaLongPeriod + CyclePeriod)
            {
                maxim = Delta.Maximum(CyclePeriod);
                minim = Delta.Minimum(CyclePeriod);

                delta = 100.0 * (maxim - Delta[index]) / (maxim - minim);
                if (double.IsNaN(delta))
                    delta = Delta[index - 1];
            }
            else
            {
                delta = Delta[index];
            }

            Result[index] = Alpha * (delta - Result[index - 1]) + Result[index - 1];
        }
    }
}


CW
cW22Trader

Joined on 16.03.2021

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: Price Cyclicality Function.algo
  • Rating: 0
  • Installs: 1138
Comments
Log in to add a comment.
RA
raspezdyai · 1 year ago

There is discussion for the role of the calories for the people from popcorn. The quantity of the is popcorn low in calories is studied by the people. Each link is established for the top of the calories for the human body from the popcorn.

RA
raspezdyai · 1 year ago

Greater of light to see by, as well as the way that it consumes a far lesser measure of power consistently. Because of hill man out door living the developing ubiquity of this innovation, Drove outside wall lighting is extremely simple.

RA
raspezdyai · 1 year ago

Vertical excellence, variety and interest to a generally mediocre scene. Garden lattices make professionally wall https://www.bigtexstone.com/ loaded with life and qualities delights. So while arranging your nursery escape space, take some time to consider how nursery designs.

RA
raspezdyai · 1 year ago

An account for the purchase of the supplement is opened and ensured for the comforts. The visits of the https://thetopsupplements.com/ are firm or the terms. Skills are applied for the top of the quality for the supplement and its demand among the youngsters.

RA
raspezdyai · 1 year ago

Some, tight clamp versa have their own restricted jargon of the words and expressions they use in the regular day to day existence custom cake online and can't be useful with this. My recommendation take the spouse to the library to get the audiotapes.

RA
raspezdyai · 1 year ago

References are the absolute most effective ways to find a fair dental specialist in light of the fact that the data about the Dentist Stamford will be coming from somebody you trust. For instance, now and again promotions for dental specialists.

RA
raspezdyai · 1 year ago

Businesses demonstrate a proactive approach to risk mitigation. This can help attract and retain clients, employees and construction liability insurance business partners who value the stability and reliability of a well insured business.

RA
raspezdyai · 1 year ago

New measurement for the health insurances recommended and accepted by the society. The reforms of the hbf dentist are welcomed by the people. Their certifications have been ensured for the use of the liked items for the citizens.

OL
oliviajamy9 · 1 year ago

A thorough business plan, on the other hand, describes exactly the features of the area necessary, as well as what jobs the workers are expected to complete. What the compensation structure is going to be, provides much more information, allowing the reader to provide precise guidance; hence, business plan writing services may be critical in defining exactly what type of assistance is required. People are more likely to use your services if they trust your brand, which a white paper written by a professional whitepaper writing service may help you achieve. You want a white paper writer who will spend time investigating the subject as well as the sector in which you work.

 

EM
emmawattson885 · 2 years ago

I am glad to see your post. In this period of time where the price inflation is very high, it is important to understand the price cyclicality function. Price cyclicality functions are very important to stay in the market and to avoid financial risk. And I am in the financial department of a book writing agency so, for me to understand these functions is very essential. But I don't know how to use them, can you guide me on how to use these functions. 

MI
michael.wilson2364 · 2 years ago

All Essay Roo reviews are useful for newbies. But this is where you can find out the whole truth. So don't waste your time and read the review.
https://essayservices.review/reviews/essayroo-review

AN
aneesayesha952 · 2 years ago

Yes, it is so grateful to see this full view of the Price Cyclicality Function, which is so intellectual and desiring but there is also very beneficial and authentic Cars available from the most famous PROTON-PAKISTAN, which are so amazing in giving their best car for sale to the individuals very perfectly in all over Pakistan.

CH
charlottethomas952 · 2 years ago

Price Cyclicality Function Uncertainty I recognize but nevertheless problems in some equations. Kindly offer a cause of the whole lot because of the reality It might be very beneficial for my net web page that offers online assignment writers and academic assistance. I want to percent with the students so this is why I really want unique information.