comment for array

 

"Arrays cannot be passed to the Comment() function. Arrays should be output elementwise"

so is there a way to put in the all array in one string?

like this

string array[];
for(int i=bars;i>0;i--)
 {
  if(iRSI(NULL,0,period,PRICE_CLOSE,i)>70
    array[i]=DoubleToStr(close[i])+"\n";
 }
string str=.....(put in all array[]);
comment(str);
 
Why not write a loop using StringConcatenate() to create a single string from the array?
 
Elroch:
Why not write a loop using StringConcatenate() to create a single string from the array?


yes like this

string array[],str;

for(int i=bars;i>0;i--)
 {
  if(iRSI(NULL,0,period,PRICE_CLOSE,i)>70
    array[i]=DoubleToStr(close[i])+"\n";
  str=StringConcatenate(str,array[i]);
 }

comment(str);
Reason: