Convert Single Symbol function to Multi Symbol

MQL5 Indicadores Experts

Trabalho concluído

Tempo de execução 20 minutos
Comentário do cliente
Highly recommended, Work delivered very fast and with 100% satisfaction,

Termos de Referência

ON an EA (not for trading but only for reading buffers) which has a function SearchZigZagExtremums

I want this function to be converted into multi symbols  multi period

below is my attempt to modify the free program which is available in mql codebase

//+------------------------------------------------------------------+
//|                           ZigZag EA(barabashkakvn's edition).mq5 |
//|                                   Copyright © 2009, Tokman Yuriy |
//|                                            yuriytokman@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, Tokman Yuriy"
#property link      "yuriytokman@gmail.com"
#property version   "1.002"

//--- input parameters
input string      ____1___          = "Настройки индикатора ZigZag";
input int         ExtDepth          = 12;             // Depth
input int         ExtDeviation      = 5;              // Deviation
input int         ExtBackstep       = 3;              // Backstep
//---
//---
int            handle_iCustom;               // variable for storing the handle of the iCustom indicator
#define RESET 0
int min_rates_total;
int symbolCount;
string symbolsList[];
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit() {
//---
   min_rates_total=100;
//--- indicator buffers mapping
   symbolCount=SymbolsTotal(true);
   if( ArrayResize(symbolsList, symbolCount) < symbolCount ) return (INIT_FAILED);

//--- create handle of the indicator iCustom
   for(int i=0; i<symbolCount; i++) {
      symbolsList[i] = SymbolName(i,true);
      handle_iCustom=iCustom(symbolsList[i],Period(),"Examples\\ZigZag");
//--- if the handle is not created
      if(handle_iCustom==INVALID_HANDLE) {
         //--- tell about the failure and output the error code
         PrintFormat("Failed to create handle of the iCustom indicator for the symbol %s/%s, error code %d",
                     symbolsList[i],
                     EnumToString(Period()),
                     GetLastError());

         //--- the indicator is stopped early
         return(INIT_FAILED);
      }
   }

//---
   return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason) {
//---

}
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick() {
//---

//---
for(int j=0; j<symbolCount; j++) {
      symbolsList[j] = SymbolName(j,true);
      
   double array_results[];
 
      if(!SearchZigZagExtremums(4,array_results))
         return;
         
      double high=0.0,low=0.0;
      double room_0 = array_results[0]; // index 0
      double room_1 = array_results[1]; // index 1
      double room_2 = array_results[2]; // index 2
      double room_3 = array_results[3]; // index 3

//--- находим верх и низ
      if(room_1>room_2) {
         high=room_1;
         low=room_2;
      } else {
         high=room_2;
         low=room_1;
      }
     
      Print(symbolsList[j], array_results[0]);
      Sleep(1000);
      }
      


//---

   }

//+------------------------------------------------------------------+
//| Search for indicator extremums                                   |
//+------------------------------------------------------------------+
   bool SearchZigZagExtremums(const int count,double &array_results[]) {
      if(!ArrayIsDynamic(array_results)) {
         Print("This a no dynamic array!");
         return(false);
      }
      ArrayFree(array_results);
      ArrayResize(array_results,count);
      ArraySetAsSeries(array_results,true);
      int      buffer_num=0;           // indicator buffer number
      double   arr_buffer[];
      ArraySetAsSeries(arr_buffer,true);
//--- reset error code
      ResetLastError();
//--- fill a part of the iCustom array with values from the indicator buffer
      int copied=CopyBuffer(handle_iCustom,buffer_num,0,100,arr_buffer);
      if(copied<0) {
         //--- if the copying fails, tell the error code
         PrintFormat("Failed to copy data from the iCustom indicator, error code %d",GetLastError());
         //--- quit with zero result - it means that the indicator is considered as not calculated
         return(false);
      }
      int elements=0;
      for(int i=0; i<copied; i++) {
         if(arr_buffer[i]!=0) {
            array_results[elements]=arr_buffer[i];
            elements++;
            if(elements==count)
               break;
         }
      }
      if(elements==count)
         return(true);
//---
      return(false);
   }


Goal : I want this program to be modified so it can read buffers 

      double room_0 = array_results[0]; // index 0
      double room_1 = array_results[1]; // index 1
      double room_2 = array_results[2]; // index 2
      double room_3 = array_results[3]; // index 3

for each symbol existed in marketwatch and when i print

Print(symbolsList[j], array_results[0]);

I get results like

Symbol_1 buffer_for_Symbol_1 for PERIOD_1

Symbol_2 buffer_for_Symbol_2 for PERIOD_2

like this

Respondido

1
Desenvolvedor 1
Classificação
(359)
Projetos
639
26%
Arbitragem
91
71% / 14%
Expirado
12
2%
Trabalhando
Publicou: 1 código
2
Desenvolvedor 2
Classificação
(38)
Projetos
50
10%
Arbitragem
1
0% / 0%
Expirado
8
16%
Livre
Pedidos semelhantes
Description: We are looking for an experienced MT4/MT5 EA developer to build a fully automated trading bot for BTCUSD (M15 timeframe) . The EA should combine chart pattern recognition, candlestick analysis, and a grid trading system with automated trade management. ✅ Requirements: 1. Chart & Candlestick Pattern Recognition Identify Head and Shoulders and Inverted Head and Shoulders patterns. Recognize key candlestick
Hello, good day to you Developers, I am looking for someone that can deliver on a project with the following requirements: The job I am about to give out will involve "Tradingview" and "cTrader" Tradingview: for analysis, as the Strategy uses one second charts/candles, cTrader: for executing and managing the trades. - For this cBot to work well for the project's aims, SPEED of execution is of upmost importance. - The
Job Description: · I am looking for an experienced MQL4 developer to create a high-speed scalping EA for US30 and DE40. The EA must be optimized for ultra-fast execution and should not rely on any indicators—only price action and pending orders (Buy Stop & Sell Stop). · I have written a complete and detailed documentation outlining the logic, execution flow, risk management, and required settings
The following Logic should be created example entryprice 3000 SL in the beginning 2996 Price reaches Entrpy oint = 3000 nothing happens Price reaches Entry point +NowTrailingSL_value(=2.0) price is then 3002 SL is moved to = 3000.20 ( is 3000+ 0.20) Price reaches Entry point +TopOnNowTrailingStoplossValue(=4.0) price is then 3004 SL is still 3000.20 Nothing happens Price reaches Entry point
I 'm contacting you because I'm currently managing an Excel project that centralizes the results monitoring of my trading accounts and the technical characteristics of my Expert Advisors (EAs) . The current system consists of several linked spreadsheets where : • Trading data is automatically uploaded from FXBlue/CSV • Key metrics are consolidated (Win Rate, Profit Factor, Expectancy, SQN, Drawdown, MAR , etc.) •
Looking for an EA that has been previously tested and can pass prop firm challenges. You will need to demonstrate the EA to showcase true nature. Please only apply if you have a system ready. This can be a previous job you already done for someone or have something in the files
Mthizo trades 30 - 200 USD
- *Currency Pairs*: Major pairs such as EUR/USD, XAU/USD and GBP/USD - *Funding Currency*: South African Rand (ZAR) - *Initial Deposit*: R100 (may require additional deposit for live trading) - *Risk Management*: Basic risk management features, such as stop loss and take profit - *Strategy*: Pre-defined strategy based on Smart Money Concept principles - *Cost*: Approximately R100-R200 (one-time cost or
I am interested in purchasing a ready-made automated EA (Expert Advisor) that is already tested and profitable. My key requirements are: Consistent profits with proven results (backtests and/or live performance) Low to medium risk, not overly aggressive Works on major forex pairs, indices, or gold Ready to use with minimal setup If you have an EA that meets these criteria, please share details, performance records
Robot (metatrader5) 30 - 200 USD
I need an Expert Advisor (EA) for MetaTrader 5 that trades only XAUUSD (Gold). The strategy should include: • EMA (50) on M15 timeframe • RSI (14) with overbought = 70 and oversold = 30 • ATR (14) for Stop Loss and Take Profit calculation • Higher timeframe EMA (200 on H1) as trend filter • Lot size calculation based on risk percentage (% of balance) • Magic number for trade identification • Trading hours: 07:00 –
I am good in coding. I am a Quant Developer in a Company. I like to create the idea in to code. I love to code in C++, Python and MQL

Informações sobre o projeto

Orçamento
30+ USD
Desenvolvedor
27 USD