Category Other  Published on 03/12/2019

convergence indicator (EMA,Ichimoku,etc)

Description

enjoy your trade ;)


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

namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
    public class originaltemplatewinforms : Indicator
    {
        private Form1 _f1;
        private Thread _thread;
        #region market serie
        private MarketSeries seriesM1, seriesM5, seriesM15, seriesM30, seriesH1, seriesH4, seriesH12, seriesD1;
        #endregion
        #region init color
        System.Drawing.Color bear = System.Drawing.Color.Red;
        System.Drawing.Color bull = System.Drawing.Color.LightGreen;
        System.Drawing.Color neutre = System.Drawing.Color.Empty;
        System.Drawing.Color gold = System.Drawing.Color.Gold;
        #endregion
        #region Ema
        public int periodema = 20;
        private int emaindexm1, emaindexm5, emaindexm15, emaindexm30, emaindexh1, emaindexh4, emaindexH12, emaindexd1;
        private ExponentialMovingAverage emaM1, emaM5, emaM15, emaM30, emaH1, emaH4, emaH12, emaD1;
        private string resemaM1, resemaM5, resemaM15, resemaM30, resemaH1, resemaH4, resemaH12, resemaD1;
        private System.Drawing.Color emam1Color, emam5Color, emam15Color, emam30Color, emah1Color, emah4Color, emah12Color, emad1Color;
        private bool emaisbullishm1 = false, emaisbullishm5 = false, emaisbullishm15 = false, emaisbullishm30 = false, emaisbullishh1 = false, emaisbullishh4 = false, emaisbullishh12 = false, emaisbullishd1 = false;
        private bool emaisbearishm1 = false, emaisbearishm5 = false, emaisbearishm15 = false, emaisbearishm30 = false, emaisbearishh1 = false, emaisbearishh4 = false, emaisbearishh12 = false, emaisbearishd1 = false;
        private bool emaisbullishgoldarrowdraw = false, emaisbearishgoldarrowdraw = false, signalgoldema = true;
        #endregion
        #region Ichimoku
        public int ind = 1;
        private int ichimokuindexm1, ichimokuindexm5, ichimokuindexm15, ichimokuindexm30, ichimokuindexh1, ichimokuindexH4, ichimokuindexh12, ichimokuindexd1;
        private IchimokuKinkoHyo cloudM1, cloudM5, cloudM15, cloudM30, cloudH1, cloudH4, cloudH12, cloudD1;
        private string resM1, resM5, resM15, resM30, resH1, resH4, resH12, resD1;
        private System.Drawing.Color m1Color, m5Color, m15Color, m30Color, h1Color, h4Color, h12Color, d1Color;
        private bool ichimokuisbullishm1 = false, ichimokuisbullishm5 = false, ichimokuisbullishm15 = false, ichimokuisbullishm30 = false, ichimokuisbullishh1 = false, ichimokuisbullishh4 = false, ichimokuisbullishh12 = false, ichimokuisbullishd1 = false;
        private bool ichimokuisbearishm1 = false, ichimokuisbearishm5 = false, ichimokuisbearishm15 = false, ichimokuisbearishm30 = false, ichimokuisbearishh1 = false, ichimokuisbearishh4 = false, ichimokuisbearishh12 = false, ichimokuisbearishd1 = false;
        private bool ichimokuisbullishgoldarrowdraw = false, ichimokuisbearishgoldarrowdraw = false, signalgoldichimoku = true;
        #endregion
        #region RSI
        public int periodrsi = 14;
        private int rsiindexm1, rsiindexm5, rsiindexm15, rsiindexm30, rsiindexh1, rsiindexh4, rsiindexh12, rsiindexd1;
        private RelativeStrengthIndex rsiM1, rsiM5, rsiM15, rsiM30, rsiH1, rsiH4, rsiH12, rsiD1;
        private string resrsim1, resrsim5, resrsim15, resrsim30, resrsih1, resrsih4, resrsih12, resrsid1;
        private System.Drawing.Color rsicolorm1, rsicolorm5, rsicolorm15, rsicolorm30, rsicolorh1, rsicolorh4, rsicolorh12, rsicolord1;
        private bool rsiisbullishm1 = false, rsiisbullishm5 = false, rsiisbullishm15 = false, rsiisbullishm30 = false, rsiisbullishh1 = false, rsiisbullishh4 = false, rsiisbullishh12 = false, rsiisbullishd1 = false;
        private bool rsiisbearishm1 = false, rsiisbearishm5 = false, rsiisbearishm15 = false, rsiisbearishm30 = false, rsiisbearishh1 = false, rsiisbearishh4 = false, rsiisbearishh12 = false, rsiisbearishd1 = false;
        #endregion
        #region Stochastique
        public int kperiodstoc = 11;
        public int slowkperiodstoc = 5;
        public int dperiodstoc = 3;
        private int stocindexm1, stocindexm5, stocindexm15, stocindexm30, stocindexh1, stocindexh4, stocindexh12, stocindexd1;
        private StochasticOscillator stochm1, stochm5, stochm15, stochm30, stochh1, stochh4, stochh12, stochd1;
        private string stocresm1, stocresm5, stocresm15, stocresm30, stocresh1, stocresh4, stocresh12, stocresd1;
        private System.Drawing.Color stoccolorm1, stoccolorm5, stoccolorm15, stoccolorm30, stoccolorh1, stoccolorh4, stoccolorh12, stoccolord1;
        private bool stocisbullishm1 = false, stocisbullishm5 = false, stocisbullishm15 = false, stocisbullishm30 = false, stocisbullishh1 = false, stocisbullishh4 = false, stocisbullishh12 = false, stocisbullishd1 = false;
        private bool stocisbearishm1 = false, stocisbearishm5 = false, stocisbearishm15 = false, stocisbearishm30 = false, stocisbearishh1 = false, stocisbearishh4 = false, stocisbearishh12 = false, stocisbearishd1 = false;
        #endregion
        #region Macd
        public int Shortmacdperiod = 12;
        public int Longmacdperiod = 26;
        public int Signalperiod = 3;
        private int macdindexm1, macdindexm5, macdindexm15, macdindexm30, macdindexh1, macdindexh4, macdindexh12, macdindexd1;
        private MacdCrossOver macdm1, macdm5, macdm15, macdm30, macdh1, macdh4, macdh12, macdd1;
        private string macdresm1, macdresm5, macdresm15, macdresm30, macdresh1, macdresh4, macdresh12, macdresd1, resmacdgold;
        private System.Drawing.Color macdcolorm1, macdcolorm5, macdcolorm15, macdcolorm30, macdcolorh1, macdcolorh4, macdcolorh12, macdcolord1;
        private bool macdisbullishm1 = false, macdisbullishm5 = false, macdisbullishm15 = false, macdisbullishm30 = false, macdisbullishh1 = false, macdisbullishh4 = false, macdisbullishh12 = false, macdisbullishd1 = false;
        private bool macdisbearishm1 = false, macdisbearishm5 = false, macdisbearishm15 = false, macdisbearishm30 = false, macdisbearishh1 = false, macdisbearishh4 = false, macdisbearishh12 = false, macdisbearishd1 = false;
        #endregion
        #region bande de bollinger
        private BollingerBands bbm1, bbm5, bbm15, bbm30, bbh1, bbh4, bbh12, bbd1;
        private IndicatorDataSeries bbmainm1, bbmainm5, bbmainm15, bbmainm30, bbmainh1, bbmainh4, bbmainh12, bbmaind1;
        private IndicatorDataSeries bbtopm1, bbtopm5, bbtopm15, bbtopm30, bbtoph1, bbtoph4, bbtoph12, bbtopd1;
        private IndicatorDataSeries bbbottomm1, bbbottomm5, bbbottomm15, bbbottomm30, bbbottomh1, bbbottomh4, bbbottomh12, bbbottomd1;
        private string resbbmainm1, resbbmainm5, resbbmainm15, resbbmainm30, resbbmainh1, resbbmainh4, resbbmainh12, resbbmaind1;
        private string resbbtopm1, resbbtopm5, resbbtopm15, resbbtopm30, resbbtoph1, resbbtoph4, resbbtoph12, resbbtopd1;
        private string resbbbottomm1, resbbbottomm5, resbbbottomm15, resbbbottomm30, resbbbottomh1, resbbbottomh4, resbbbottomh12, resbbbottomd1;
        private System.Drawing.Color Colorbbmainm1, Colorbbmainm5, Colorbbmainm15, Colorbbmainm30, Colorbbmainh1, Colorbbmainh4, Colorbbmainh12, Colorbbmaind1;
        #endregion
        #region signal gold
        private int ichimokugoldindex, emagoldindex, rsigoldindex, stocgolgindex, macdgoldindex;
        private bool ichimokugoldisbullish = false, emagoldisbullish = false, rsigoldisbullish = false, stocgoldisbullish = false, macdgoldisbullish = false;
        private bool ichimokugoldisbearish = false, emagoldisbearish = false, rsigoldisbearish = false, stocgoldisbearish = false, macdgoldisbearish = false;
        private string ichimokugold, emagold, rsigold, stocgold, macdgold;
        private System.Drawing.Color ichimokugoldcolor, emagoldcolor, rsigoldcolor, Colorstocgold, macdgoldcolor;
        #endregion
        protected override void Initialize()
        {
            #region thread form
            _f1 = new Form1();
            _thread = new Thread(() => _f1.ShowDialog());
            _thread.SetApartmentState(ApartmentState.STA);
            _thread.Start();
            _f1.Text = SymbolName;
            #endregion
            #region indicateur
            #region Serie m1 -> D1
            seriesM1 = MarketData.GetSeries(TimeFrame.Minute);
            seriesM5 = MarketData.GetSeries(TimeFrame.Minute5);
            seriesM15 = MarketData.GetSeries(TimeFrame.Minute15);
            seriesM30 = MarketData.GetSeries(TimeFrame.Minute30);
            seriesH1 = MarketData.GetSeries(TimeFrame.Hour);
            seriesH4 = MarketData.GetSeries(TimeFrame.Hour4);
            seriesH12 = MarketData.GetSeries(TimeFrame.Hour12);
            seriesD1 = MarketData.GetSeries(TimeFrame.Daily);
            #endregion
            #region ema
            emaM1 = Indicators.ExponentialMovingAverage(seriesM1.Close, periodema);
            emaM5 = Indicators.ExponentialMovingAverage(seriesM5.Close, periodema);
            emaM15 = Indicators.ExponentialMovingAverage(seriesM15.Close, periodema);
            emaM30 = Indicators.ExponentialMovingAverage(seriesM30.Close, periodema);
            emaH1 = Indicators.ExponentialMovingAverage(seriesH1.Close, periodema);
            emaH4 = Indicators.ExponentialMovingAverage(seriesH4.Close, periodema);
            emaH12 = Indicators.ExponentialMovingAverage(seriesH12.Close, periodema);
            emaD1 = Indicators.ExponentialMovingAverage(seriesD1.Close, periodema);
            #endregion
            #region Ichimoku
            cloudM1 = Indicators.IchimokuKinkoHyo(seriesM1, 9, 26, 52);
            cloudM5 = Indicators.IchimokuKinkoHyo(seriesM5, 9, 26, 52);
            cloudM15 = Indicators.IchimokuKinkoHyo(seriesM15, 9, 26, 52);
            cloudM30 = Indicators.IchimokuKinkoHyo(seriesM30, 9, 26, 52);
            cloudH1 = Indicators.IchimokuKinkoHyo(seriesH1, 9, 26, 52);
            cloudH4 = Indicators.IchimokuKinkoHyo(seriesH4, 9, 26, 52);
            cloudH12 = Indicators.IchimokuKinkoHyo(seriesH12, 9, 26, 52);
            cloudD1 = Indicators.IchimokuKinkoHyo(seriesD1, 9, 26, 52);
            #endregion
            #region RSI
            rsiM1 = Indicators.RelativeStrengthIndex(seriesM1.Close, periodrsi);
            rsiM5 = Indicators.RelativeStrengthIndex(seriesM5.Close, periodrsi);
            rsiM15 = Indicators.RelativeStrengthIndex(seriesM15.Close, periodrsi);
            rsiM30 = Indicators.RelativeStrengthIndex(seriesM30.Close, periodrsi);
            rsiH1 = Indicators.RelativeStrengthIndex(seriesH1.Close, periodrsi);
            rsiH4 = Indicators.RelativeStrengthIndex(seriesH4.Close, periodrsi);
            rsiH12 = Indicators.RelativeStrengthIndex(seriesH12.Close, periodrsi);
            rsiD1 = Indicators.RelativeStrengthIndex(seriesD1.Close, periodrsi);
            #endregion
            #region Stochastique
            stochm1 = Indicators.StochasticOscillator(seriesM1, kperiodstoc, slowkperiodstoc, dperiodstoc, MovingAverageType.Exponential);
            stochm5 = Indicators.StochasticOscillator(seriesM5, kperiodstoc, slowkperiodstoc, dperiodstoc, MovingAverageType.Exponential);
            stochm15 = Indicators.StochasticOscillator(seriesM15, kperiodstoc, slowkperiodstoc, dperiodstoc, MovingAverageType.Exponential);
            stochm30 = Indicators.StochasticOscillator(seriesM30, kperiodstoc, slowkperiodstoc, dperiodstoc, MovingAverageType.Exponential);
            stochh1 = Indicators.StochasticOscillator(seriesH1, kperiodstoc, slowkperiodstoc, dperiodstoc, MovingAverageType.Exponential);
            stochh4 = Indicators.StochasticOscillator(seriesH4, kperiodstoc, slowkperiodstoc, dperiodstoc, MovingAverageType.Exponential);
            stochh12 = Indicators.StochasticOscillator(seriesH12, kperiodstoc, slowkperiodstoc, dperiodstoc, MovingAverageType.Exponential);
            stochd1 = Indicators.StochasticOscillator(seriesD1, kperiodstoc, slowkperiodstoc, dperiodstoc, MovingAverageType.Exponential);
            #endregion
            #region Macd
            macdm1 = Indicators.MacdCrossOver(seriesM1.Close, Longmacdperiod, Shortmacdperiod, Signalperiod);
            macdm5 = Indicators.MacdCrossOver(seriesM5.Close, Longmacdperiod, Shortmacdperiod, Signalperiod);
            macdm15 = Indicators.MacdCrossOver(seriesM15.Close, Longmacdperiod, Shortmacdperiod, Signalperiod);
            macdm30 = Indicators.MacdCrossOver(seriesM30.Close, Longmacdperiod, Shortmacdperiod, Signalperiod);
            macdh1 = Indicators.MacdCrossOver(seriesH1.Close, Longmacdperiod, Shortmacdperiod, Signalperiod);
            macdh4 = Indicators.MacdCrossOver(seriesH4.Close, Longmacdperiod, Shortmacdperiod, Signalperiod);
            macdh12 = Indicators.MacdCrossOver(seriesH12.Close, Longmacdperiod, Shortmacdperiod, Signalperiod);
            macdd1 = Indicators.MacdCrossOver(seriesD1.Close, Longmacdperiod, Shortmacdperiod, Signalperiod);
            #endregion
            #region bande de bollinger
            bbm1 = Indicators.BollingerBands(seriesM1.Close, 20, 2, MovingAverageType.Exponential);
            bbm5 = Indicators.BollingerBands(seriesM5.Close, 20, 2, MovingAverageType.Exponential);
            bbm15 = Indicators.BollingerBands(seriesM15.Close, 20, 2, MovingAverageType.Exponential);
            bbm30 = Indicators.BollingerBands(seriesM30.Close, 20, 2, MovingAverageType.Exponential);
            bbh1 = Indicators.BollingerBands(seriesH1.Close, 20, 2, MovingAverageType.Exponential);
            bbh4 = Indicators.BollingerBands(seriesH4.Close, 20, 2, MovingAverageType.Exponential);
            bbh12 = Indicators.BollingerBands(seriesH12.Close, 20, 2, MovingAverageType.Exponential);
            bbd1 = Indicators.BollingerBands(seriesD1.Close, 20, 2, MovingAverageType.Exponential);
            #region bb main
            bbmainm1 = bbm1.Main;
            bbmainm5 = bbm5.Main;
            bbmainm15 = bbm15.Main;
            bbmainm30 = bbm30.Main;
            bbmainh1 = bbh1.Main;
            bbmainh4 = bbh4.Main;
            bbmainh12 = bbh12.Main;
            bbmaind1 = bbd1.Main;
            #endregion
            #region bb top
            bbtopm1 = bbm1.Top;
            bbtopm5 = bbm5.Top;
            bbtopm15 = bbm15.Top;
            bbtopm30 = bbm30.Top;
            bbtoph1 = bbh1.Top;
            bbtoph4 = bbh4.Top;
            bbtoph12 = bbh12.Top;
            bbtopd1 = bbd1.Top;
            #endregion
            #region bb top
            bbbottomm1 = bbm1.Bottom;
            bbbottomm5 = bbm5.Bottom;
            bbbottomm15 = bbm15.Bottom;
            bbbottomm30 = bbm30.Bottom;
            bbbottomh1 = bbh1.Bottom;
            bbbottomh4 = bbh4.Bottom;
            bbbottomh12 = bbh12.Bottom;
            bbbottomd1 = bbd1.Bottom;
            #endregion
            #endregion
            #endregion
            Timer.TimerTick += Timer_TimerTick;
            Timer.Start(1);
        }
        private void Timer_TimerTick()
        {
            infocompte();
            ema();
            ichimoku();
            rsi();
            stochastique();
            macd();
            bollinger();
        }
        public void infocompte()
        {
            #region groupbox info compte
            _f1.label1.Text = Bid.ToString();
            _f1.label2.Text = Ask.ToString();
            _f1.labelcapitalvalue.Text = Account.Balance.ToString();
            _f1.labelequityvalue.Text = Account.Equity.ToString();
            _f1.labelmarginvalue.Text = Account.FreeMargin.ToString();
            double wl = Math.Round((Account.Equity - Account.Balance), 2);
            _f1.labelwlvalue.ForeColor = System.Drawing.Color.Green;
            if (wl > 0)
                _f1.labelwlvalue.ForeColor = System.Drawing.Color.Green;
            if (wl < 0)
                _f1.labelwlvalue.ForeColor = System.Drawing.Color.Red;
            _f1.labelwlvalue.Text = string.Format("" + wl);
            double spread = Math.Round(Ask - Bid, 2);
            _f1.labelspreadvalue.Text = spread.ToString();
            #endregion
        }
        public void ema()
        {
            #region groupbox ema
            #region Ema
            #region m1
            if (emaM1.Result.IsFalling())
            {
                emam1Color = bear;
                resemaM1 = "bear";
                emaisbullishm1 = false;
                emaisbearishm1 = true;
            }
            else if (emaM1.Result.IsRising())
            {
                emam1Color = bull;
                resemaM1 = "bull";
                emaisbullishm1 = true;
                emaisbearishm1 = false;
            }
            else
            {
                emam1Color = neutre;
                resemaM1 = "neutre";
                emaisbullishm1 = false;
                emaisbearishm1 = false;
            }
            #endregion
            #region m5
            if (emaM5.Result.IsFalling())
            {
                resemaM5 = "bear";
                emam5Color = bear;
                emaisbullishm5 = false;
                emaisbearishm5 = true;
            }
            else if (emaM5.Result.IsRising())
            {
                resemaM5 = "bull";
                emam5Color = bull;
                emaisbullishm5 = true;
                emaisbearishm5 = false;
            }
            else
            {
                resemaM5 = "neutre";
                emam5Color = neutre;
                emaisbullishm5 = false;
                emaisbearishm5 = false;
            }
            #endregion
            #region m15
            if (emaM15.Result.IsFalling())
            {
                resemaM15 = "bear";
                emam15Color = bear;
                emaisbullishm15 = false;
                emaisbearishm15 = true;
            }
            else if (emaM15.Result.IsRising())
            {
                resemaM15 = "bull";
                emam15Color = bull;
                emaisbullishm15 = true;
                emaisbearishm15 = false;
            }
            else
            {
                resemaM15 = "neutre";
                emam15Color = neutre;
                emaisbullishm15 = false;
                emaisbearishm15 = false;
            }
            #endregion
            #region m30
            if (emaM30.Result.IsFalling())
            {
                resemaM30 = "bear";
                emam30Color = bear;
                emaisbullishm30 = false;
                emaisbearishm30 = true;
            }
            else if (emaM30.Result.IsRising())
            {
                resemaM30 = "bull";
                emam30Color = bull;
                emaisbullishm30 = true;
                emaisbearishm30 = false;
            }
            else
            {
                resemaM30 = "neutre";
                emam30Color = neutre;
                emaisbullishm30 = false;
                emaisbearishm30 = false;
            }
            #endregion
            #region H1
            if (emaH1.Result.IsFalling())
            {
                resemaH1 = "bear";
                emah1Color = bear;
                emaisbullishh1 = false;
                emaisbearishh1 = true;
            }
            else if (emaH1.Result.IsRising())
            {
                resemaH1 = "bull";
                emah1Color = bull;
                emaisbullishh1 = true;
                emaisbearishh1 = false;
            }
            else
            {
                resemaH1 = "neutre";
                emah1Color = neutre;
                emaisbullishh1 = false;
                emaisbearishh1 = false;
            }
            #endregion
            #region H4
            if (emaH4.Result.IsFalling())
            {
                resemaH4 = "bear";
                emah4Color = bear;
                emaisbullishh4 = false;
                emaisbearishh4 = true;
            }
            else if (emaM30.Result.IsRising())
            {
                resemaH4 = "bull";
                emah4Color = bull;
                emaisbullishh4 = true;
                emaisbearishh4 = false;
            }
            else
            {
                resemaH4 = "neutre";
                emah4Color = neutre;
                emaisbullishh4 = false;
                emaisbearishh4 = false;
            }
            #endregion
            #region H12
            if (emaH12.Result.IsFalling())
            {
                resemaH12 = "bear";
                emah12Color = bear;
                emaisbullishh12 = false;
                emaisbearishh12 = true;
            }
            else if (emaH12.Result.IsRising())
            {
                resemaH12 = "bull";
                emah12Color = bull;
                emaisbullishh12 = true;
                emaisbearishh12 = false;
            }
            else
            {
                resemaH12 = "neutre";
                emah12Color = neutre;
                emaisbullishh12 = false;
                emaisbearishh12 = false;
            }
            #endregion
            #region D1
            if (emaD1.Result.IsFalling())
            {
                resemaD1 = "bear";
                emad1Color = bear;
                emaisbullishd1 = false;
                emaisbearishd1 = true;

            }
            else if (emaH12.Result.IsRising())
            {
                resemaD1 = "bull";
                emad1Color = bull;
                emaisbullishd1 = true;
                emaisbearishd1 = false;
            }
            else
            {
                resemaD1 = "neutre";
                emad1Color = neutre;
                emaisbullishd1 = false;
                emaisbearishd1 = false;
            }
            #endregion
            #region gold
            if (emaisbullishm1 && emaisbullishm5 && emaisbullishm15 && emaisbullishm30 && emaisbullishh1 && emaisbullishh4 && emaisbullishh12 && emaisbullishd1)
            {
                emagold = "bull";
                emagoldcolor = gold;
                emagoldisbullish = true;
                emagoldisbearish = false;
            }
            else if (emaisbearishm1 && emaisbearishm5 && emaisbearishm15 && emaisbearishm30 && emaisbearishh1 && emaisbearishh4 && emaisbearishh12 && emaisbearishd1)
            {
                emagold = "bear";
                emagoldcolor = gold;
                emagoldisbullish = false;
                emagoldisbearish = true;
            }
            else
            {
                emagold = "";
                emagoldcolor = neutre;
                emagoldisbullish = false;
                emagoldisbearish = false;
            }
            #endregion
            #endregion
            _f1.labelm1value.Text = resemaM1;
            _f1.labelm1value.BackColor = emam1Color;
            _f1.labelm5value.Text = resemaM5;
            _f1.labelm5value.BackColor = emam5Color;
            _f1.labelm15value.Text = resemaM15;
            _f1.labelm15value.BackColor = emam15Color;
            _f1.labelm30value.Text = resemaM30;
            _f1.labelm30value.BackColor = emam30Color;
            _f1.labelh1value.Text = resemaH1;
            _f1.labelh1value.BackColor = emah1Color;
            _f1.labelh4value.Text = resemaH4;
            _f1.labelh4value.BackColor = emah4Color;
            _f1.labelh12value.Text = resemaH12;
            _f1.labelh12value.BackColor = emah12Color;
            _f1.labeld1value.Text = resemaD1;
            _f1.labeld1value.BackColor = emad1Color;
            _f1.labelgoldvalue.Text = emagold;
            _f1.labelgoldvalue.BackColor = emagoldcolor;
            #endregion
        }
        public void ichimoku()
        {
            #region Ichimoku
            #region m1
            if (seriesM1.Close.LastValue < cloudM1.SenkouSpanA[seriesM1.Close.Count - ind] && seriesM1.Close.LastValue < cloudM1.SenkouSpanB[seriesM1.Close.Count - ind])
            {
                resM1 = "bear";
                m1Color = bear;
                ichimokuisbullishm1 = false;
                ichimokuisbearishm1 = true;

            }
            else if (seriesM1.Close.LastValue > cloudM1.SenkouSpanA[seriesM1.Close.Count - ind] && seriesM1.Close.LastValue > cloudM1.SenkouSpanB[seriesM1.Close.Count - ind])
            {
                resM1 = "bull";
                m1Color = bull;
                ichimokuisbullishm1 = true;
                ichimokuisbearishm1 = false;
            }
            else
            {
                resM1 = "neutre";
                m1Color = neutre;
                ichimokuisbullishm1 = false;
                ichimokuisbearishm1 = false;
            }
            #endregion
            #region m5
            if (seriesM5.Close.LastValue < cloudM5.SenkouSpanA[seriesM5.Close.Count - ind] && seriesM5.Close.LastValue < cloudM5.SenkouSpanB[seriesM5.Close.Count - ind])
            {
                resM5 = "bear";
                m5Color = bear;
                ichimokuisbullishm5 = false;
                ichimokuisbearishm5 = true;
            }
            else if (seriesM5.Close.LastValue > cloudM5.SenkouSpanA[seriesM5.Close.Count - ind] && seriesM5.Close.LastValue > cloudM5.SenkouSpanB[seriesM5.Close.Count - ind])
            {
                resM5 = "bull";
                m5Color = bull;
                ichimokuisbullishm5 = true;
                ichimokuisbearishm5 = false;
            }
            else
            {
                resM5 = "neutre";
                m5Color = neutre;
                ichimokuisbullishm5 = false;
                ichimokuisbearishm5 = false;
            }
            #endregion
            #region m15
            if (seriesM15.Close.LastValue < cloudM15.SenkouSpanA[seriesM15.Close.Count - ind] && seriesM15.Close.LastValue < cloudM15.SenkouSpanB[seriesM15.Close.Count - ind])
            {
                resM15 = "bear";
                m15Color = bear;
                ichimokuisbullishm15 = false;
                ichimokuisbearishm15 = true;
            }
            else if (seriesM15.Close.LastValue > cloudM15.SenkouSpanA[seriesM15.Close.Count - ind] && seriesM15.Close.LastValue > cloudM15.SenkouSpanB[seriesM15.Close.Count - ind])
            {
                resM15 = "bull";
                m15Color = bull;
                ichimokuisbullishm15 = true;
                ichimokuisbearishm15 = false;
            }
            else
            {
                resM15 = "neutre";
                m15Color = neutre;
                ichimokuisbullishm1 = false;
                ichimokuisbearishm1 = false;
            }
            #endregion
            #region m30
            if (seriesM30.Close.LastValue < cloudM30.SenkouSpanA[seriesM30.Close.Count - ind] && seriesM30.Close.LastValue < cloudM30.SenkouSpanB[seriesM30.Close.Count - ind])
            {
                resM30 = "bear";
                m30Color = bear;
                ichimokuisbullishm30 = false;
                ichimokuisbearishm30 = true;
            }
            else if (seriesM30.Close.LastValue > cloudM30.SenkouSpanA[seriesM30.Close.Count - ind] && seriesM30.Close.LastValue > cloudM30.SenkouSpanB[seriesM30.Close.Count - ind])
            {
                resM30 = "bull";
                m30Color = bull;
                ichimokuisbullishm30 = true;
                ichimokuisbearishm30 = false;
            }
            else
            {
                resM30 = "neutre";
                m30Color = neutre;
                ichimokuisbullishm1 = false;
                ichimokuisbearishm1 = false;
            }
            #endregion
            #region H1
            if (seriesH1.Close.LastValue < cloudH1.SenkouSpanA[seriesH1.Close.Count - ind] && seriesH1.Close.LastValue < cloudH1.SenkouSpanB[seriesH1.Close.Count - ind])
            {
                resH1 = "bear";
                h1Color = bear;
                ichimokuisbullishh1 = false;
                ichimokuisbearishh1 = true;
            }
            else if (seriesH1.Close.LastValue > cloudH1.SenkouSpanA[seriesH1.Close.Count - ind] && seriesH1.Close.LastValue > cloudH1.SenkouSpanB[seriesH1.Close.Count - ind])
            {
                resH1 = "bull";
                h1Color = bull;
                ichimokuisbullishh1 = true;
                ichimokuisbearishh1 = false;
            }
            else
            {
                resH1 = "neutre";
                h1Color = neutre;
                ichimokuisbullishh1 = false;
                ichimokuisbearishh1 = false;
            }
            #endregion
            #region H4
            if (seriesH4.Close.LastValue < cloudH4.SenkouSpanA[seriesH4.Close.Count - ind] && seriesH4.Close.LastValue < cloudH4.SenkouSpanB[seriesH4.Close.Count - ind])
            {
                resH4 = "bear";
                h4Color = bear;
                ichimokuisbullishh4 = false;
                ichimokuisbearishh4 = true;
            }
            else if (seriesH4.Close.LastValue > cloudH4.SenkouSpanA[seriesH4.Close.Count - ind] && seriesH4.Close.LastValue > cloudH4.SenkouSpanB[seriesH4.Close.Count - ind])
            {
                resH4 = "bull";
                h4Color = bull;
                ichimokuisbullishh4 = true;
                ichimokuisbearishh4 = false;
            }
            else
            {
                resH4 = "neutre";
                h4Color = neutre;
                ichimokuisbullishh4 = false;
                ichimokuisbearishh4 = false;
            }
            #endregion
            #region H12
            if (seriesH12.Close.LastValue < cloudH12.SenkouSpanA[seriesH12.Close.Count - ind] && seriesH12.Close.LastValue < cloudH12.SenkouSpanB[seriesH12.Close.Count - ind])
            {
                resH12 = "bear";
                h12Color = bear;
                ichimokuisbullishh12 = false;
                ichimokuisbearishh12 = true;
            }
            else if (seriesH12.Close.LastValue > cloudH12.SenkouSpanA[seriesH12.Close.Count - ind] && seriesH12.Close.LastValue > cloudH12.SenkouSpanB[seriesH12.Close.Count - ind])
            {
                resH12 = "bull";
                h12Color = bull;
                ichimokuisbullishh12 = true;
                ichimokuisbearishh12 = false;
            }
            else
            {
                resH12 = "neutre";
                h12Color = neutre;
                ichimokuisbullishh12 = false;
                ichimokuisbearishh12 = false;
            }
            #endregion
            #region D1
            if (seriesD1.Close.LastValue < cloudD1.SenkouSpanA[seriesD1.Close.Count - ind] && seriesD1.Close.LastValue < cloudD1.SenkouSpanB[seriesD1.Close.Count - ind])
            {
                resD1 = "bear";
                d1Color = bear;
                ichimokuisbullishd1 = false;
                ichimokuisbearishd1 = true;
            }
            else if (seriesD1.Close.LastValue > cloudD1.SenkouSpanA[seriesD1.Close.Count - ind] && seriesD1.Close.LastValue > cloudD1.SenkouSpanB[seriesD1.Close.Count - ind])
            {
                resD1 = "bull";
                d1Color = bull;
                ichimokuisbullishd1 = true;
                ichimokuisbearishd1 = false;
            }
            else
            {
                resD1 = "neutre";
                d1Color = neutre;
                ichimokuisbullishd1 = false;
                ichimokuisbearishd1 = false;
            }
            #endregion
            #region gold
            if (ichimokuisbullishm1 && ichimokuisbullishm5 && ichimokuisbullishm15 && ichimokuisbullishm30 && ichimokuisbullishh1 && ichimokuisbullishh4 && ichimokuisbullishh12 && ichimokuisbullishd1)
            {
                ichimokugold = "bull";
                ichimokugoldcolor = gold;
                ichimokugoldisbullish = true;
                ichimokugoldisbearish = false;
            }
            else if (ichimokuisbearishm1 && ichimokuisbearishm5 && ichimokuisbearishm15 && ichimokuisbearishm30 && ichimokuisbearishh1 && ichimokuisbearishh4 && ichimokuisbearishh12 && ichimokuisbearishd1)
            {
                ichimokugold = "bear";
                ichimokugoldcolor = gold;
                ichimokugoldisbullish = false;
                ichimokugoldisbearish = true;
            }
            else
            {
                ichimokugold = "";
                ichimokugoldcolor = neutre;
                ichimokugoldisbullish = false;
                ichimokugoldisbearish = false;
            }
            #endregion
            _f1.labelichimokum1value.Text = resM1;
            _f1.labelichimokum1value.BackColor = m1Color;
            _f1.labelichimokum5value.Text = resM5;
            _f1.labelichimokum5value.BackColor = m5Color;
            _f1.labelichimokum15value.Text = resM15;
            _f1.labelichimokum15value.BackColor = m15Color;
            _f1.labelichimokum30value.Text = resM30;
            _f1.labelichimokum30value.BackColor = m30Color;
            _f1.labelichimokuh1value.Text = resH1;
            _f1.labelichimokuh1value.BackColor = h1Color;
            _f1.labelichimokuh4value.Text = resH4;
            _f1.labelichimokuh4value.BackColor = h4Color;
            _f1.labelichimokuh12value.Text = resH12;
            _f1.labelichimokuh12value.BackColor = h12Color;
            _f1.labelichimokud1value.Text = resD1;
            _f1.labelichimokud1value.BackColor = d1Color;
            _f1.labelichimokugoldvalue.Text = ichimokugold;
            _f1.labelichimokugoldvalue.BackColor = ichimokugoldcolor;
            #endregion
        }
        public void rsi()
        {
            #region RSI
            #region m1
            if (rsiM1.Result.IsFalling())
            {
                resrsim1 = "bear";
                rsicolorm1 = bear;
                rsiisbullishm1 = false;
                rsiisbearishm1 = true;
            }
            else if (rsiM1.Result.IsRising())
            {
                resrsim1 = "bull";
                rsicolorm1 = bull;
                rsiisbullishm1 = true;
                rsiisbearishm1 = false;
            }
            else
            {
                resrsim1 = "neutre";
                rsicolorm1 = neutre;
                rsiisbullishm1 = false;
                rsiisbearishm1 = false;
            }
            #endregion
            #region m5
            if (rsiM5.Result.IsFalling())
            {
                resrsim5 = "bear";
                rsicolorm5 = bear;
                rsiisbullishm5 = false;
                rsiisbearishm5 = true;
            }
            else if (rsiM5.Result.IsRising())
            {
                resrsim5 = "bull";
                rsicolorm5 = bull;
                rsiisbullishm5 = true;
                rsiisbearishm5 = false;
            }
            else
            {
                resrsim5 = "neutre";
                rsicolorm5 = neutre;
                rsiisbullishm5 = false;
                rsiisbearishm5 = false;
            }
            #endregion
            #region m15
            if (rsiM15.Result.IsFalling())
            {
                resrsim15 = "bear";
                rsicolorm15 = bear;
                rsiisbullishm15 = false;
                rsiisbearishm15 = true;
            }
            else if (rsiM15.Result.IsRising())
            {
                resrsim15 = "bull";
                rsicolorm15 = bull;
                rsiisbullishm15 = true;
                rsiisbearishm15 = false;
            }
            else
            {
                resrsim15 = "neutre";
                rsicolorm15 = neutre;
                rsiisbullishm15 = false;
                rsiisbearishm15 = false;
            }
            #endregion
            #region m30
            if (rsiM30.Result.IsFalling())
            {
                resrsim30 = "bear";
                rsicolorm30 = bear;
                rsiisbullishm30 = false;
                rsiisbearishm30 = true;
            }
            else if (rsiM30.Result.IsRising())
            {
                resrsim30 = "bull";
                rsicolorm30 = bull;
                rsiisbullishm30 = true;
                rsiisbearishm30 = false;
            }
            else
            {
                resrsim30 = "neutre";
                rsicolorm30 = neutre;
                rsiisbullishm30 = false;
                rsiisbearishm30 = false;
            }
            #endregion
            #region h1
            if (rsiH1.Result.IsFalling())
            {
                resrsih1 = "bear";
                rsicolorh1 = bear;
                rsiisbullishh1 = false;
                rsiisbearishh1 = true;
            }
            else if (rsiH1.Result.IsRising())
            {
                resrsih1 = "bull";
                rsicolorh1 = bull;
                rsiisbullishh1 = true;
                rsiisbearishh1 = false;
            }
            else
            {
                resrsih1 = "neutre";
                rsicolorh1 = neutre;
                rsiisbullishh1 = false;
                rsiisbearishh1 = false;
            }
            #endregion
            #region h4
            if (rsiH4.Result.IsFalling())
            {
                resrsih4 = "bear";
                rsicolorh4 = bear;
                rsiisbullishh4 = false;
                rsiisbearishh4 = true;
            }
            else if (rsiH4.Result.IsRising())
            {
                resrsih4 = "bull";
                rsicolorh4 = bull;
                rsiisbullishh4 = true;
                rsiisbearishh4 = false;
            }
            else
            {
                resrsih4 = "neutre";
                rsicolorh4 = neutre;
                rsiisbullishh4 = false;
                rsiisbearishh4 = false;
            }
            #endregion
            #region h12
            if (rsiH1.Result.IsFalling())
            {
                resrsih12 = "bear";
                rsicolorh12 = bear;
                rsiisbullishh12 = false;
                rsiisbearishh12 = true;
            }
            else if (rsiH12.Result.IsRising())
            {
                resrsih12 = "bull";
                rsicolorh12 = bull;
                rsiisbullishh12 = true;
                rsiisbearishh12 = false;
            }
            else
            {
                resrsih12 = "neutre";
                rsicolorh12 = neutre;
                rsiisbullishh12 = false;
                rsiisbearishh12 = false;
            }
            #endregion
            #region d1
            if (rsiD1.Result.IsFalling())
            {
                resrsid1 = "bear";
                rsicolord1 = bear;
                rsiisbullishd1 = false;
                rsiisbearishd1 = true;
            }
            else if (rsiD1.Result.IsRising())
            {
                resrsid1 = "bull";
                rsicolord1 = bull;
                rsiisbullishd1 = true;
                rsiisbearishd1 = false;
            }
            else
            {
                resrsid1 = "neutre";
                rsicolord1 = neutre;
                rsiisbullishd1 = false;
                rsiisbearishd1 = false;
            }
            #endregion
            #region gold

            if (rsiisbullishm1 && rsiisbullishm5 && rsiisbullishm15 && rsiisbullishm30 && rsiisbullishh1 && rsiisbullishh4 && rsiisbullishh12 && rsiisbullishd1)
            {
                rsigold = "bull";
                rsigoldcolor = gold;
                rsigoldisbullish = true;
                rsigoldisbearish = false;
            }
            else if (rsiisbearishm1 && rsiisbearishm5 && rsiisbearishm15 && rsiisbearishm30 && rsiisbearishh1 && rsiisbearishh4 && rsiisbearishh12 && rsiisbearishd1)
            {
                rsigold = "bear";
                rsigoldcolor = gold;
                rsigoldisbullish = false;
                rsigoldisbearish = true;
            }
            else
            {
                rsigold = "";
                rsigoldcolor = neutre;
                rsigoldisbullish = false;
                rsigoldisbearish = false;
            }
            #endregion
            _f1.labelrsim1value.Text = resrsim1;
            _f1.labelrsim1value.BackColor = rsicolorm1;
            _f1.labelrsim5value.Text = resrsim5;
            _f1.labelrsim5value.BackColor = rsicolorm5;
            _f1.labelrsim15value.Text = resrsim15;
            _f1.labelrsim15value.BackColor = rsicolorm15;
            _f1.labelrsim30value.Text = resrsim30;
            _f1.labelrsim30value.BackColor = rsicolorm30;
            _f1.labelrsih1value.Text = resrsih1;
            _f1.labelrsih1value.BackColor = rsicolorh1;
            _f1.labelrsih4value.Text = resrsih4;
            _f1.labelrsih4value.BackColor = rsicolorh4;
            _f1.labelrsih12value.Text = resrsih12;
            _f1.labelrsih12value.BackColor = rsicolorh12;
            _f1.labelrsid1value.Text = resrsid1;
            _f1.labelrsid1value.BackColor = rsicolord1;
            _f1.labelrsigoldvalue.Text = rsigold;
            _f1.labelrsigoldvalue.BackColor = rsigoldcolor;
            #endregion
        }
        public void stochastique()
        {
            #region Stochastique
            var Stochastiquehighlevel = 80;
            var Stochastiquelowlevel = 20;
            #region m1
            if (stochm1.PercentD.IsFalling() && stochm1.PercentD.LastValue < Stochastiquehighlevel)
            {
                stocresm1 = "bear";
                stoccolorm1 = bear;
                stocisbullishm1 = false;
                stocisbearishm1 = true;
            }
            else if (stochm1.PercentD.IsRising() && stochm1.PercentD.LastValue > Stochastiquelowlevel)
            {
                stocresm1 = "bull";
                stoccolorm1 = bull;
                stocisbullishm1 = true;
                stocisbearishm1 = false;
            }
            else
            {
                stocresm1 = "neutre";
                stoccolorm1 = neutre;
                stocisbullishm1 = false;
                stocisbearishm1 = false;
            }
            #endregion
            #region m5
            if (stochm5.PercentD.IsFalling() && stochm5.PercentD.LastValue < Stochastiquehighlevel)
            {
                stocresm5 = "bear";
                stoccolorm5 = bear;
                stocisbullishm5 = false;
                stocisbearishm5 = true;
            }
            else if (stochm1.PercentD.IsRising() && stochm1.PercentD.LastValue > Stochastiquelowlevel)
            {
                stocresm5 = "bull";
                stoccolorm5 = bull;
                stocisbullishm5 = true;
                stocisbearishm5 = false;
            }
            else
            {
                stocresm5 = "neutre";
                stoccolorm5 = neutre;
                stocisbullishm5 = false;
                stocisbearishm5 = false;
            }
            #endregion
            #region m15
            if (stochm15.PercentD.IsFalling() && stochm15.PercentD.LastValue < Stochastiquehighlevel)
            {
                stocresm15 = "bear";
                stoccolorm15 = bear;
                stocisbullishm15 = false;
                stocisbearishm15 = true;
            }
            else if (stochm15.PercentD.IsRising() && stochm15.PercentD.LastValue > Stochastiquelowlevel)
            {
                stocresm15 = "bull";
                stoccolorm15 = bull;
                stocisbullishm15 = true;
                stocisbearishm15 = false;
            }
            else
            {
                stocresm15 = "neutre";
                stoccolorm15 = neutre;
                stocisbullishm15 = false;
                stocisbearishm15 = false;
            }
            #endregion
            #region m30
            if (stochm30.PercentD.IsFalling() && stochm30.PercentD.LastValue < Stochastiquehighlevel)
            {
                stocresm30 = "bear";
                stoccolorm30 = bear;
                stocisbullishm30 = false;
                stocisbearishm30 = true;
            }
            else if (stochm30.PercentD.IsRising() && stochm30.PercentD.LastValue > Stochastiquelowlevel)
            {
                stocresm30 = "bull";
                stoccolorm30 = bull;
                stocisbullishm30 = true;
                stocisbearishm30 = false;
            }
            else
            {
                stocresm30 = "neutre";
                stoccolorm30 = neutre;
                stocisbullishm30 = false;
                stocisbearishm30 = false;
            }
            #endregion
            #region h1
            if (stochh1.PercentD.IsFalling() && stochh1.PercentD.LastValue < Stochastiquehighlevel)
            {
                stocresh1 = "bear";
                stoccolorh1 = bear;
                stocisbullishh1 = false;
                stocisbearishh1 = true;
            }
            else if (stochh1.PercentD.IsRising() && stochh1.PercentD.LastValue > Stochastiquelowlevel)
            {
                stocresh1 = "bull";
                stoccolorh1 = bull;
                stocisbullishh1 = true;
                stocisbearishh1 = false;
            }
            else
            {
                stocresh1 = "neutre";
                stoccolorh1 = neutre;
                stocisbullishh1 = false;
                stocisbearishh1 = false;
            }
            #endregion
            #region h4
            if (stochh4.PercentD.IsFalling() && stochh4.PercentD.LastValue < Stochastiquehighlevel)
            {
                stocresh4 = "bear";
                stoccolorh4 = bear;
                stocisbullishh4 = false;
                stocisbearishh4 = true;
            }
            else if (stochh4.PercentD.IsRising() && stochh4.PercentD.LastValue > Stochastiquelowlevel)
            {
                stocresh4 = "bull";
                stoccolorh4 = bull;
                stocisbullishh4 = true;
                stocisbearishh4 = false;
            }
            else
            {
                stocresh4 = "neutre";
                stoccolorh4 = neutre;
                stocisbullishh4 = false;
                stocisbearishh4 = false;
            }
            #endregion
            #region h12
            if (stochh12.PercentD.IsFalling() && stochh12.PercentD.LastValue < Stochastiquehighlevel)
            {
                stocresh12 = "bear";
                stoccolorh12 = bear;
                stocisbullishh12 = false;
                stocisbearishh12 = true;
            }
            else if (stochh12.PercentD.IsRising() && stochh12.PercentD.LastValue > Stochastiquelowlevel)
            {
                stocresh12 = "bull";
                stoccolorh12 = bull;
                stocisbullishh12 = true;
                stocisbearishh12 = false;
            }
            else
            {
                stocresh12 = "neutre";
                stoccolorh12 = neutre;
                stocisbullishh12 = false;
                stocisbearishh12 = false;
            }
            #endregion
            #region d1
            if (stochd1.PercentD.IsFalling() && stochd1.PercentD.LastValue < Stochastiquehighlevel)
            {
                stocresd1 = "bear";
                stoccolord1 = bear;
                stocisbullishd1 = false;
                stocisbearishd1 = true;
            }
            else if (stochd1.PercentD.IsRising() && stochd1.PercentD.LastValue > Stochastiquelowlevel)
            {
                stocresd1 = "bull";
                stoccolord1 = bull;
                stocisbullishd1 = true;
                stocisbearishd1 = false;
            }
            else
            {
                stocresd1 = "neutre";
                stoccolord1 = neutre;
                stocisbullishd1 = false;
                stocisbearishd1 = false;
            }
            #endregion
            #region gold
            if (stocisbullishm1 && stocisbullishm5 && stocisbullishm15 && stocisbullishm30 && stocisbullishh1 && stocisbullishh4 && stocisbullishh12 && stocisbullishd1)
            {
                stocgold = "bull";
                Colorstocgold = gold;
                stocgoldisbullish = true;
                stocgoldisbearish = false;
            }
            else if (stocisbearishm1 && stocisbearishm5 && stocisbearishm15 && stocisbearishm30 && stocisbearishh1 && stocisbearishh4 && stocisbearishh12 && stocisbearishd1)
            {
                stocgold = "bear";
                Colorstocgold = gold;
                stocgoldisbullish = false;
                stocgoldisbearish = true;
            }
            else
            {
                stocgold = "";
                Colorstocgold = neutre;
                stocgoldisbullish = false;
                stocgoldisbearish = false;
            }
            #endregion
            _f1.labelstochm1value.Text = stocresm1;
            _f1.labelstochm1value.BackColor = stoccolorm1;
            _f1.labelstochm5value.Text = stocresm5;
            _f1.labelstochm5value.BackColor = stoccolorm5;
            _f1.labelstochm15value.Text = stocresm15;
            _f1.labelstochm15value.BackColor = stoccolorm15;
            _f1.labelstochm30value.Text = stocresm30;
            _f1.labelstochm30value.BackColor = stoccolorm30;
            _f1.labelstochh1value.Text = stocresh1;
            _f1.labelstochh1value.BackColor = stoccolorh1;
            _f1.labelstochh4value.Text = stocresh4;
            _f1.labelstochh4value.BackColor = stoccolorh4;
            _f1.labelstochh12value.Text = stocresh12;
            _f1.labelstochh12value.BackColor = stoccolorh12;
            _f1.labelstochd1value.Text = stocresd1;
            _f1.labelstochd1value.BackColor = stoccolord1;
            _f1.labelstochgoldvalue.Text = stocgold;
            _f1.labelstochgoldvalue.BackColor = Colorstocgold;
            #endregion
        }
        public void macd()
        {
            #region macd
            #region m1
            if (macdm1.MACD.IsFalling())
            {
                macdresm1 = "bear";
                macdcolorm1 = bear;
                macdisbullishm1 = false;
                macdisbearishm1 = true;
            }
            else if (macdm1.MACD.IsRising())
            {
                macdresm1 = "bull";
                macdcolorm1 = bull;
                macdisbullishm1 = true;
                macdisbearishm1 = false;
            }
            else
            {
                macdresm1 = "neutre";
                macdcolorm1 = neutre;
                macdisbullishm1 = false;
                macdisbearishm1 = false;
            }
            #endregion
            #region m5
            if (macdm5.MACD.IsFalling())
            {
                macdresm5 = "bear";
                macdcolorm5 = bear;
                macdisbullishm5 = false;
                macdisbearishm5 = true;
            }
            else if (macdm5.MACD.IsRising())
            {
                macdresm5 = "bull";
                macdcolorm5 = bull;
                macdisbullishm5 = true;
                macdisbearishm5 = false;
            }
            else
            {
                macdresm5 = "neutre";
                macdcolorm5 = neutre;
                macdisbullishm5 = false;
                macdisbearishm5 = false;
            }
            #endregion
            #region m15
            if (macdm15.MACD.IsFalling())
            {
                macdresm15 = "bear";
                macdcolorm15 = bear;
                macdisbullishm15 = false;
                macdisbearishm15 = true;
            }
            else if (macdm15.MACD.IsRising())
            {
                macdresm15 = "bull";
                macdcolorm15 = bull;
                macdisbullishm15 = true;
                macdisbearishm15 = false;
            }
            else
            {
                macdresm15 = "neutre";
                macdcolorm15 = neutre;
                macdisbullishm15 = false;
                macdisbearishm15 = false;
            }
            #endregion
            #region m30
            if (macdm30.MACD.IsFalling())
            {
                macdresm30 = "bear";
                macdcolorm30 = bear;
                macdisbullishm30 = false;
                macdisbearishm30 = true;
            }
            else if (macdm30.MACD.IsRising())
            {
                macdresm30 = "bull";
                macdcolorm30 = bull;
                macdisbullishm30 = true;
                macdisbearishm30 = false;
            }
            else
            {
                macdresm30 = "neutre";
                macdcolorm30 = neutre;
                macdisbullishm30 = false;
                macdisbearishm30 = false;
            }
            #endregion
            #region h1
            if (macdh1.MACD.IsFalling())
            {
                macdresh1 = "bear";
                macdcolorh1 = bear;
                macdisbullishh1 = false;
                macdisbearishh1 = true;
            }
            else if (macdh1.MACD.IsRising())
            {
                macdresh1 = "bull";
                macdcolorh1 = bull;
                macdisbullishh1 = true;
                macdisbearishh1 = false;
            }
            else
            {
                macdresh1 = "neutre";
                macdcolorh1 = neutre;
                macdisbullishh1 = false;
                macdisbearishh1 = false;
            }
            #endregion
            #region h4
            if (macdh4.MACD.IsFalling())
            {
                macdresh4 = "bear";
                macdcolorh4 = bear;
                macdisbullishh4 = false;
                macdisbearishh4 = true;
            }
            else if (macdh4.MACD.IsRising())
            {
                macdresh4 = "bull";
                macdcolorh4 = bull;
                macdisbullishh4 = true;
                macdisbearishh4 = false;
            }
            else
            {
                macdresh4 = "neutre";
                macdcolorh4 = neutre;
                macdisbullishh4 = false;
                macdisbearishh4 = false;
            }
            #endregion
            #region h12
            if (macdh12.MACD.IsFalling())
            {
                macdresh12 = "bear";
                macdcolorh12 = bear;
                macdisbullishh12 = false;
                macdisbearishh12 = true;
            }
            else if (macdh12.MACD.IsRising())
            {
                macdresh12 = "bull";
                macdcolorh12 = bull;
                macdisbullishh12 = true;
                macdisbearishh12 = false;
            }
            else
            {
                macdresh12 = "neutre";
                macdcolorh12 = neutre;
                macdisbullishh12 = false;
                macdisbearishh12 = false;
            }
            #endregion
            #region d1
            if (macdd1.MACD.IsFalling())
            {
                macdresd1 = "bear";
                macdcolord1 = bear;
                macdisbullishd1 = false;
                macdisbearishd1 = true;
            }
            else if (macdd1.MACD.IsRising())
            {
                macdresd1 = "bull";
                macdcolord1 = bull;
                macdisbullishd1 = true;
                macdisbearishd1 = false;
            }
            else
            {
                macdresd1 = "neutre";
                macdcolord1 = neutre;
                macdisbullishd1 = false;
                macdisbearishd1 = false;
            }
            #endregion
            #region gold
            if (macdisbullishm1 && macdisbullishm5 && macdisbullishm15 && macdisbullishm30 && macdisbullishh1 && macdisbullishh4 && macdisbullishh12 && macdisbullishd1)
            {
                macdgold = "bull";
                macdgoldcolor = gold;
                macdgoldisbullish = true;
                macdgoldisbearish = false;
            }
            else if (macdisbearishm1 && macdisbearishm5 && macdisbearishm15 && macdisbearishm30 && macdisbearishh1 && macdisbearishh4 && macdisbearishh12 && macdisbearishd1)
            {
                macdgold = "bear";
                macdgoldcolor = gold;
                macdgoldisbullish = false;
                macdgoldisbearish = true;
            }
            else
            {
                macdgold = "";
                macdgoldcolor = neutre;
                macdgoldisbullish = false;
                macdgoldisbearish = false;
            }
            #endregion
            _f1.labelmacdm1value.Text = macdresm1;
            _f1.labelmacdm1value.BackColor = macdcolorm1;
            _f1.labelmacdm5value.Text = macdresm5;
            _f1.labelmacdm5value.BackColor = macdcolorm5;
            _f1.labelmacdm15value.Text = macdresm15;
            _f1.labelmacdm15value.BackColor = macdcolorm15;
            _f1.labelmacdm30value.Text = macdresm30;
            _f1.labelmacdm30value.BackColor = macdcolorm30;
            _f1.labelmacdh1value.Text = macdresh1;
            _f1.labelmacdh1value.BackColor = macdcolorh1;
            _f1.labelmacdh4value.Text = macdresh4;
            _f1.labelmacdh4value.BackColor = macdcolorh4;
            _f1.labelmacdh12value.Text = macdresh12;
            _f1.labelmacdh12value.BackColor = macdcolorh12;
            _f1.labelmacdd1value.Text = macdresd1;
            _f1.labelmacdd1value.BackColor = macdcolord1;
            _f1.labelmacdgoldvalue.Text = macdgold;
            _f1.labelmacdgoldvalue.BackColor = macdgoldcolor;
            #endregion
        }
        public void bollinger()
        {
            #region bande de bollinger
            #region main
            resbbmainm1 = bbmainm1.LastValue.ToString();
            resbbmainm5 = bbmainm5.LastValue.ToString();
            resbbmainm15 = bbmainm15.LastValue.ToString();
            resbbmainm30 = bbmainm30.LastValue.ToString();
            resbbmainh1 = bbmainh1.LastValue.ToString();
            resbbmainh4 = bbmainh4.LastValue.ToString();
            resbbmainh12 = bbmainh12.LastValue.ToString();
            resbbmaind1 = bbmaind1.LastValue.ToString();

            _f1.labelbbmm1.Text = resbbmainm1;
            _f1.labelbbmm5.Text = resbbmainm5;
            _f1.labelbbmm15.Text = resbbmainm15;
            _f1.labelbbmm30.Text = resbbmainm30;
            _f1.labelbbmh1.Text = resbbmainh1;
            _f1.labelbbmh4.Text = resbbmainh4;
            _f1.labelbbmh12.Text = resbbmainh12;
            _f1.labelbbmd1.Text = resbbmaind1;
            #endregion
            #region top
            resbbtopm1 = bbtopm1.LastValue.ToString();
            resbbtopm5 = bbtopm5.LastValue.ToString();
            resbbtopm15 = bbtopm15.LastValue.ToString();
            resbbtopm30 = bbtopm30.LastValue.ToString();
            resbbtoph1 = bbtoph1.LastValue.ToString();
            resbbtoph4 = bbtoph4.LastValue.ToString();
            resbbtoph12 = bbtoph12.LastValue.ToString();
            resbbtopd1 = bbtopd1.LastValue.ToString();

            _f1.labelbbtm1.Text = resbbtopm1;
            _f1.labelbbtm5.Text = resbbtopm5;
            _f1.labelbbtm15.Text = resbbtopm15;
            _f1.labelbbtm30.Text = resbbtopm30;
            _f1.labelbbth1.Text = resbbtoph1;
            _f1.labelbbth4.Text = resbbtoph4;
            _f1.labelbbth12.Text = resbbtoph12;
            _f1.labelbbtd1.Text = resbbtopd1;
            #endregion
            #region bottom
            resbbbottomm1 = bbbottomm1.LastValue.ToString();
            resbbbottomm5 = bbbottomm5.LastValue.ToString();
            resbbbottomm15 = bbbottomm15.LastValue.ToString();
            resbbbottomm30 = bbbottomm30.LastValue.ToString();
            resbbbottomh1 = bbbottomh1.LastValue.ToString();
            resbbbottomh4 = bbbottomh4.LastValue.ToString();
            resbbbottomh12 = bbbottomh12.LastValue.ToString();
            resbbbottomd1 = bbbottomd1.LastValue.ToString();

            _f1.labelbbbm1.Text = resbbbottomm1;
            _f1.labelbbbm5.Text = resbbbottomm5;
            _f1.labelbbbm15.Text = resbbbottomm15;
            _f1.labelbbbm30.Text = resbbbottomm30;
            _f1.labelbbbh1.Text = resbbbottomh1;
            _f1.labelbbbh4.Text = resbbbottomh4;
            _f1.labelbbbh12.Text = resbbbottomh12;
            _f1.labelbbbd1.Text = resbbbottomd1;
            #endregion
            #endregion
        }
        public override void Calculate(int index)
        {
            // Calculate value at specified index
            // Result[index] = ...
        }
    }
}


XA
xavier.affringue

Joined on 06.09.2019

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: convergence indicator.algo
  • Rating: 0
  • Installs: 2061
  • Modified: 13/10/2021 09:54
Comments
Log in to add a comment.
XA
xavier.affringue · 5 years ago

download the indicator, not copy the code, if not you don't have winforms code.