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
評価
(359)
プロジェクト
637
26%
仲裁
89
73% / 13%
期限切れ
12
2%
仕事中
パブリッシュした人: 1 code
2
開発者 2
評価
(38)
プロジェクト
50
10%
仲裁
1
0% / 0%
期限切れ
8
16%
類似した注文
I need an experienced developer to convert my MT4 EA based on the Super Trend indicator to MT5. The new EA should also include additional features. Essential modifications: - Incorporate additional indicators: Moving Average and PSAR. - Add custom alerts: Push and sound notifications. - Implement money management rules
I have a custom EA that I need optimized. I need it optimized for many pairs and the set files sent to me. The EA was created a few months ago, it works, but I need it optimized for it to run better
hello freelancers i need some one with a profitable ea for gold and dj30 i need the ea to be a scalping ea which places orders with sl and tp of 200 points for each trade and have a winning rate of more than 70 percent. if you have it already please apply for this
A robot 50+ USD
hy i am looking for someone who can fix robot for me .i need someone who know about order block .my entries are only order block. I have robot already i need only fix it.i just need someone who can fix this as soon as possible
Hello, I m looking for experienced developer to code me indicator Market structure all in one in my EA MONEYPAL, to open trade on FVG separated by fractal signals.Thank you Regards
EMA CROSS OVER I NEED EMA CROSS OVER ROBOT THAT EMA 5,10,21 CONDITIONS 1 5 EMA ABOVE 21 CANDLE CLOSE BUY 2 5 EMA JUST BELOW EMA 10 TAKE PROFIT 3 5 EMA BELOW 21 CANDLE CLOSE SELL 4 5 EMA JUST CLOSE EMA 10 FROM DOWN TAKE PROFIT
I’m looking to consult with an experienced developer about the creation of a reliable copy trading system specifically designed for scalping . Currently, we are managing more than 100 accounts copying trades from a single master account. Since we use scalping strategies, even a small delay can impact the performance and results. The systems we’ve tried so far have delays of up to 5 seconds, which is too much for this
Hello, I want to debug my sierra chart and I have the study. That's the study I just want to add 4 study overlay in the input settings and color bar based on alert condition is sg1=1 That's the study I want it to trail the order instead of flat to avoid too much slippage What I do is the 15-Minutes chart I have filter also in the 10tick chart if those filters are meet the bar is green or red using sierrachar color
The PRD: 1. Plugin ensures that individual opening positions come from MT4 to our colocated virtual machine 2. A score is returned from a lookup 3. Binary decision based on score. 4. Matches closing position with opening position; doesn't score, simply closes the trade. The plugin UX should have the following: 1. Risk threshold per grouping, easily entered by the client 2. Reporting of revenue comparisons To confirm
I need an EA for magic number that shows three unique numbers in every single candle.Mainly this EA shows the strength of the candle and momentum . More details inbox me

プロジェクト情報

予算
30+ USD
開発者用
27 USD