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
評価
(42)
プロジェクト
61
21%
仲裁
5
40% / 20%
期限切れ
10
16%
取り込み中
2
開発者 2
評価
(300)
プロジェクト
306
69%
仲裁
2
100% / 0%
期限切れ
0
パブリッシュした人: 1 code
3
開発者 3
評価
(8)
プロジェクト
11
0%
仲裁
6
33% / 67%
期限切れ
2
18%
4
開発者 4
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
5
開発者 5
評価
(31)
プロジェクト
35
46%
仲裁
0
期限切れ
0
パブリッシュした人: 3 codes
6
開発者 6
評価
(173)
プロジェクト
201
49%
仲裁
18
11% / 44%
期限切れ
1
0%
7
開発者 7
評価
(29)
プロジェクト
49
22%
仲裁
14
29% / 21%
期限切れ
13
27%
8
開発者 8
評価
(9)
プロジェクト
11
18%
仲裁
4
0% / 100%
期限切れ
4
36%
9
開発者 9
評価
(260)
プロジェクト
276
55%
仲裁
0
期限切れ
5
2%
10
開発者 10
評価
(7)
プロジェクト
11
0%
仲裁
4
0% / 100%
期限切れ
2
18%
仕事中
11
開発者 11
評価
(449)
プロジェクト
475
69%
仲裁
6
67% / 0%
期限切れ
2
0%
仕事中
12
開発者 12
評価
(77)
プロジェクト
240
73%
仲裁
7
100% / 0%
期限切れ
1
0%
類似した注文
I have a working MT4 Expert Advisor with full source code (.mq4). I need this EA converted to MT5 (.mq5) so that it works exactly the same as the MT4 version. What I need: Convert all MT4 trading functions to MT5 trading functions Keep the same strategy logic, inputs, and behavior Make sure the EA works in the MT5 Strategy Tester Deliver clean and error-free MT5 source code No new features needed — only conversion
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
I need two simple trading strategies translated into MQL5 . Both systems already work in ProRealTime; I only need them rebuilt exactly the same in MT5 . When accepted you will see the exact parameters. Please follow these rules: No discretionary logic No optimization Clean, readable MQL5 code Both strategies must run on Daily timeframe Position sizing should follow the formulas I provide Long-only One position at a

プロジェクト情報

予算
30 USD
締め切り
最低 1 最高 3 日