Download MetaTrader 5

Custom indicator input name

To add comments, please log in or register
Dua Yong Rew
5554
Dua Yong Rew  

I tired to put

input ENUM_TIMEFRAMES  TF          = PERIOD_W1;      // Time Frame


 But when I load the indi, the inputs windows still show TF instead of Time Frame

#property copyright "doshur"
#property link      "https://www.mql5.com"
#property version   "1.10"

input ENUM_TIMEFRAMES  TF          = PERIOD_W1;      // Time Frame
input ENUM_LINE_STYLE  Style       = 3;              // Line Style
input color            Clr         = MediumOrchid;   // Colour
input bool             DropBack    = false;          // Line Drop Back
input int              Lines       = 10;             // Number Of Lines
input int              Count       = 200;            // Data Points
input int              Proximity   = 25;             // Proximity
input int              Distance    = 200;            // Distance
input bool             UseHL       = true;           // User High Low
input bool             UseCC       = true;           // User Close
honest_knave
Moderator
2342
honest_knave  
#property strict
 
Dua Yong Rew
5554
Dua Yong Rew  
honest_knave:
#property strict
 
Weird thing is that if I use this, my indicator won't repaint
honest_knave
Moderator
2342
honest_knave  
Dua Yong Rew:
Weird thing is that if I use this, my indicator won't repaint
Is the compiler giving you warnings now?
Mladen Rakic
71108
Mladen Rakic  
Dua Yong Rew:
Weird thing is that if I use this, my indicator won't repaint
You have codding issues then that need to be changed in order to make your code "strict compatible"
Dua Yong Rew
5554
Dua Yong Rew  
Mladen Rakic:
You have codding issues then that need to be changed in order to make your code "strict compatible"
Where can I read on strict compatible?
honest_knave
Moderator
2342
honest_knave  
Dua Yong Rew:
Where can I read on strict compatible?

The compiler will tell you what you need to fix in your code. Are you getting warnings / errors?

Also see here  

Updated MQL4 - MQL4 Reference
Updated MQL4 - MQL4 Reference
  • docs.mql4.com
Updated MQL4 - MQL4 Reference
whroeder1
17116
whroeder1  
Dua Yong Rew: Where can I read on strict compatible?
Program Properties (#property) - Preprocessor - Language Basics - MQL4 Reference
Likely one of these
PreviousStrict
Implicit initialization of all the variables (both global and local ones) by zeroOnly global variables are initialized. In local variables, only strings are initialized implicitly
Local arrays are not released when exiting the function (implicitly static)Local arrays are released when exiting {} block
"Array out of range" does not cause a critical error"Array out of range" is a critical error causing the program to stop (check logs)
Dua Yong Rew
5554
Dua Yong Rew  
whroeder1:
Program Properties (#property) - Preprocessor - Language Basics - MQL4 Reference
Likely one of these
PreviousStrict
Implicit initialization of all the variables (both global and local ones) by zeroOnly global variables are initialized. In local variables, only strings are initialized implicitly
Local arrays are not released when exiting the function (implicitly static)Local arrays are released when exiting {} block
"Array out of range" does not cause a critical error"Array out of range" is a critical error causing the program to stop (check logs)

Actually there are no errors generated when I use the strict line.

Just that my indicator cannot repaint 

honest_knave
Moderator
2342
honest_knave  
Dua Yong Rew:

Actually there are no errors generated when I use the strict line.

Just that my indicator cannot repaint 

Check your Experts log for "Array out of range" error.
Dua Yong Rew
5554
Dua Yong Rew  
honest_knave:
Check your Experts log for "Array out of range" error.

OK. Let me check on that.

Thanks 

12
To add comments, please log in or register