Download MetaTrader 5

Comments Visible Inputs Dialog Box

To add comments, please log in or register
All articles are available from MetaTrader 5. Contribute your own one!
Don De Rota
69
Don De Rota 2014.06.22 11:52 

For some reason the comments in my code are appearing in my Input dialog box in the variable column. (Build 646) eg

input string MMValues_S         = "<===== Money Managment Settings =====>";
input bool   dynamicLotSize_S   = true;  // Enable for compounding lot sizes
input string Info1_S            = " Equity Percent per trade if not compounding Risk";
input double fixedRisk_S        = 0.6;   // Percentage of bankroll to risk per trade
input string Info2_S            = " Enter the increment rate when compounding the risk 0.1 or 0.2";
input double riskIncrement_S    = 0.1;   // Increases the Risk by this amount when compounding risk
input string Info3_S            = " Enter the start of risk when compounding the risk";

And it appears

Input Dialog Box


If I delete the comments the correct variables are displayed. How do I make sure the comments are not seen? (other than deleting them) I find this puzzling, I thought comments

were supposed to be ignored.

input string MMValues_S         = "<===== Money Managment Settings =====>";
input bool   dynamicLotSize_S   = true; 
input string Info1_S            = " Equity Percent per trade if not compounding Risk";
input double fixedRisk_S        = 0.6; 
input string Info2_S            = " Enter the increment rate when compounding the risk 0.1 or 0.2";
input double riskIncrement_S    = 0.1;  
input string Info3_S            = " Enter the start of risk when compounding the risk";

Comments deleted and then it's ok.


honest_knave
Moderator
2213
honest_knave 2014.06.22 12:16  

It's designed that way:

It is possible to set another way to display names of input parameters in the Inputs tab. To do this, a string comment is used, which should be located after the description of an input parameter in the same line.
Thus, names more understandable for a user can be matched to input parameters.

https://docs.mql4.com/basis/variables/inputvariables

Don De Rota
69
Don De Rota 2014.06.22 12:25  

Thx for the reply, but that sucks.

They should've used a different format, this means I can't have my own comments for my eyes only in the inputs zone.

honest_knave
Moderator
2213
honest_knave 2014.06.22 12:52  

The only way around it that I know of is to put your comment on the next line down.

Don De Rota
69
Don De Rota 2014.06.22 14:08  
honest_knave:

The only way around it that I know of is to put your comment on the next line down.

 


Yea, that works, but it's messy, thx for the replies bud
honest_knave
Moderator
2213
honest_knave 2014.06.22 14:20  
You're welcome
Luis
226
Luis 2014.12.12 21:16  
My questions is the contrary Im coomenting my inputs and those comments doesnt appear later when the EA is added to a chart, they variables name appear. Anyone help?
Keith Watford
Moderator
9624
Keith Watford 2014.12.12 21:25  
Donex:

Thx for the reply, but that sucks.

They should've used a different format, this means I can't have my own comments for my eyes only in the inputs zone.

"extern" will not display the comment, "input" will display them
Alain Verleyen
Moderator
30737
Alain Verleyen 2014.12.13 11:45  
GumRai:
"extern" will not display the comment, "input" will display them

Nope.

Comment is displayed if #property strict is use, with both extern and input.

If #property strict is NOT used, variable name is displayed, with both extern and input.

Luis
226
Luis 2014.12.13 15:45  
angevoyageur:

Nope.

Comment is displayed if #property strict is use, with both extern and input.

If #property strict is NOT used, variable name is displayed, with both extern and input.

Thank you! This is what I needed :)

D0n
32
D0n 2015.01.12 09:28  

Use double semicolons after your setting's initial value:

#property strict

extern double  Take_Profit  = 10.0;;  // hard TP in 4 digit pips
extern double  Stop_Loss    = 10.0;;  // hard SL in 4 digit pips

This way comments will not replace external variable names in settings window. (because semicolon means "new line" and comments for replacing variable names is working in the same line only)
I hope this helps you all.

I have also pulled some of my hair because of this stupid thing. Comments are for programmers. For users there is (should be) an instruction manual in a separate pdf or txt or anything, not in the settings window. Blahhh.... :P

12
To add comments, please log in or register