turn iCustom(zigzag) to mql5 not working anymore

 

Hi, in these day im trying to study mql5 to pass to it i think in the next months. but several scripts are not working, including the ones that are supposed to work like this,


double zigzag=iCustom("EURUSD",PERIOD_M5,"ZigZag",16,5,3,0,1); 

Print("zigzag: ",zigzag);

it says this

2019.02.27 19:19:50.379 prova (EURUSD,M5)  cannot load custom indicator 'ZigZag' [4802]

on mt4 it worked but i have no idea how to fix it, maybe the path of the indicator?

 
Alessandro Mariani:

Hi, in these day im trying to study mql5 to pass to it i think in the next months. but several scripts are not working, including the ones that are supposed to work like this,


it says this

on mt4 it worked but i have no idea how to fix it, maybe the path of the indicator?

Using indicators in MQL5 is quite different than in MQL4

https://www.mql5.com/en/articles/31
MQL5 for Newbies: Guide to Using Technical Indicators in Expert Advisors
MQL5 for Newbies: Guide to Using Technical Indicators in Expert Advisors
  • www.mql5.com
An Expert Advisor or indicator that doesn't use standard technical indicators in its code is rare. They are popular both for the beginners and advanced developers of trading strategies. It isn't difficult to understand the details of indicator creation; the aim of this article is to help with it. We will consider the use of the functions for...
 
Did you manage to get it working? :) 
 

you'll find the MT5 Zigzag indicators in the Examples folder. There's also a color version.

To get the handle:

input int      InpDepth=12;
input int      InpDeviation=5;
input int      InpBackstep=3;

int ZigzagHandle;

int OnInit()
  {
   ZigzagHandle=iCustom(_Symbol,_Period,"Examples/ZigZag",InpDepth,InpDeviation,InpBackstep);
   if(ZigzagHandle==INVALID_HANDLE) { Print("invalid Zigzag handle, error: ",_LastError); return INIT_FAILED; }
   return INIT_SUCCEEDED;
  }
 
Alessandro Mariani:

Hi, in these day im trying to study mql5 to pass to it i think in the next months. but several scripts are not working, including the ones that are supposed to work like this,


it says this

on mt4 it worked but i have no idea how to fix it, maybe the path of the indicator?

An example of working with the ZigZag indicator.

How to start with MQL5
How to start with MQL5
  • 2018.12.24
  • www.mql5.com
This thread discusses MQL5 code examples. There will be examples of how to get data from indicators, how to program advisors...