Convert Single Symbol function to Multi Symbol

MQL5 Indicadores Asesores Expertos

Trabajo finalizado

Plazo de ejecución 20 minutos
Comentario del Cliente
Highly recommended, Work delivered very fast and with 100% satisfaction,

Tarea técnica

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

Han respondido

1
Desarrollador 1
Evaluación
(356)
Proyectos
632
26%
Arbitraje
89
73% / 13%
Caducado
12
2%
Libre
2
Desarrollador 2
Evaluación
(38)
Proyectos
50
10%
Arbitraje
1
0% / 0%
Caducado
8
16%
Libre
Solicitudes similares
I need a feature setup that will input the Sunday opening price as a horizontal ray on any chart and can be used by another EA as part of a trading strategy. Like this TradingView example below
I need a mobile phone EA that is similar to no limitz EA mobile bot which will use an ea converter for scalping strategy that will execute trade automatically, set tp and sl for different pairs using integrated trading strategies . It must hedge for both action to buy and sell under 1 min and 5 min based on scalping strategy to execute trades
Hello everyone, I am looking for a talented developer who can help me create my EA. I have several indicators that I want to combine in the EA. I will take care of the integration of the indicators and the trading strategy myself, I need someone to program all the trading operations for me. This is probably absolutely standard, someone with experience has certainly programmed this several times before. Here are the
Hi there, I am looking for someone to build a Martingale/Cost Averaging Expert Advisor (EA) with the following features and functions: Martingale and Cost Averaging Features: 1. **Martingale Calculation Settings:** - Standard Martingale system allowing the trader to set the initial trade size and the pip step for subsequent trades. - Option for averaging up and averaging down: - **Averaging Up:** Lot size
Job Title: MQL5 Trading Bot Code Debugging and Optimization** **Description:** We are seeking an experienced MQL5 developer proficient in debugging and optimizing trading bot codes. The current project involves fixing existing code that runs into debugging issues without errors and optimizing it for efficient performance in live trading environments. **Responsibilities:** - Debug existing MQL5 trading bot code to
need a very skilled developer to create ea from indicator .i have source code for the indicator and it is non repainting. More details will be provided .i need parameters like take profit/stop/loss/loss recovery and few more
Active expert 250+ USD
hi, I must do changes to a dashboard with manual input of trader and active expert. Budget 250$ Can do? the budget is correct based on job to do. If you want me to increase the budget you can message me
HELLO DEAR DEV'S. I'VE AN EA BUT IT STOP WORKING WHEN MT4 HAS BEEN UPDATED TO THE LATEST VERSION (1420). SO I NEED A GOOD DEVELOPPER THAT COULD UPDATE THIS EA TO THE LATEST VERSION OF MT4 SO I CAN USE IT. NB: IT'S A SINGLE FILE (.EX4) AND THE PRICE CAN BE NEGOCIATED TO BE SUITABLE FOR BOTH PARTIES. THANK YOU
hey friends, I am looking to build a smart trading robot, for the capital market. He knew how to trade in all the different types of trade. Example - in shares, currencies, index, indices, ETFs, funds, commodities, options, futures and so on. Suitable for trading on all stock exchanges in the world. It will be possible to install the trading robot in the MetaTrader 5 trading software. But it will also be possible to
STI EA 30 USD
I need to convert this MT4 indicator into MT5 EA/indicator. The problem is I only have the .ex4 file bt not .mq4 file and it is also a repainting indicator. I need preliminary assessment if the conversion can be done based on .ex4 file first before exploring the EA details further. Attached is the indicator Budget below is just indicative for the assessment. We can discuss further once the conversion can be done and

Información sobre el proyecto

Presupuesto
30+ USD
Para el ejecutor
27 USD