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
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); }
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.
Comment always outputs text top the top left corner . . . it cannot be moved. Use a Label Object instead . . .
yes, finally i done it.
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.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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