IndexMeter_MT5

MQL5 Конвертация

Работа завершена

Время выполнения 3 часа
Отзыв от заказчика
great job!
Отзыв от исполнителя
Thank you for the project. It was a pleasure working with you.

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

Please can anyone help me convert this simple Indicator from MT4
to MT5. 

Please its really a very few lines of codes, and I will appreciate the MT5 to be a as much lines of code.

I do not like complicated and unnecessary lines of code. Kindly delete any useful codes. Thanks



#property indicator_separate_window

#property indicator_buffers 1

#property indicator_level1 0 //middle line

#property indicator_color1  Blue


// ==== External / Internal Input ======= //

int InpFastEMA = 10;

int InpSlowEMA = 20;

int hist = 1000;  //to reduce the number of candles to compute for


// ==== Declaring the arrays

double Meter[];


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

//| Custom indicator initialization function                         |

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

int OnInit()

  {

   IndicatorBuffers(1);

   //--- indicator buffers mapping

   SetIndexBuffer(0,Meter);

   SetIndexStyle(0,DRAW_HISTOGRAM);

   

   //--- indicator name / Labels

   IndicatorShortName("Index Meter "); 

   SetIndexLabel(0,"Index Meter"); // name on Data window 

   

   //---

   return(INIT_SUCCEEDED);

  }

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

//| Custom indicator iteration function                              |

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

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[])

  {

//---


// === Calculate the Meter values

   MeterCalc();

               

//--- return value of prev_calculated for next call

   return(rates_total);

  }

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



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

//| Calculating the Meter for Any Currency pair                      |

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

int MeterCalc()

 {

  // double rsi,macd;

  

  //Locally find your own tickers, and compare with what is in IndexArray

  string ccu1 = StringSubstr(_Symbol,0,3);

  string ccu2 = StringSubstr(_Symbol,3,3);

    

  int countB = IndicatorCounted();

  int limitt = Bars - countB;

  if(limitt>hist)limitt=hist;

  for(int i=0;i<limitt;i++) // iterating backwards

    {    

        int count=0;   


     // ==== Next, focus on this chart, and calculate "count"

     double fma1=NormalizeDouble(iMA(_Symbol,0,InpFastEMA,0,MODE_EMA,PRICE_CLOSE,i),Digits);

     double sma1=NormalizeDouble(iMA(_Symbol,0,InpSlowEMA,0,MODE_EMA,PRICE_CLOSE,i),Digits);

     double Macd1=NormalizeDouble(iMACD(NULL,0,12,26,9,0,MODE_MAIN,i),6);

     double rsi1=iRSI(_Symbol,0,14,0,i);

     if(fma1>sma1)count+=10;

     else if(fma1<sma1) count-=10;

     if(Macd1>0) count+=10;

     else if(Macd1<0) count-=10;

     if(rsi1>50) count+=10;

     else if(rsi1<50) count-=10;

      

    // ===== sum all the count

      Meter[i]=count;

    }

 return(0);

}


Файлы:

JPG
Capture.JPG
30.5 Kb

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

1
Разработчик 1
Оценка
(43)
Проекты
63
24%
Арбитраж
10
30% / 50%
Просрочено
10
16%
Свободен
2
Разработчик 2
Оценка
(327)
Проекты
332
71%
Арбитраж
2
100% / 0%
Просрочено
0
Свободен
Опубликовал: 1 пример
3
Разработчик 3
Оценка
(8)
Проекты
11
0%
Арбитраж
8
25% / 75%
Просрочено
2
18%
Свободен
4
Разработчик 4
Оценка
Проекты
0
0%
Арбитраж
0
Просрочено
0
Свободен
5
Разработчик 5
Оценка
(31)
Проекты
35
46%
Арбитраж
0
Просрочено
0
Свободен
Опубликовал: 3 примера
6
Разработчик 6
Оценка
(173)
Проекты
201
49%
Арбитраж
18
11% / 44%
Просрочено
1
0%
Свободен
7
Разработчик 7
Оценка
(29)
Проекты
49
22%
Арбитраж
14
29% / 21%
Просрочено
13
27%
Свободен
8
Разработчик 8
Оценка
(9)
Проекты
11
18%
Арбитраж
4
0% / 100%
Просрочено
4
36%
Свободен
9
Разработчик 9
Оценка
(270)
Проекты
285
55%
Арбитраж
0
Просрочено
5
2%
Свободен
10
Разработчик 10
Оценка
(8)
Проекты
12
0%
Арбитраж
5
20% / 80%
Просрочено
2
17%
Свободен
11
Разработчик 11
Оценка
(464)
Проекты
491
70%
Арбитраж
6
67% / 0%
Просрочено
2
0%
Свободен
12
Разработчик 12
Оценка
(78)
Проекты
246
74%
Арбитраж
7
100% / 0%
Просрочено
1
0%
Свободен
Опубликовал: 1 статью

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

Бюджет
30 USD
Сроки выполнения
от 1 до 3 дн.