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%
類似した注文
Trading Robot Requirements (MT5 EA – Extra Conservative) Platform: MetaTrader 5 (MT5) Markets: Forex pairs (including USDJPY, GBPJPY, GBPUSD) Gold (XAUUSD) US30 Risk Profile (Very Conservative): Risk 0.25%–0.5% per trade maximum No martingale, no grid, no averaging down One trade per symbol at a time Maximum 1–6 good trades per day Strategy Logic (All Instruments): Automatic support and resistance detection
Fixing mq5 code 30+ USD
Hello, i have a mt5 EA that uses trailing start and distance + BreakEven start and distance. It doesnt work right, what ever number i put, it always starts BE at 50 or 100 points in profit.. and also, EA stops trading if "trend alignment" or "time filter" is OFF and trades remain opened.. EA should continue trading normally until all trades are closed and then shut down for the day.. those needs fixing.. i can pay
Juniardy Meggi Tappi please help give for you many that for my wallect trading well my try may traiding forrex please...so i'm say so really thank you mybe just 30 usd
OUR EA 40 - 100 USD
1. General description Name: OUR EA Platform: MetaTrader 5 (MT5) Type: Multi‑symbol, multi‑timeframe, CE‑based trading engine Core indicator: Chandelier Exit (CE), user‑configurable Primary style: Scalping and intraday, with support for other timeframes Trade directions: Long and short Assets: Any (FX, metals, indices, crypto), no hardcoded symbol 2. Inputs (external parameters) General: - Symbol/Timeframe: -
The EA is very simple with just a few parameters to make it lightweight, fast, and above all safe when closing. The EA must close all open positions and cancel all pending orders for the basket when a certain profit or loss is reached, with the trailing profit feature. Capabilities: Closing all open positions and canceling all pending orders for the current symbol or for all symbols. Closing individual order or whole
Fixed alert mt4 40+ USD
I’m looking for an experienced developer to help fix and improve an alert system in a trading project. Tasks Review and fix existing alert logic Ensure alerts work perfectly with no lag or delay Organize and optimize scattered alert code Check for missing files and improve overall structure Suggest and implement necessary improvements Dashboard (Optional but Preferred) Create a dashboard displaying: Brand name
Стажёр MQL4 - автоматизируй реальную торговлю 🚀 Ищем стажёра по MQL4, который хочет быстро учиться и делать работающие советники/индикаторы для реальных проектов. Что от тебя: Базовый MQL4 (понимаешь структуру .mq4, умеешь писать EA/индикаторы). Знание GIT. Готовность принимать фидбек, участвовать в код-ревью и делать рабочие фичи. Интерес к трейдингу - не обязателен, но приветствуется. Что даём: 🚀 Работа над
I have an existing MT5 EA and I am sharing the exact behaviour settings below. I need a NEW custom MT5 Expert Advisor that behaves the SAME WAY as these settings. Platform: MetaTrader 5 Symbol: Gold (XAUUSD) Timeframe: M5 (Trading_TF = 0 means current chart) ======================== INDICATOR & TRADE MODE ======================== - Trade Mode = 2 (both Buy & Sell) - Trading timeframe = Current chart (M5)
For a buy case, ea will set buy stop order at the high of the current 4H candle, if the close of the current 4h candle is higher than the open and if the close is less than the high of the 4H candle , then ea will set a buy stop at the high of the current 4h candle. Reverse of this is the sell case. , - -- sell SL to 1800point for gold pair only, set 4500 point for TP, --- , BE the SL to 50points when price moved
I need a fully-automated Expert Advisor coded in MQL5 for MetaTrader 5 that follows market trends using ICT and Smart Money Concepts. The logic will rely on elements such as market structure shifts, order blocks, liquidity grabs and fair-value gaps rather than standard indicators like Moving Averages or RSI. I will share my exact entry, exit and filtering rules once we start, but please be comfortable translating

プロジェクト情報

予算
30+ USD