need help converting mq4 to mq5

 

hi everybody

i dont have any coding skill at all and now have a problem

i need to convert a very short and simple code(just 58 lines) from mql4 to mql5

can anyone help?

 

//+------------------------------------------------------------------+
//|                                                      Filters.mq4 |
//|                        Copyright 2020, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_chart_window

int RSIperiod=14;

int MACDfastEMA=12;
int MACDslowEMA=26;
int MACDSMA=9;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping

   for(int i=0; i<=SymbolsTotal(true)-1; i++)
     {

      if(iRSI(SymbolName(i,false),PERIOD_M30,RSIperiod,PRICE_CLOSE,0)< 30)
         if(iMACD(SymbolName(i,false),PERIOD_M30,MACDfastEMA,MACDslowEMA,MACDSMA,PRICE_CLOSE,MODE_MAIN,0))
            Print(SymbolName(i,false)," RSI= ",iRSI(SymbolName(i,false),PERIOD_M30,RSIperiod,PRICE_CLOSE,0),
                  "  MACD= ",iMACD(SymbolName(i,false),PERIOD_M30,MACDfastEMA,MACDslowEMA,MACDSMA,PRICE_CLOSE,MODE_MAIN,0));

     }

//---
   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[])
  {
//---

//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
Files:
Filters.mq4  3 kb
 
nadal2397: i dont have any coding skill at all and now have a problem
  1. Ignorance is your problem. You have to fix that.

  2. You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help 2017.04.21

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum 2018.05.12

    We're not going to code it for you (although it could happen if you are lucky or the problem is interesting).
              No free help 2017.04.21

  3. Perhaps you should read the manual, especially the examples.
       How To Ask Questions The Smart Way. 2004
          How To Interpret Answers.
             RTFM and STFW: How To Tell You've Seriously Screwed Up.

    They all (including iCustom) return a handle (an int). You get that in OnInit. In OnTick (after the indicator has updated its buffers), you use the handle, shift and count to get the data.
              Technical Indicators - Reference on algorithmic/automated trading language for MetaTrader 5
              Timeseries and Indicators Access / CopyBuffer - Reference on algorithmic/automated trading language for MetaTrader 5
              How to start with MQL5 - General - MQL5 programming forum - Page 3 #22 2020.03.08
              How to start with MQL5 - MetaTrader 5 - General - MQL5 programming forum - Page 7 #61 2020.07.05
              How to call indicators in MQL5 - MQL5 Articles 12 March 2010