IndexMeter_MT5

MQL5 Convertir

Tâche terminée

Temps d'exécution 3 heures
Commentaires du client
great job!
Commentaires de l'employé
Thank you for the project. It was a pleasure working with you.

Spécifications

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

}


Dossiers :

JPG
Capture.JPG
30.5 Kb

Répondu

1
Développeur 1
Évaluation
(42)
Projets
61
21%
Arbitrage
5
40% / 20%
En retard
10
16%
Chargé
2
Développeur 2
Évaluation
(300)
Projets
306
69%
Arbitrage
2
100% / 0%
En retard
0
Gratuit
Publié : 1 code
3
Développeur 3
Évaluation
(8)
Projets
11
0%
Arbitrage
6
33% / 67%
En retard
2
18%
Gratuit
4
Développeur 4
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
5
Développeur 5
Évaluation
(31)
Projets
35
46%
Arbitrage
0
En retard
0
Gratuit
Publié : 3 codes
6
Développeur 6
Évaluation
(173)
Projets
201
49%
Arbitrage
18
11% / 44%
En retard
1
0%
Gratuit
7
Développeur 7
Évaluation
(29)
Projets
49
22%
Arbitrage
14
29% / 21%
En retard
13
27%
Gratuit
8
Développeur 8
Évaluation
(9)
Projets
11
18%
Arbitrage
4
0% / 100%
En retard
4
36%
Gratuit
9
Développeur 9
Évaluation
(260)
Projets
276
55%
Arbitrage
0
En retard
5
2%
Gratuit
10
Développeur 10
Évaluation
(7)
Projets
11
0%
Arbitrage
4
0% / 100%
En retard
2
18%
Travail
11
Développeur 11
Évaluation
(449)
Projets
475
69%
Arbitrage
6
67% / 0%
En retard
2
0%
Travail
12
Développeur 12
Évaluation
(77)
Projets
240
73%
Arbitrage
7
100% / 0%
En retard
1
0%
Gratuit
Commandes similaires
I need to convert this indicator to mql5 I need it the same as on tradingview including parameters…………. Or if you know about this indicator, please give me more comments so that it works better

Informations sur le projet

Budget
30 USD
Délais
de 1 à 3 jour(s)