Help with the COMMENT programming MQ4

 
I'm a newbie to programming and have a couple of questions that I might hope someone can answer.Please if you only know the answer to 1 of the two questions, simply reply to that. I'm sure another one of you kind experts will chime in on the other.

  1. When using the COMMENT(); command in MQ4 how does one change the color of that comment when it is displayed in the chart. I know it can be done as I've seen a few indicators that show bars of green or red when certain conditions are met. What I'd like to do is something similar, if a favorable condition is met for buying, I want the comment to turn green. Likewise if conditions are favorable for shorting . . . turn red.
  2. Is there a way of outputting these comments to a log file. Say every 10 seconds, it records certain comments to a log file (either text but preferably an excel spreadsheet). My comment section for my EA has numbers that are always changing and I'd like to know what they look like graphically.
Thanks friends. Any and all help would be greatly appreciated.

Regards,
Kasio
 

1.
"how does one change the color of that comment when it is displayed in the chart"
no can do. comment() only prints in screen font. see attached file which you can #include <..> into your source compile or copy paste into your own 'tools' source file, etc.
NOTE:the code works for me ok, but of course each has their own likes/dislikes - so hack it to death if need to = how one learns :)
.
2.
you have complete control over writing data to files. See "File Functions" in your help or on this site.
Can even use some Windows I/F code so can do I/O anywhere instead of just experts\files\...
user jjc has posted useful code on this - do a search...
.
hth

Files:
 
fbj,

Your help is much appreciated. I am however much more of a novice that you give me credit for.

Do you mind walking me through how I would print the comment to a file using "File Functions"?

Thanks for that . . . and thanks for bringing me back to reality regarding comment() color.

Regards,
Kasio
 

Please do read the relevant parts in The Book on this site - link at top of all pages "Book"

Please appreciate that should you not put efforts into reading and most importantly, following the examples and even more 'fun' is to write very simple scripts that demonstrate to yourself that you fully understand. To get you going I offer these steps. I cannot teach programming. That is your job. I like many here are attempting to live our trading lives also, and that takes many hours...
Go here https://book.mql4.com/functions/index
Maybe look at "File Operations"
IF not understand the text and/or the MQL4
THEN go back to the books contents on "Practical Programming in MQL4"
and get a handle on the language you have chosen to use.
.
Sorry Kasio, but there is no shortcut in the end - else you'll just be asking questions all the time over the basics, yes?
.
just my take on it all. maybe I should not have replied to your post. I'm just not into teaching basic programming skills and my response is not meant as a slight on your good self, ok?
.
bye for now

 
fbj,

No offense taken -- In fact I appreciate your candor. I have tried numerous tutorial sites and have given up as it can be challenging if you do not have any programming background. That said, I will check out your link and go from there.

Thanks for the help you've already advanced me.

Regards
 
kasio79:
When using the COMMENT(); command in MQ4 how does one change the color of that comment

Can't change the color of Comment()'s. But you can create text Objects and change them.

kasio79:
is there a way of outputting these comments to a log file.

Print()?

Reason: