I like your idea.
Here's my implementation.
// Usage:
// Comment(commentList(textString));// adds and outputs comment history with timestamps
// Comment(commentList()); // null text redisplays existing comment history
// function
string commentList(string text = ""){
static string list[31]; // list size == 30
static int r = 0; // r is the array element to return to the caller
if(text == "") return(list[r]); // null text received, return the current comment string
if(r<ArraySize(list)-1)r++; // increment return pointer while list grows
for(int i=r-1;i>0;i--){list[i]=list[i-1];}list[r]=""; // make room for new item, clear old concatenated string
list[0]="\n "+TimeToStr(TimeLocal(),TIME_SECONDS)+" "+text; // insert new list item
for(i=0;i<r;i++){list[r]=list[r]+list[i];} // recreate the concatenated string
return(list[r]); // return the concatenated string
}
I am sorry to bump this thread but it is very usefull!
Thanks DMS & Ray.
Hi, DMS & Ray thanks for sharing your work, GENIUS.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Basically, you call the function by sending a new comment string. That will be output at the very top of your chart and all of the previous comments will scroll down one "step" so that you can see the most current comment as well as a history of them.
You might also use this as a debug window since it works well for that too!
You'll need a couple of global variables like