iCustom TROUBLE - Too Many Extern Variables & repeatedly initialized and deinitialized

 

Hello,


Already read Detailed Explanation of iCustom  but still can't make iCustom working.




As can see on above picture, ZigZagAdvanced_mj_v1.13 indicator has 66 extern variables.


When include all 66 extern variables in iCustom:

iCustom(NULL,0,"ZigZagAdvanced_mj_v1.13","== set a unique prefix for objects ==","ZigZagAdvanced_mj_","Parameters for ZigZag","ExtIndicator: 0 normal ZigZag","1 for MultiTimeFrame with GrossPeriod",0,28,3,2,240,true,1000,0,"ZigZag Peak Info",false,7,"Black","Red","Blue",1.4,0.2,0,false,false,9,"Green",2,2.0,1.0,false,10,"Dark Violet",9,0.2,-0.5,"==Main ReverenceLines==",false,"SteelBlue",6,5,"==Full ReverenceLines==",false,"178,97,43",6,5,"==Additional Settings==",false,false,false,38.2,50.0,61.8,"LightGreen",2,2,90.0,140.0,"Lime",6,2,"==MIN Pips for Text Info==","Diff in Pips to be considered","HH or LL","Has nothing to do with the zigzag","calculation - just the info display",0.5,0, 1);
      

The compiler gives error: 'iCustom' - wrong parameters count


But when write iCustom like bellow:

Deleting 7 string extern variables: "==Full ReverenceLines==", "==Additional Settings==", "==MIN Pips for Text Info==", "Diff in Pips to be considered", "HH or LL", "Has nothing to do with the zigzag", "calculation - just the info display" 

iCustom(NULL,0,"ZigZagAdvanced_mj_v1.13","== set a unique prefix for objects ==","ZigZagAdvanced_mj_","Parameters for ZigZag","ExtIndicator: 0 normal ZigZag","1 for MultiTimeFrame with GrossPeriod",0,28,3,2,240,true,1000,0,"ZigZag Peak Info",false,7,"Black","Red","Blue",1.4,0.2,0,false,false,9,"Green",2,2.0,1.0,false,10,"Dark Violet",9,0.2,-0.5,"==Main ReverenceLines==",false,"SteelBlue",6,5,false,"178,97,43",6,5, false,false,false,38.2,50.0,61.8,"LightGreen",2,2,90.0,140.0,"Lime",6,2,0.5,0, 1);

The compiler works fine. 


Although the compiler works fine, it constantly initialized and deinitialized by itself slowing the CPU.

Already read iCustom - Prevent indicator from init()'ing at every call  and avoiding any variables in iCustom but still it repeatedly initialized and deinitialized by itself slowing the CPU.


Please let me know, how to write correct iCustom for this indicator which NOT repeatedly initialized and deinitialized by itself slowing the CPU?
Detailed explanation of iCustom
Detailed explanation of iCustom
  • 2012.03.22
  • www.mql5.com
Hello. I am new to coding, and am learning a lot, however I have struck something that I cannot get my head around at the moment...
 

Hi. I explained the reason for constant indicator re-initialization here https://www.mql5.com/en/forum/217721 and here https://www.mql5.com/en/forum/217617.

As for the 66 parameters MQL function calls support at most 63 parameters (the docs say otherwise = 64 but in my experience that's wrong). So, bad luck for you if you try to call iCustom() with more than that.

Regards

 
Leave out last 6 parameters - as far as I see they are not important for iCustom() call
 
  1. You can't "Deleting 7 string extern variables," that changing positioning of the rest. Leave out the last 6.

  2. iCustom(NULL,0,"ZigZagAdvanced_mj_v1.13"
    IIRC, indicator names with periods, require the extension (.ex4/.ex5) to be found.

  3. Why did you post your MT4 question in the Root / MT5 Indicators section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
    Next time post in the correct place. The moderators will likely move this thread there soon.

Reason: