A Doubt...

 

im trying to transform some indicator to expert advisor just for display some information(acc detail, spread swap ....)


the problem i met is how to display it on other corner rather than top left side, because i using comment function to display it

 
forexparvenu:

im trying to transform some indicator to expert advisor just for display some information(acc detail, spread swap ....)


the problem i met is how to display it on other corner rather than top left side, because i using comment function to display it

Comment always outputs text top the top left corner . . . it cannot be moved. Use a Label Object instead . . .
 

yes, it is possible

//+------------------------------------------------------------------+
//|                                                  MACD Sample.mq4 |
//+------------------------------------------------------------------+

extern int shift=50;

//+------------------------------------------------------------------+
void showcomment(int shift) {
 string res="";
 for(int i=0; i<shift; i++) {
  res=res+" ";
 }
 Comment("\n"+
         res+"you can show the"+"\n"+
         res+"comments anywhere"+"\n"+
         res+"on your chart by"+"\n"+
         res+"adjusting this"+"\n"+
         res+"extern shift variable");
 return;
}
//+------------------------------------------------------------------+
int init() {
 showcomment(shift);
 return(0);
}
//+------------------------------------------------------------------+
int deinit() {
 Comment("");
 return(0);
}
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start() {
 return(0);
}
 
LordoftheMoney: yes, it is possible
Your code just shows a multi line comment with spaces added. The question was
forexparvenu: how to display it on other corner rather than top left side

How many spaces do you need to put it on the right top? Depends on the window size in pixels and comment font size and comment width. You show no such code.

How many extra lines to you need to put it on the bottom side? Depends on the window size in pixels and comment font size and comment line count. You show no such code.

All you are doing is moving the comment relative to the top left corner. That is not equivalent to displaying it relative to another corner. It is NOT POSSIBLE with Comment() but you can partially simulate it.

 
RaptorUK:
Comment always outputs text top the top left corner . . . it cannot be moved. Use a Label Object instead . . .


yes, finally i done it.
 
WHRoeder:
Your code just shows a multi line comment with spaces added. The question was

How many spaces do you need to put it on the right top? Depends on the window size in pixels and comment font size and comment width. You show no such code.

The comment is still top left . . . just with lots of spaces . . .
Reason: