Convert MT4 Indicator to MT5

Trabalho concluído

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

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
(292)
Projetos
364
30%
Arbitragem
37
27% / 65%
Expirado
10
3%
Carregado
Publicou: 10 códigos
2
Desenvolvedor 2
Classificação
(103)
Projetos
125
30%
Arbitragem
7
29% / 29%
Expirado
5
4%
Trabalhando
3
Desenvolvedor 3
Classificação
(807)
Projetos
1127
43%
Arbitragem
47
49% / 23%
Expirado
84
7%
Livre
4
Desenvolvedor 4
Classificação
(25)
Projetos
34
26%
Arbitragem
4
50% / 25%
Expirado
4
12%
Livre
5
Desenvolvedor 5
Classificação
(104)
Projetos
134
43%
Arbitragem
0
Expirado
3
2%
Trabalhando
6
Desenvolvedor 6
Classificação
(631)
Projetos
709
42%
Arbitragem
2
100% / 0%
Expirado
1
0%
Livre
Publicou: 9 códigos
Pedidos semelhantes
Looking for a Complete Forex & Gold Signal System — Telegram Automation + Performance Tracking I’m looking for a complete automated trading signal solution for Forex pairs, including EUR/USD, GBP/USD and others, as well as gold (XAU/USD). Requirements: • An average of 2–3 quality signals per day across the selected instruments. Quality matters more than generating signals just to meet a quota. • A high win rate
PROJECT: Automatic Gold and Forex Trading Robot for MetaTrader 5 (MQL5) I want a fully automated Expert Advisor (EA) for MetaTrader 5 that can analyze the market and automatically open, manage and close trades on Gold and selected Forex currency pairs. TRADING INSTRUMENTS Gold: XAUUSD Forex: EURUSD, GBPUSD and USDJPY, subject to broker availability. Allow the user to enable or disable each trading symbol. Support
I need a robot that will grow small accounts to bigger amounts like this one in this link, https://youtu.be/d38pMbJihew?si=3NeIOVyrlwDr4X_o. Please click the link and watch how this EA grow small accounts. Then create a robot like that. I will test it on demo first then if it does what i want, i will take it. Please it must be simply to use. It must set targets, for example, once it reaches $500 profit, it must
Here is a professional, detailed requirements specification draft for your MQL5 freelance order based on your prompt: ​ Strategy Objective: Develop an automated Expert Advisor (EA) featuring a 1:3 Risk-to-Reward ratio optimized for a small starting budget. ​ Core Trading Logic: ​Execute automatic Buy and Sell trades using high-probability entry signals. ​Target a strict 90% theoretical win-rate structure through
i want to fix my gold martingale bot MT5. RSI 14 ENTRY 30 BUY 70 SELL Lot 0.02 0.04 0.07 TP 150 for all SL 90 30 30 once total daily profit is 200$ stop trading stop trading once 2 consecutives total losses stop trading if spread exceeded 30 and between hour 15 & 17 PM Move SL to breakeven point once the profit exceeded 50 from from breakeven thanks
MarketMind Breakout Pro XAUUSD H1 — Donchian Breakout EA Project type: Personal EA development and backtesting Platform: MetaTrader 5 Instrument: XAUUSD Timeframe: H1 Strategy: Donchian Channel breakout with EMA 200 Project overview This project evaluates a Donchian breakout trading strategy for XAUUSD on the H1 timeframe. The system uses channel-based breakout conditions and an EMA 200 trend filter. Historical
The purpose of this order is ONLY to test and implement my H1 POI (Point of Interest) identification logic correctly. I am not requesting the complete EA at this stage. I will provide the exact rules for identifying the H1 POI after selecting the developer. The developer must convert those rules into clear, deterministic MQL5 logic. Requirements: Analyze H1 candles according to the rules I provide. Identify and mark
Title: Fully Automatic MT5 Trading Bot (Expert Advisor) with Risk Management I want a fully automated trading robot (Expert Advisor) for MetaTrader 5, written in MQL5. The bot must automatically analyse market data, identify trading opportunities, execute BUY and SELL orders, manage open positions, and close trades according to predefined rules without requiring manual confirmation for each trade. Requirements
Hello, I’m looking for an experienced developer to research, build, test, and install a fully automated MetaTrader 5 trading bot for gold, XAUUSD. My total development and installation budget is $300, including all agreed work and fees. My goal is to pass a $100,000 FTMO US Two-Step Standard evaluation and sustainably maintain the funded account. I need a day-trading strategy that can buy in bullish markets and sell
I have three indicators that operate independently. I want to combine them into one indicator with custom expert programming that automatically enters trades when a signal is generated by one of the indicators. I will pay for this service Thanks you

Informações sobre o projeto

Orçamento
30+ USD