limitation on comments - doesnt make sense .......

 

ok

take the code below and compile it, there will be no errors.

now un comment one of the comments and compile it, it gives a error: " ')' - wrong parameters count C:\Program Files\Ava MetaTrader\experts\junk.mq4 (68, 10) "

does anyone have a work around / fix for this ?


//+------------------------------------------------------------------+
//| junk.mq4 |
//| Copyright © 2010, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"

double cprice; //current price
double cprice2; // 2nd uma line
int mamethod=3;
int mamethod2=3;
extern int maperiod=50;
extern int matime=0;
extern string store_period="3-12";
extern int store_periods=4;

extern string uma_2nd="--------------";
extern int maperiod2=50;
extern int matime2=0;
extern string store_period2="3-12";
extern int store_periods2=4;
extern string br="--------------";

extern string digit="5 digit brkr=add 0";
extern int slippage=3;
extern double lot_size=0.01;
extern int maxSL=25;
extern int maxTP=10;
extern int delay=0;
extern string comment="uma-final-multi for opt only";

double store_price1;
double store_price2;
string store_ind1; string store_ind2;string store_ind3;string store_ind4;string store_ind5;string store_ind6;string store_ind7;string store_ind8;string store_ind9;string store_ind10;string store_ind11;string store_ind12;
string store2_ind1; string store2_ind2;string store2_ind3;string store2_ind4;string store2_ind5;string store2_ind6;string store2_ind7;string store2_ind8;string store2_ind9;string store2_ind10;string store2_ind11;string store2_ind12;

double ticket;
int gle;


int start()
{




Comment(
"\n uma-final-multi 2 ",
"\n Date ",Month(),"/",Day(),"|"," Time ",TimeHour(TimeCurrent()),":",TimeMinute(TimeCurrent()),
"\n store_ind1 ",store_ind1," ","store2_ind1 ",store2_ind1,
"\n store_ind2 ",store_ind2," ","store2_ind2 ",store2_ind2,
"\n store_ind3 ",store_ind3," ","store2_ind3 ",store2_ind3,
"\n store_ind4 ",store_ind4," ","store2_ind4 ",store2_ind4,
"\n store_ind5 ",store_ind5," ","store2_ind5 ",store2_ind5,
"\n store_ind6 ",store_ind6," ","store2_ind6 ",store2_ind6,
"\n store_ind7 ",store_ind7," ","store2_ind7 ",store2_ind7,
"\n store_ind8 ",store_ind8," ","store2_ind8 ",store2_ind8,
"\n store_ind9 ",store_ind9," ","store2_ind9 ",store2_ind9,
"\n store_ind10 ",store_ind10," ","store2_ind10 ",store2_ind10,
"\n store_ind11 ",store_ind11," ","store2_ind11 ",store2_ind11,
// "\n store_ind12 ",store_ind12," ","store2_ind12 ",store2_ind12,
// "\n -----------------------",
// "\n maxSL ",maxSL," ","maxTP ",maxTP,
// "\n lot_size ",lot_size,
// "\n maperiod ",maperiod," ","maperiod2",maperiod2,
"\n slip ",slippage," Delay ",delay/1000
);

}
//+------------------------------------------------------------------+
Files:
junk.mq4  5 kb
 

move the caret to the word Comment in your source code and press F1. The Documentation for Comment() will pop up and there it is written: "Amount of passed parameters cannot exceed 64.". This is because mql4 is a language that does not have any means to create a function with a variable number of arguments. Therefore they simply made it to accept exactly 64 arguments for this function because they thought this should be enough for everyone.

You can concatenate some of the strings to larger strings before passing them to Comment().

 

thanks - will do

Reason: