Rewrite Indicator COG of mq4 to mq5

MQL5 Индикаторы

Техническое задание

I need of the indicator CENTER OF GRAVITY of mq4 to mq5

 

Code:

 

//+------------------------------------------------------------------+

//|                                            Center of Gravity.mq4 |

//| Original Code from NG3110@latchess.com                           |                                    

//| Linuxser 2007 for TSD    http://www.forex-tsd.com/               |

//+------------------------------------------------------------------+

#property  copyright "ANG3110@latchess.com"

//---------ang_PR (Din)--------------------

#property indicator_chart_window

#property indicator_buffers 5

#property indicator_color1 Aqua

#property indicator_color2 Orange

#property indicator_color3 Lime

#property indicator_color4 Red

#property indicator_color5 Green

//-----------------------------------



//Etc.

//:::::::::::::::::::::::::::::::::::::::::::::::


input int bars_back = 125;

input int m = 2;

input int i = 0;

input double kstd = 2.0;

input int sName = 1102;

//-----------------------

double fx[], sqh[], sql[], stdh[], stdl[];

double ai[10], b[10], x[10], sx[20];

double sum;

int    ip, p, n, f;

double qq, mm, tt;

int    ii, jj, kk, ll, nn;

double sq, std;

//*******************************************

int OnInit()

{

  //:::::::::::::::::::::::::::::::::::::::::::::

  double Ask=SymbolInfoDouble(Symbol(),SYMBOL_ASK);

  double Bid=SymbolInfoDouble(Symbol(),SYMBOL_BID);

  int Bars=Bars(Symbol(),PERIOD_CURRENT);

  double Point=Point();

  //Etc.

  //:::::::::::::::::::::::::::::::::::::::::::::::


   IndicatorCreate("Center of Gravity");

   SetIndexBuffer (0, DRAW_LINE);

   SetIndexBuffer(0, fx);

   SetIndexBuffer(1, sqh);

   SetIndexBuffer(2, sql);

   SetIndexBuffer(3, stdh);

   SetIndexBuffer(4, stdl);

   p = MathRound(bars_back);

   nn = m + 1;

   ObjectCreate("pr" + sName, 22, 0, Time[p], fx[p]);

   ObjectSet("pr" + sName, 14, 159);

   return(0);

}

//----------------------------------------------------------

int OnDeinit()

{

  //:::::::::::::::::::::::::::::::::::::::::::::

  double Ask=SymbolInfoDouble(Symbol(),SYMBOL_ASK);

  double Bid=SymbolInfoDouble(Symbol(),SYMBOL_BID);

  int Bars=Bars(Symbol(),PERIOD_CURRENT);

  double Point=Point();

  //Etc.

  //:::::::::::::::::::::::::::::::::::::::::::::::


   ObjectDelete("pr" + sName);

}

//**********************************************************************************************

int OnCalculate(const int rates_total,

                const int prev_calculated,

                const datetime& time[],

                const double& open[],

                const double& high[],

                const double& low[],

                const double& close[],

                const long& tick_volume[],

                const long& volume[],

                const int& spread[])

{

  //:::::::::::::::::::::::::::::::::::::::::::::

  double Ask=SymbolInfoDouble(Symbol(),SYMBOL_ASK);

  double Bid=SymbolInfoDouble(Symbol(),SYMBOL_BID);

  int Bars=Bars(Symbol(),PERIOD_CURRENT);

  double Point=Point();

  //Etc.

  //:::::::::::::::::::::::::::::::::::::::::::::::


   int mi;

//-------------------------------------------------------------------------------------------

   ip = iBarShift(Symbol(), Period(), ObjectGet("pr" + sName, OBJPROP_TIME1));

   p = bars_back; 

   sx[1] = p + 1;

   SetIndexDrawBegin(0, Bars - p - 1);

   SetIndexDrawBegin(1, Bars - p - 1);

   SetIndexDrawBegin(2, Bars - p - 1);

   SetIndexDrawBegin(3, Bars - p - 1);

   SetIndexDrawBegin(4, Bars - p - 1); 

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

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

   {

      sum = 0;

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

      {

         sum += MathPow(n, mi);

      }

      sx[mi + 1] = sum;

   }  

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

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

   {

      sum = 0.00000;

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

      {

         if(mi == 1)

            sum += Close[n];

         else

            sum += Close[n] * MathPow(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(MathAbs(ai[ii, kk]) > mm)

         {

            mm = MathAbs(ai[ii, kk]);

            ll = ii;

         }

      }

      if(ll == 0)

         return(0);   


      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 = i; n <= i + p; n++)

   {

      sum = 0;

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

      {

         sum += x[kk + 1] * MathPow(n, kk);

      }

      fx[n] = x[1] + sum;

   } 

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

   sq = 0.0;

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

   {

      sq += MathPow(Close[n] - fx[n], 2);

   }

   sq = MathSqrt(sq / (p + 1)) * kstd;

   std = iStdDev(NULL, 0, p, MODE_SMA, 0, PRICE_CLOSE, i) * kstd;

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

   {

      sqh[n] = fx[n] + sq;

      sql[n] = fx[n] - sq;

      stdh[n] = fx[n] + std;

      stdl[n] = fx[n] - std;

   } 

//-------------------------------------------------------------------------------

   ObjectMove("pr" + sName, 0, Time[p], fx[p]);

//----------------------------------------------------------------------------------------------------------------------------

   return(rates_total);

}

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




 

Откликнулись

1
Разработчик 1
Оценка
(90)
Проекты
159
61%
Арбитраж
40
18% / 63%
Просрочено
70
44%
Свободен
2
Разработчик 2
Оценка
(48)
Проекты
91
31%
Арбитраж
28
29% / 43%
Просрочено
42
46%
Свободен
3
Разработчик 3
Оценка
(62)
Проекты
140
46%
Арбитраж
19
42% / 16%
Просрочено
32
23%
Свободен
4
Разработчик 4
Оценка
(195)
Проекты
395
28%
Арбитраж
155
20% / 52%
Просрочено
112
28%
Свободен
5
Разработчик 5
Оценка
(18)
Проекты
37
43%
Арбитраж
6
17% / 50%
Просрочено
17
46%
Свободен
6
Разработчик 6
Оценка
(71)
Проекты
254
53%
Арбитраж
16
50% / 38%
Просрочено
83
33%
Свободен
7
Разработчик 7
Оценка
(54)
Проекты
164
43%
Арбитраж
43
47% / 16%
Просрочено
58
35%
Свободен
8
Разработчик 8
Оценка
(187)
Проекты
367
56%
Арбитраж
45
22% / 56%
Просрочено
188
51%
Свободен
9
Разработчик 9
Оценка
(15)
Проекты
18
61%
Арбитраж
4
0% / 100%
Просрочено
8
44%
Свободен
Похожие заказы
BUY AND SELL 30+ USD
Create an Expert Advisor that collaborates between these indicators ETR, MEv2 and STLv3 with these features 1. SL and TP 2. TIME FILTER 3. ETR, MEv2 and STLv3 PARAMETERS BUY ENTRY STEP 1. FIRST candle OPEN above Symphonie Trend Line STEP 2. Check Symphonie Extreme must indicate color BLUE STEP 3. Check Symphonie Emotion must indicate color BLUE STEP 4. Open trade with money management STEP 5. Trade open MUST BE 1
Hello, I have a protected Ninja trader Order Flow indicator and I was wondering if you can reverse engineer it to replicate the functionality. H ere are the specifications and indicator: https://docs.google.com/document/d/1KyYwQ7iTL2KWGhnZzxS1gObccu9LPMrGuMc9Mdk_3KY/edit?usp=sharing
I have an EA that need some changes including integrating the indicator code directly into the Expert Advisor. I will give the detailed doc once we settle on the candidate for the job . Please bid if you can work with the stated amount. Thanks
Hello, Need to convert Tradingview Indicator to MQL4 indicator. or if you have this one converted already, let me buy a copy please. If we're good, then will definitely buy it and ask to convert into EA on new order. Supertrend by KivancOzbilgic
Fix bug or modify an existing Trading view indicator to display correct. The indicator is working but not displaying/plotting all the information i want. So i want it adjusted to plot all the info
Here's a brief requirement you can use: **Description:** I am seeking an experienced MQL5 developer to create a (EA). The EA should include features for placing pending orders (Buy Stop and Sell Stop) based on market spread, managing trades effectively at the opening of new candlesticks, and implementing take profit and stop loss strategies. Additionally, I would like the option to adjust parameters based on market
I have an EA which i need to do below modifications. Variable Inputs to be added Order Type : Market , Pending Trade Type : Buy, Sell , Buy & Sell Pending Pips Step : ( Pips Value can be negative or positive to decide on what type of Pending Order ) // If trade type Buy is selected Close Type : Close All ( Bulk Close Option in MT5 ) , Close Individually Close Option : %of Equity , %of Balance , Amount $ , %of No
Add multiplier to grid recovery system. For example: Grid Trade 2-3 Spacing; 1.0 Multiplier Grid Trade 4-6 Spacing; 2.0 Multiplier Grid Trade 7+ Spacing; 1.6 Multiplier Need quick turn around. Need it done ASAP
Objects reader PIN 70 - 100 USD
Hi I have an indicator that create objects in the chart and using those following some rules the new indicator will create external global variables with value = 0 ( NONE ), = 1 ( BUY ) or = 2 ( SELL ). The global variable will use PIN external integer number . PINS are by now global variables (GV) whose name indicates the pair name and the PIN belonging and their value indicates it direction/action. PINS GV names
I want an indicator and its source code that returns the value of: - two moving averages in different selectable timeframes, with method Exponential and price calculation price_open; - Opening, closing, maximum and minimum of the candle in different timeframes And that returns the values ​​regardless in a chart of one minute. The input parameters: * select timeframe media1 = {1,2,3,4,5,...} * select timeframe media2

Информация о проекте

Бюджет