IndexMeter_MT5

MQL5 Konvertierung

Auftrag beendet

Ausführungszeit 3 Stunden
Bewertung des Kunden
great job!
Bewertung des Entwicklers
Thank you for the project. It was a pleasure working with you.

Spezifikation

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

}


Dateien:

JPG
Capture.JPG
30.5 Kb

Bewerbungen

1
Entwickler 1
Bewertung
(40)
Projekte
57
21%
Schlichtung
3
67% / 0%
Frist nicht eingehalten
9
16%
Beschäftigt
2
Entwickler 2
Bewertung
(283)
Projekte
289
70%
Schlichtung
2
100% / 0%
Frist nicht eingehalten
0
Frei
Veröffentlicht: 1 Beispiel
3
Entwickler 3
Bewertung
(8)
Projekte
11
0%
Schlichtung
3
67% / 33%
Frist nicht eingehalten
2
18%
Frei
4
Entwickler 4
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
5
Entwickler 5
Bewertung
(31)
Projekte
35
46%
Schlichtung
0
Frist nicht eingehalten
0
Frei
Veröffentlicht: 3 Beispiele
6
Entwickler 6
Bewertung
(173)
Projekte
201
49%
Schlichtung
18
11% / 44%
Frist nicht eingehalten
1
0%
Frei
7
Entwickler 7
Bewertung
(29)
Projekte
49
22%
Schlichtung
13
31% / 15%
Frist nicht eingehalten
13
27%
Arbeitet
8
Entwickler 8
Bewertung
(8)
Projekte
10
10%
Schlichtung
0
Frist nicht eingehalten
4
40%
Arbeitet
9
Entwickler 9
Bewertung
(240)
Projekte
255
52%
Schlichtung
0
Frist nicht eingehalten
5
2%
Frei
10
Entwickler 10
Bewertung
(7)
Projekte
11
0%
Schlichtung
4
0% / 75%
Frist nicht eingehalten
2
18%
Arbeitet
11
Entwickler 11
Bewertung
(434)
Projekte
461
69%
Schlichtung
6
67% / 0%
Frist nicht eingehalten
2
0%
Arbeitet
12
Entwickler 12
Bewertung
(77)
Projekte
231
73%
Schlichtung
6
100% / 0%
Frist nicht eingehalten
1
0%
Frei

Projektdetails

Budget
30 USD
MwSt (21%): 6.3 - 6.3 USD
Insgesamt: 36.3 - 36.3 USD
Für die Entwickler
27 - 27 USD
Ausführungsfristen
von 1 bis 3 Tag(e)