Category Trend  Published on 10/08/2012

Cycle Identifier AL

Description

The cycle Identifier AL marks the tops and bottoms of cycles. It also corrects previous signals marking them as false signals. It can be filtered using a moving average or a relative strength index.


u

MO
moza11

Joined on 30.07.2012

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: CycleIdentifierAL.algo
  • Rating: 4.17
  • Installs: 4257
  • Modified: 13/10/2021 09:54
Comments
Log in to add a comment.
LU
lukasztrader · 4 years ago

Dear @moza11,

I have a problem with this indicator. I wrote post in forum: https://ctrader.com/forum/cbot-support/22712?page=1#1

I would like to get history data that I see on chart with Custom Indicator. OnStart method I would like to get last values from this Indicator.

I don't understand why the data that I print in logs are not the same as I see on the chart. As an example I am looking for all Major Sell or Buy signals.

The logs from below code shows different values compared to values seen on chart. What is more if I loop over all results, there are not possible data as sometimes DotsBuy and DotsSell are at the same time with value = 1. The dots are either Buy or Sell.

The endgame is to have opportunity to create a logic in cBot that after restart the cBot it can get the last Major signal (either it is sell or buy) based on history data from chart.

Please see below code.

using System;

using System.Linq;

using cAlgo.API;

using cAlgo.API.Indicators;

using cAlgo.API.Internals;

using cAlgo.Indicators;

 

namespace cAlgo.Robots

{

    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]

    public class aTestIndi : Robot

    {

        private CycleIdentifierAL cycle;

 

        protected override void OnStart()

        {

            cycle = Indicators.GetIndicator<CycleIdentifierAL>(0, 0, 12, MovingAverageType.Simple, 21, 3, 1, 4);

 

            for (int i = 0; i < 100; i++)

            {

                if (cycle.MajorSell.Last(i) == 1 || cycle.MajorBuy.Last(i) == -1)

                {

                    Print(i);

                    Print("Date: " + MarketSeries.OpenTime.Last(i));

                    Print("cycle.Line.Last(" + i + "): " + cycle.Line.Last(i));

                    Print("cycle.MajorBuy.Last(" + i + "): " + cycle.MajorBuy.Last(i));

                    Print("cycle.MajorSell.Last(" + i + "): " + cycle.MajorSell.Last(i));

                    Print("cycle.MinorBuy.Last(" + i + "): " + cycle.MinorBuy.Last(i));

                    Print("cycle.MinorSell.Last(" + i + "): " + cycle.MinorSell.Last(i));

                    Print("cycle.DotsBuy.Last(" + i + "): " + cycle.DotsBuy.Last(i));

                    Print("cycle.DotsSell.Last(" + i + "): " + cycle.DotsSell.Last(i));

                }

            }

        }

    }

}