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
등급
(40)
프로젝트
57
21%
중재
3
67% / 0%
기한 초과
9
16%
로드됨
2
개발자 2
등급
(283)
프로젝트
289
70%
중재
2
100% / 0%
기한 초과
0
무료
게재됨: 1 코드
3
개발자 3
등급
(8)
프로젝트
11
0%
중재
3
67% / 33%
기한 초과
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%
중재
13
31% / 15%
기한 초과
13
27%
작업중
8
개발자 8
등급
(8)
프로젝트
10
10%
중재
0
기한 초과
4
40%
작업중
9
개발자 9
등급
(240)
프로젝트
255
52%
중재
0
기한 초과
5
2%
무료
10
개발자 10
등급
(7)
프로젝트
11
0%
중재
4
0% / 75%
기한 초과
2
18%
작업중
11
개발자 11
등급
(434)
프로젝트
461
69%
중재
6
67% / 0%
기한 초과
2
0%
작업중
12
개발자 12
등급
(77)
프로젝트
231
73%
중재
6
100% / 0%
기한 초과
1
0%
무료

프로젝트 정보

예산
30 USD
VAT (21%): 6.3 - 6.3 USD
총: 36.3 - 36.3 USD
개발자에게
27 - 27 USD
기한
에서 1  3 일