IndexMeter_MT5

MQL5 In conversione

Lavoro terminato

Tempo di esecuzione 3 ore
Feedback del cliente
great job!
Feedback del dipendente
Thank you for the project. It was a pleasure working with you.

Specifiche

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

}


File:

JPG
Capture.JPG
30.5 Kb

Con risposta

1
Sviluppatore 1
Valutazioni
(40)
Progetti
57
21%
Arbitraggio
3
67% / 0%
In ritardo
9
16%
Caricato
2
Sviluppatore 2
Valutazioni
(283)
Progetti
289
70%
Arbitraggio
2
100% / 0%
In ritardo
0
Gratuito
Pubblicati: 1 codice
3
Sviluppatore 3
Valutazioni
(8)
Progetti
11
0%
Arbitraggio
3
67% / 33%
In ritardo
2
18%
Gratuito
4
Sviluppatore 4
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
5
Sviluppatore 5
Valutazioni
(31)
Progetti
35
46%
Arbitraggio
0
In ritardo
0
Gratuito
Pubblicati: 3 codici
6
Sviluppatore 6
Valutazioni
(173)
Progetti
201
49%
Arbitraggio
18
11% / 44%
In ritardo
1
0%
Gratuito
7
Sviluppatore 7
Valutazioni
(29)
Progetti
49
22%
Arbitraggio
13
31% / 15%
In ritardo
13
27%
In elaborazione
8
Sviluppatore 8
Valutazioni
(8)
Progetti
10
10%
Arbitraggio
0
In ritardo
4
40%
In elaborazione
9
Sviluppatore 9
Valutazioni
(240)
Progetti
255
52%
Arbitraggio
0
In ritardo
5
2%
Gratuito
10
Sviluppatore 10
Valutazioni
(7)
Progetti
11
0%
Arbitraggio
4
0% / 75%
In ritardo
2
18%
In elaborazione
11
Sviluppatore 11
Valutazioni
(434)
Progetti
461
69%
Arbitraggio
6
67% / 0%
In ritardo
2
0%
In elaborazione
12
Sviluppatore 12
Valutazioni
(77)
Progetti
231
73%
Arbitraggio
6
100% / 0%
In ritardo
1
0%
Gratuito

Informazioni sul progetto

Budget
30 USD
IVA (21%): 6.3 - 6.3 USD
Totale: 36.3 - 36.3 USD
Per lo sviluppatore
27 - 27 USD
Scadenze
da 1 a 3 giorno(i)