IndexMeter_MT5

MQL5 Dönüştürme

İş tamamlandı

Tamamlanma süresi: 3 saat
Müşteri tarafından geri bildirim
great job!
Geliştirici tarafından geri bildirim
Thank you for the project. It was a pleasure working with you.

İş Gereklilikleri

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);

}


Dosyalar:

JPG
Capture.JPG
30.5 Kb

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(40)
Projeler
57
21%
Arabuluculuk
3
67% / 0%
Süresi dolmuş
9
16%
Yüklendi
2
Geliştirici 2
Derecelendirme
(283)
Projeler
289
70%
Arabuluculuk
2
100% / 0%
Süresi dolmuş
0
Serbest
Yayınlandı: 1 kod
3
Geliştirici 3
Derecelendirme
(8)
Projeler
11
0%
Arabuluculuk
3
67% / 33%
Süresi dolmuş
2
18%
Serbest
4
Geliştirici 4
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
5
Geliştirici 5
Derecelendirme
(31)
Projeler
35
46%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
Yayınlandı: 3 kod
6
Geliştirici 6
Derecelendirme
(173)
Projeler
201
49%
Arabuluculuk
18
11% / 44%
Süresi dolmuş
1
0%
Serbest
7
Geliştirici 7
Derecelendirme
(29)
Projeler
49
22%
Arabuluculuk
13
31% / 15%
Süresi dolmuş
13
27%
Çalışıyor
8
Geliştirici 8
Derecelendirme
(8)
Projeler
10
10%
Arabuluculuk
0
Süresi dolmuş
4
40%
Çalışıyor
9
Geliştirici 9
Derecelendirme
(240)
Projeler
255
52%
Arabuluculuk
0
Süresi dolmuş
5
2%
Serbest
10
Geliştirici 10
Derecelendirme
(7)
Projeler
11
0%
Arabuluculuk
4
0% / 75%
Süresi dolmuş
2
18%
Çalışıyor
11
Geliştirici 11
Derecelendirme
(434)
Projeler
461
69%
Arabuluculuk
6
67% / 0%
Süresi dolmuş
2
0%
Çalışıyor
12
Geliştirici 12
Derecelendirme
(77)
Projeler
231
73%
Arabuluculuk
6
100% / 0%
Süresi dolmuş
1
0%
Serbest

Proje bilgisi

Bütçe
30 USD
KDV (21%): 6.3 - 6.3 USD
Toplam: 36.3 - 36.3 USD
Geliştirici için
27 - 27 USD
Son teslim tarihi
from 1 to 3 gün