Nouveau Belkhayate Gravity MDF

MQL5 Indicators Java

Specification

region Using declarations

using System;

using System.ComponentModel;

using System.Diagnostics;

using System.Drawing;

using System.Drawing.Drawing2D;

using System.Xml.Serialization;

using NinjaTrader.Cbi;

using NinjaTrader.Data;

using NinjaTrader.Gui.Chart;

#endregion


// This namespace holds all indicators and is required. Do not change it.

namespace NinjaTrader.Indicator

{

    /// <summary>

    /// Enter the description of your new custom indicator here

    /// </summary>

    [Description("Belkhayate Gravity Center")]

    public class BCG : Indicator

    {

        #region Variables

        // Wizard generated variables

        private int period = 180; // Default setting for Period

        private int order = 3; // Default setting for Order

        private double ecart = 1.618; // Default setting for Ecart

    // User defined variables (add any user defined variables below)

private double[,] ai = new double[10,10];

private double[] b = new double[10];

private double[] x = new double[10];

private double[] sx = new double[10];

private double sum;

private int ip;

private int p;

private int n;

private int f;

private double qq;

private double mm;

private double tt;

private int ii;

private int jj;

private int kk;

private int ll;

private int nn;

private double sq;

private double sq2;

private int i0 = 0;

private int mi;

        #endregion


        /// <summary>

        /// This method is used to configure the indicator and is called once before any bar data is loaded.

        /// </summary>

        protected override void Initialize()

        {

            Add(new Plot(Color.FromKnownColor(KnownColor.MediumBlue), PlotStyle.Line, "GravityLine"));

            Add(new Plot(Color.FromKnownColor(KnownColor.Gray), PlotStyle.Line, "UC1"));

            Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "UC2"));

            Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "UC3"));

            Add(new Plot(Color.FromKnownColor(KnownColor.Gray), PlotStyle.Line, "LC1"));

            Add(new Plot(Color.FromKnownColor(KnownColor.LimeGreen), PlotStyle.Line, "LC2"));

            Add(new Plot(Color.FromKnownColor(KnownColor.LimeGreen), PlotStyle.Line, "LC3"));

            CalculateOnBarClose = false;

            Overlay = true;

            PriceTypeSupported = true;

        }


        /// <summary>

        /// Called on each bar update event (incoming tick)

        /// </summary>

        protected override void OnBarUpdate()

        {

if( CurrentBar < Period) return;

ip = Period;

p = ip;

sx[1] = p + 1;

nn = Order + 1;

//----------------------sx-------------------------------------------------------------------

for(mi=1;mi<=nn*2-2;mi++) 

{

sum=0;

for(n=i0;n<=i0+p;n++)

{

sum+=Math.Pow(n,mi);

}

sx[mi+1]=sum;

}  

//----------------------syx-----------

for(mi=1;mi<=nn;mi++)

{

sum=0.00000;

for(n=i0;n<=i0+p;n++)

{

if(mi==1) sum+=Close[n];

else sum+=Close[n]*Math.Pow(n,mi-1);

}

b[mi]=sum;

//===============Matrix=======================================================================================================

for(jj=1;jj<=nn;jj++)

{

for(ii=1; ii<=nn; ii++)

{

kk=ii+jj-1;

ai[ii,jj]=sx[kk];

}

}  

//===============Gauss========================================================================================================

for(kk=1; kk<=nn-1; kk++)

{

ll=0;

mm=0;

for(ii=kk; ii<=nn; ii++)

{

if(Math.Abs(ai[ii,kk])>mm)

{

mm=Math.Abs(ai[ii,kk]);

ll=ii;

}

}

if(ll==0) return;   

if (ll!=kk)

{

for(jj=1; jj<=nn; jj++)

{

tt=ai[kk,jj];

ai[kk,jj]=ai[ll,jj];

ai[ll,jj]=tt;

}

tt=b[kk];

b[kk]=b[ll];

b[ll]=tt;

}  

for(ii=kk+1;ii<=nn;ii++)

{

qq=ai[ii,kk]/ai[kk,kk];

for(jj=1;jj<=nn;jj++)

{

if(jj==kk) ai[ii,jj]=0;

else ai[ii,jj]=ai[ii,jj]-qq*ai[kk,jj];

}

b[ii]=b[ii]-qq*b[kk];

}

}  

x[nn]=b[nn]/ai[nn,nn];

for(ii=nn-1;ii>=1;ii--)

{

tt=0;

for(jj=1;jj<=nn-ii;jj++)

{

tt=tt+ai[ii,ii+jj]*x[ii+jj];

x[ii]=(1/ai[ii,ii])*(b[ii]-tt);

}

//===========================================================================================================================

for(n=i0;n<=i0+p;n++)

{

sum=0;

for(kk=1;kk<=Order;kk++)

{

sum+=x[kk+1]*Math.Pow(n,kk);

}

GravityLine.Set(n,x[1]+sum);

//-----------------------------------Std-----------------------------------------------------------------------------------

sq=0.0;

for(n=i0;n<=i0+p;n++)

{

sq+=Math.Pow(Close[n]-GravityLine[n],2);

}

sq = Math.Sqrt(sq/(p+1))*Ecart;

for(n=i0;n<=i0+p;n++)

{

UC1.Set(n,GravityLine[n]+sq);

LC1.Set(n,GravityLine[n]-sq);

UC2.Set(n,GravityLine[n]+sq*2);

LC2.Set(n,GravityLine[n]-sq*2);

UC3.Set(n,GravityLine[n]+sq*3);

LC3.Set(n,GravityLine[n]-sq*3);

}

        }


        #region Properties

        [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove

        [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove

        public DataSeries GravityLine

        {

            get { return Values[0]; }

        }


        [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove

        [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove

        public DataSeries UC1

        {

            get { return Values[1]; }

        }


        [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove

        [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove

        public DataSeries UC2

        {

            get { return Values[2]; }

        }


        [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove

        [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove

        public DataSeries UC3

        {

            get { return Values[3]; }

        }


        [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove

        [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove

        public DataSeries LC1

        {

            get { return Values[4]; }

        }


        [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove

        [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove

        public DataSeries LC2

        {

            get { return Values[5]; }

        }


        [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove

        [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove

        public DataSeries LC3

        {

            get { return Values[6]; }

        }


        [Description("")]

        [GridCategory("Parameters")]

        public int Period

        {

            get { return period; }

            set { period = Math.Max(1, value); }

        }


        [Description("")]

        [GridCategory("Parameters")]

        public int Order

        {

            get { return order; }

            set { order = Math.Max(1, value); }

        }


        [Description("")]

        [GridCategory("Parameters")]

        public double Ecart

        {

            get { return ecart; }

            set { ecart = Math.Max(0.100, value); }

        }

        #endregion

    }

}


#region NinjaScript generated code. Neither change nor remove.

// This namespace holds all indicators and is required. Do not change it.

namespace NinjaTrader.Indicator

{

    public partial class Indicator : IndicatorBase

    {

        private BCG[] cacheBCG = null;


        private static BCG checkBCG = new BCG();


        /// <summary>

        /// Belkhayate Gravity Center

        /// </summary>

        /// <returns></returns>

        public BCG BCG(double ecart, int order, int period)

        {

            return BCG(Input, ecart, order, period);

        }


        /// <summary>

        /// Belkhayate Gravity Center

        /// </summary>

        /// <returns></returns>

        public BCG BCG(Data.IDataSeries input, double ecart, int order, int period)

        {

            if (cacheBCG != null)

                for (int idx = 0; idx < cacheBCG.Length; idx++)

                    if (Math.Abs(cacheBCG[idx].Ecart - ecart) <= double.Epsilon && cacheBCG[idx].Order == order && cacheBCG[idx].Period == period && cacheBCG[idx].EqualsInput(input))

                        return cacheBCG[idx];


            lock (checkBCG)

            {

                checkBCG.Ecart = ecart;

                ecart = checkBCG.Ecart;

                checkBCG.Order = order;

                order = checkBCG.Order;

                checkBCG.Period = period;

                period = checkBCG.Period;


                if (cacheBCG != null)

                    for (int idx = 0; idx < cacheBCG.Length; idx++)

                        if (Math.Abs(cacheBCG[idx].Ecart - ecart) <= double.Epsilon && cacheBCG[idx].Order == order && cacheBCG[idx].Period == period && cacheBCG[idx].EqualsInput(input))

                            return cacheBCG[idx];


                BCG indicator = new BCG();

                indicator.BarsRequired = BarsRequired;

                indicator.CalculateOnBarClose = CalculateOnBarClose;

#if NT7

                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;

                indicator.MaximumBarsLookBack = MaximumBarsLookBack;

#endif

                indicator.Input = input;

                indicator.Ecart = ecart;

                indicator.Order = order;

                indicator.Period = period;

                Indicators.Add(indicator);

                indicator.SetUp();


                BCG[] tmp = new BCG[cacheBCG == null ? 1 : cacheBCG.Length + 1];

                if (cacheBCG != null)

                    cacheBCG.CopyTo(tmp, 0);

                tmp[tmp.Length - 1] = indicator;

                cacheBCG = tmp;

                return indicator;

            }

        }

    }

}


// This namespace holds all market analyzer column definitions and is required. Do not change it.

namespace NinjaTrader.MarketAnalyzer

{

    public partial class Column : ColumnBase

    {

        /// <summary>

        /// Belkhayate Gravity Center

        /// </summary>

        /// <returns></returns>

        [Gui.Design.WizardCondition("Indicator")]

        public Indicator.BCG BCG(double ecart, int order, int period)

        {

            return _indicator.BCG(Input, ecart, order, period);

        }


        /// <summary>

        /// Belkhayate Gravity Center

        /// </summary>

        /// <returns></returns>

        public Indicator.BCG BCG(Data.IDataSeries input, double ecart, int order, int period)

        {

            return _indicator.BCG(input, ecart, order, period);

        }

    }

}


// This namespace holds all strategies and is required. Do not change it.

namespace NinjaTrader.Strategy

{

    public partial class Strategy : StrategyBase

    {

        /// <summary>

        /// Belkhayate Gravity Center

        /// </summary>

        /// <returns></returns>

        [Gui.Design.WizardCondition("Indicator")]

        public Indicator.BCG BCG(double ecart, int order, int period)

        {

            return _indicator.BCG(Input, ecart, order, period);

        }


        /// <summary>

        /// Belkhayate Gravity Center

        /// </summary>

        /// <returns></returns>

        public Indicator.BCG BCG(Data.IDataSeries input, double ecart, int order, int period)

        {

            if (InInitialize && input == null)

                throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");


            return _indicator.BCG(input, ecart, order, period);

        }

    }

}

#endregion


Responded

1
Developer 1
Rating
(546)
Projects
823
73%
Arbitration
15
53% / 13%
Overdue
193
23%
Free
2
Developer 2
Rating
(1)
Projects
1
0%
Arbitration
1
0% / 100%
Overdue
0
Free
Similar orders
Hello man.Good afternoon and how are you doing? Based on own discussion I will like develop NT8 trading bot based on the strategy I sent to you . Kindly bid for the job and let start . Thanks
Create MT5 deriv EA 30 - 35 USD
Hello . Am in need of a developer that can Create deriv EA .I need to create a Deriv Bot with Martingale 1 min candles 30 martingale plus I can change the amount of martigale with the option of 1 min up or down . Kindly bid and let discuss about the project
The future of the traders be a good traders and patient and humble person faithful loyalty to your job and last be a professional traders and helping a dream of us how to trade and etc,,,,,,,,,,,,,,,,,🤑
Firstly Indicator (1) or the first part \\ Draw a red line at the top of the zero candle _ M1 \\ Draw a blue line at the bottom of the zero _ M1 candle \\ Draw a red line at the top of the zero _ M2 candle \\ Draw a blue line at the bottom of the zero _ M2 candle \\ Draw a red line at the top of the zero candle _ M3 \\ Draw a blue line at the bottom of the zero _ M3 candle \\ Draw a red line at the top of the zero
Trend killer 30 - 200 USD
I Will thanks for allowing me to create and that's good for me and u thanks u very muchand I Will make a good job to work and no to scheme people
I have a script completely up and running on MT5 and I want to convert it to work in NINJATRADER 8 LEAVE JOB PRICE, JOB RUN TIME, YEARS OF EXPERIENCE- tengo un script completamente listo y funcionando en mt5 y deseo convertilo para que funcione en NINJATRADER 8 DEJAR PRECIO DEL TRABAJO, TIEMPO DE EJECUCION DEL TRABAJO, AÑOS DE EXPERIENCIA-
100% Automated Trading Forex Robot powered by AI (Artificial intelligence) PLUG AND PLAY NB 100% Automated Trading Forex Robot powered by AI (Artificial intelligence) PLUG AND PLAY THE ROBOT MUST ANALYSIS ITSELF AND GIVE ACCURATE SIGNALS AND EXECUTE TRADES WITH THE HELP OF AI ( ARTIFICIAL INTELLIGENCE) FOR ALL THE KING PRO ROBOT VPN SHOULD BE RENTED FROM THE MAIN ORIGINAL COPY AND THERE SHOULD BE AN OPTION FOR THEM
I am looking for a developer who can convert my Pine script code to MQ5 code. The code is for a trading strategy that I would like to use on the MetaTrader 5 platform. The code needs to be converted accurately and efficiently, with all of the original functionality preserved. The developer should have experience with both Pine script and MQ5, and should be able to provide a high-quality conversion in a timely manner
I want to create a dashboard that would show all currency pairs using my currency strength indicator, ADX, and my support and resistance indicator.I want to the job done as soon as possible
Meysam 30+ USD
ZigZag بر اساس اسیلاتور مورد نیاز است ایده شاخص یک نشانگر ZigZag ایجاد کنید که بر اساس مقادیر شدید تعیین شده با استفاده از نوسانگرها ساخته شده است. می‌تواند از هر نوسان‌گر نرمال‌شده کلاسیکی که دارای مناطق خرید و فروش بیش از حد است استفاده کند. الگوریتم ابتدا باید با نشانگر WPR اجرا شود، سپس به طور مشابه امکان ترسیم زیگزاگ با استفاده از نشانگرهای زیر را اضافه کنید: CCI چایکین RSI نوسانگر تصادفی الگوریتم و اصطلاحات

Project information

Budget
30 - 200 USD
VAT (20%): 6 - 40 USD
Total: 36 - 240 USD
For the developer
27 - 180 USD
Deadline
to 100 day(s)