how to Set the alarm for the default Ichimoku indicator when the 4 components are equal

Created at 14 Apr 2022, 08:40
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
SA

safaeianmohsen

Joined 14.04.2022

how to Set the alarm for the default Ichimoku indicator when the 4 components are equal
14 Apr 2022, 08:40


hi

can you help me ? 

i want to set alarm for ichimoku defaul indicator when : 4 Ichimoku components are equal . I want to give me  alarm in the live bar ( candle ).

sourse code is below :

usingSystem;

usingcAlgo.API;

usingcAlgo.API.Indicators;

namespacecAlgo.Indicators

{

    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]

    publicclassIchimokuKinkoHyo : Indicator

    {

        [Parameter(DefaultValue = 9)]

        publicintperiodFast { getset; }

        [Parameter(DefaultValue = 26)]

        publicintperiodMedium { getset; }

        [Parameter(DefaultValue = 52)]

        publicintperiodSlow { getset; }

        [Parameter(DefaultValue = 26)]

        publicintDisplacementChikou { getset; }

         

        [Parameter(DefaultValue = 26)]

        publicintDisplacementCloud { getset; }

        [Output("TenkanSen", Color = Colors.Red)]

        publicIndicatorDataSeries TenkanSen { getset; }

        [Output("Kijunsen", Color = Colors.Blue)]

        publicIndicatorDataSeries KijunSen { getset; }

        [Output("ChikouSpan", Color = Colors.DarkViolet)]

        publicIndicatorDataSeries ChikouSpan { getset; }

        [Output("SenkouSpanB", Color = Colors.Red, LineStyle=LineStyle.Lines)]

        publicIndicatorDataSeries SenkouSpanB { getset; }

        [Output("SenkouSpanA", Color = Colors.Green,LineStyle=LineStyle.Lines)]

        publicIndicatorDataSeries SenkouSpanA { getset; }

        doublemaxfast,minfast,maxmedium,minmedium,maxslow,minslow;

        publicoverridevoidCalculate(intindex)

        {

            if((index<periodFast)||(index<periodSlow)){return;}

             

            maxfast = MarketSeries.High[index];

            minfast = MarketSeries.Low[index];

            maxmedium = MarketSeries.High[index];

            minmedium = MarketSeries.Low[index];

            maxslow = MarketSeries.High[index];

            minslow = MarketSeries.Low[index];

             

            for(inti=0;i<periodFast;i++)

            {

                if(maxfast< MarketSeries.High[index-i]){maxfast = MarketSeries.High[index-i];}

                if(minfast> MarketSeries.Low[index-i]){minfast = MarketSeries.Low[index-i];}

            }

            for(inti=0;i<periodMedium;i++)

            {

                if(maxmedium< MarketSeries.High[index-i]){maxmedium = MarketSeries.High[index-i];}

                if(minmedium> MarketSeries.Low[index-i]){minmedium = MarketSeries.Low[index-i];}

            }

            for(inti=0;i<periodSlow;i++)

            {

                if(maxslow< MarketSeries.High[index-i]){maxslow = MarketSeries.High[index-i];}

                if(minslow> MarketSeries.Low[index-i]){minslow = MarketSeries.Low[index-i];}

            }

            TenkanSen[index] = (maxfast + minfast) /2;

            KijunSen[index] = (maxmedium + minmedium) /2;

            ChikouSpan[index-DisplacementChikou] = MarketSeries.Close[index];

             

            SenkouSpanA[index+DisplacementCloud] = (TenkanSen[index] + KijunSen[index]) / 2;

            SenkouSpanB[index+DisplacementCloud] = (maxslow + minslow) / 2;

        }

    }

}


@safaeianmohsen