Download MetaTrader 5
To add comments, please log in or register
Publish your article. Millions of traders are looking for good ideas!
Route206
211
Route206 2015.06.24 09:10 

Hello

is there an easy way to get an Array[27][4] on a chart for real-time monitoring?

I was well under way with Comment() but ran into a maximum. The idea is to show these variables and also to have some headers. Ideally negative values in red etc. but definitely in the category 'nice to have'.

also tried with ObjectCreate() and ObjectSetText() but the latter didn't take variables. 

Ideally there is some ready made code out there.... Any suggestions?

Keith Watford
Moderator
7979
Keith Watford 2015.06.24 09:38  
Route206:


also tried with ObjectCreate() and ObjectSetText() but the latter didn't take variables. 

 Show the code you have used

 ObjectSetText() can be used with a string variable as the text

Paul B
173
Paul B 2015.06.24 09:51  

Use nested https://docs.mql4.com/strings/stringconcatenate to get past the maximum limitation. For example:

 

string text;

for(int i=0; i<=26; i++)
{
   text=StringConcatenate(text,Array[i][0]," ",Array[i][1]," ",Array[i][2]," ",Array[i][3],"\n");
}

Comment(text);
Route206
211
Route206 2015.06.24 10:15  
GumRai:

 Show the code you have used

 ObjectSetText() can be used with a string variable as the text

  ObjectCreate("ObjName", OBJ_LABEL, 0, 0, 0);
  ObjectSetText("ObjName",("00.00      07.00      FOREX       W/V     Max\n",k0,"    ",k1,"    ",inst,"     ",wv,"      ",max),10, "Verdana", Green);
  ObjectSet("ObjName", OBJPROP_CORNER, 3);
  ObjectSet("ObjName", OBJPROP_XDISTANCE, 100);
  ObjectSet("ObjName", OBJPROP_YDISTANCE, 20);

 

Route206
211
Route206 2015.06.24 10:16  
Paul_B:

Use nested https://docs.mql4.com/strings/stringconcatenate to get past the maximum limitation. For example:

 

 

smart - i'll try that first!
/
To add comments, please log in or register