Convert Single Symbol function to Multi Symbol

仕事が完了した

実行時間20 分
依頼者からのフィードバック
Highly recommended, Work delivered very fast and with 100% satisfaction,

指定

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

応答済み

1
開発者 1
評価
(361)
プロジェクト
643
26%
仲裁
92
72% / 14%
期限切れ
12
2%
仕事中
パブリッシュした人: 1 code
2
開発者 2
評価
(38)
プロジェクト
50
10%
仲裁
1
0% / 0%
期限切れ
8
16%
類似した注文
Hello, Good programmer help in track of programmer in mql5 market sells product and give fake expert advisor see attached for name of programmer. NEEDS TO GIVE HIS CLIENT MONEY BACK OR PROVIDE THE REAL EXPERT ADVISOR Gold on the Go Experts Nguyen Hang Hai Ha Version: 1.1 Updated: 23 June 2025 Activations: 10 Expert Gold on the Go is the latest generation of automated trading robots programmed
Hello! I am looking for an experienced developer to build a robust, customizable Expert Advisor (MT4/MT5) or a standalone Python bot. The strategy is based on pure Price Action (Support & Resistance breakouts) on the XAUUSD (Gold) 30-Minute chart. It relies heavily on "human-like" chart analysis, such as looking left for targets, waiting for a price pullback (a "flip") before entering, and managing the trade based on
Acrylic-bot 30 - 800 USD
Creating this robot to help trade for you.It all about making profit. A robot that can change lives help people make profits. It’s not just a bot but the way to the future
I need very small modification in MQL4 code, details will be send for selected programmers. Source of code required. Thank you for your patience and attention, Have a nice day! I prefer programmers who will be accepting crypto payment on next project, so please write me in first message if you will be able to accept crypto in the future
Ready hft bot 100+ USD
hello great developer We want a bot like this that flips small accounts We need a bot that works live account and flips small accounts but places 2 direction buy stop and sell stop at the same time brother
SavannaFX Pro 100+ USD
//+------------------------------------------------------------------+ //| SavannaFX Pro | //| Created for Junior | //+------------------------------------------------------------------+ #property strict input int FastMA = 20; input int SlowMA = 50; input int RSIPeriod = 14; input double LotSize = 0.1; input int StopLoss = 300; input int TakeProfit = 600; int
Recent EA 30+ USD
PROP-FIRM FOREX EA (SAFE MODE) 1. EA OBJECTIVE Develop a low-drawdown, high-discipline Forex EA designed to: Pass prop-firm challenges Respect strict risk rules Trade consistently, not aggressively 2. TRADING STYLE Strategy type: Trend continuation + pullback No scalping noise No martingale No grid No hedge abuse 3. TIMEFRAME & SESSIONS Primary TF: M15 Confirmation TF: H1 Trading sessions: London Open → London Close
How long would it take to install automated trading on Ninjatrader and what information would you need ? It urgent if anyone can help with this kind do well by biding to this project and let discuss more
Specification Hi Free lancers, I need an EA which relates to Sure Fire Hedging EA base on Below parameters needed. Overview how it works: This EA will be able to open a trade with either Buy or Sell selection (manual- to be manually switch buy or sell selection ), another selection for automatic open trading can choose only buy. Once the EA already open trade (example -buy position) with starting lot size 0.01
Hedge Lot Plus EA Descriptions: (New EA) 1- The necessary explanations, documentation, and working principle details will be provided after the contract is signed. 2- The chart, button, and dashboard- template sample code will be provided. 3- There is no indicator. and work principle is easy. ** After the contract is signed,sampe code, a sample EA for "Hedge Lot Plus EA" and detailed information about the working

プロジェクト情報

予算
30+ USD