Convert MT4 Indicator to MT5

Trabalho concluído

Tempo de execução 10 minutos
Comentário do desenvolvedor
Всё прошло отлично! Прекрасный заказчик!
Comentário do cliente
Fantastic work! I couldn't have asked for better or quicker

Termos de Referência

Convert the ADR indicator (ADR V2.mq4) from this page:
https://forex-station.com/app.php/attach/file/3363278

from MT4 to MT5

It is a very simple indicator which is only 64 lines including all of the comments & declarations at the top.

The code is actually the following:
//+------------------------------------------------------------------+
//|                                           Daily Range PeterE.mq4 |
//+------------------------------------------------------------------+

#property indicator_chart_window

extern int      NumOfDays             = 25;
extern string   FontName              = "Tahoma";
extern int      FontSize              = 14;
extern color    FontColor             = White;
extern int      Window                = 0;
extern int      Corner                = 0;
extern int      HorizPos              = 85;
extern int      VertPos               = 0;

double pnt;
int    dig;
string objname = "*DRPE";

//+------------------------------------------------------------------+
int init()  {
//+------------------------------------------------------------------+
  pnt = MarketInfo(Symbol(),MODE_POINT);
  dig = MarketInfo(Symbol(),MODE_DIGITS);
  if (dig == 3 || dig == 5) {
    pnt *= 10;
  }  
  ObjectCreate(objname,OBJ_LABEL,Window,0,0);
  return(0);
}

//+------------------------------------------------------------------+
int deinit()  {
//+------------------------------------------------------------------+
  ObjectDelete(objname);
  return(0);
}

//+------------------------------------------------------------------+
int start()  {
//+------------------------------------------------------------------+
  int c=0;
  double sum=0;
  for (int i=1; i<Bars-1; i++)  {
    double hi = iHigh(NULL,PERIOD_D1,i);
    double lo = iLow(NULL,PERIOD_D1,i);
    datetime dt = iTime(NULL,PERIOD_D1,i);
    if (TimeDayOfWeek(dt) > 0 && TimeDayOfWeek(dt) < 6)  {
      sum += hi - lo;
      c++;
      if (c>=NumOfDays) break;
  } }
  hi = iHigh(NULL,PERIOD_D1,0);
  lo = iLow(NULL,PERIOD_D1,0);
  if (i>0 && pnt>0)  {
    string objtext = DoubleToStr(sum/c/pnt,1) + " | " + DoubleToStr((hi-lo)/pnt,1) + " | " +DoubleToStr((((hi-lo)/pnt)/(sum/c/pnt))*100,0)+" %";   
//     add: + c + :here ^ to display user select adr number of days           
    ObjectSet(objname,OBJPROP_CORNER,Corner);
    ObjectSet(objname,OBJPROP_XDISTANCE,HorizPos);
    ObjectSet(objname,OBJPROP_YDISTANCE,VertPos);
    ObjectSetText(objname,objtext,FontSize,FontName,FontColor);
  }  
  return(0);
}

Arquivos anexados:

MQ4
ADR_V2.mq4
2.2 Kb

Respondido

1
Desenvolvedor 1
Classificação
(240)
Projetos
301
28%
Arbitragem
33
24% / 61%
Expirado
9
3%
Trabalhando
2
Desenvolvedor 2
Classificação
(101)
Projetos
122
30%
Arbitragem
6
33% / 33%
Expirado
5
4%
Trabalhando
3
Desenvolvedor 3
Classificação
(803)
Projetos
1123
43%
Arbitragem
47
49% / 23%
Expirado
84
7%
Livre
4
Desenvolvedor 4
Classificação
(25)
Projetos
33
24%
Arbitragem
3
33% / 33%
Expirado
4
12%
Livre
5
Desenvolvedor 5
Classificação
(104)
Projetos
134
43%
Arbitragem
0
Expirado
3
2%
Trabalhando
6
Desenvolvedor 6
Classificação
(559)
Projetos
633
40%
Arbitragem
2
100% / 0%
Expirado
1
0%
Livre
Publicou: 9 códigos
Pedidos semelhantes
Project Overview I am looking for an experienced MQL5 developer to build a custom, prop-firm-compliant trend-following Expert Advisor (EA) for MetaTrader 5 . This EA will be used on prop firm accounts (e.g., FTMO-style rules), so strict risk control and rule compliance are mandatory . This is NOT a grid, martingale, scalping, or recovery EA. The goal is consistency, rule compliance, and capital preservation , not
I would like to buy ea that is proven to be good need to have stable profit and can be very unstable DD but not more than 40 %you can send eas in dm for sale. I am looking of an Expert Advisor (EA) that has undergone independent validation and demonstrates a capability to successfully navigate prop firm challenges, as well as efficiently manage funded accounts. It is imperative that you provide a comprehensive
I am looking of an Expert Advisor (EA) that has undergone independent validation and demonstrates a capability to successfully navigate prop firm challenges, as well as efficiently manage funded accounts. It is imperative that you provide a comprehensive explanation of the strategy utilized by your EA, along with a demo version that has a 30-day expiration. This will facilitate extensive back testing and forward
I am seeking a highly skilled developer to build a fully functional automated Expert Advisor for MetaTrader 5 (MQL5)- XAUUSD fast in and out EA scalper that opens multiple trades following trend, uses dynamic lot sizing, and has to be – 24/5 unlimited. require the development of a high-speed, continuous fully automated trading Expert Advisor (EA) for MetaTrader 5, optimized for live trading on ICmarkets. The EA must
Hellow,l hope you are well,l am writing to place an order for a professional trading robot.l am looking for a reliable,well optimized robot that can trade efficiently,manage risk properly and deliver consistent performance in the market,I am particularly interested in a trading robot that uses a proven and transparent strategy,has strong risk management features,works well on common trading platforms,is suitable for
I am looking for an experienced MQL5 developer to build a professional MT5 software (indicator or semi-automated EA) for metals and major forex pairs. 📌 PLATFORM & MARKETS Platform: MetaTrader 5 Instruments: XAUUSD (Gold vs USD) XAGUSD (Silver vs USD) EURUSD GBPUSD USDJPY Trading styles: Scalping Intraday / short-term swing 🎯 MAIN OBJECTIVE I do NOT want an aggressive fully automated robot. I want a
I am seeking an experienced freelance marketing and algorithmic trading specialist to develop a user-friendly automated trading bot for the Pocket Option platform. The system should feature a simple and secure interface that allows direct login using my existing credentials. The bot will be designed to operate exclusively on multiple OTC currency pairs (a minimum of 10, such as EUR/USD OTC, GBP/JPY OTC, and similar
The robot will take buy trades when the 2 ema cross over the 10 ema and price has closed above the 50 ema. The take profit and stop loss can be set as an optional level by the user. The robot will take sell trades when the 2 ema cross under the 10 ema and price has closed under the 50 ema. The take profit and stop loss can be set as an optional level by the user. The entry timeframe will be 15 minutes, but it could
GoldTrade EA 30 - 60 USD
Hi, I am looking for someone who has already developed a high-performance Gold EA that can outperform the one shown in my screenshot. If you have such an EA, please apply for this job. Please describe how the EA works (for example, whether it uses a grid system) and provide backtest results along with the set files. If the EA meets my expectations, you can make the necessary adjustments and I will use it as my own
I am looking for someone who has or who can modify the Margin Trader EA by MaryJane preferably the MT5 version by making it pyramid using a fixed lot size addition(preferably 1st trade lot size) instead of using all the margin available to define the lotsize

Informações sobre o projeto

Orçamento
30+ USD