Data Display Indicator.

 

Can someone help me find an example of how to code an indicator that displays data versus and indicator line. What I am looking for is an indicator that will display the bar number of each bar.

 

A) many charts I've seen display data (pricing I presume) & one or more indicator lines (if not lines then values or showing 'some value' some how)

B) IMO There is no such thing as a meaningful 'bar number'; bars are usually named by its time & duration.

Do you mean ' number from left' or 'number from right'?

With 'from Left', it depends on how much history you display, and will change once your chart fills & starts dropping off the oldest one.

'From Right' might conceivably be useful, but then again the numbers will change as a new bar is formed.

Bars are usually referred to by an absolute value - its time & duration

 

brewmanz,

I have done quite a bit of searching for something that would display data versus an indicator line and have not found anything. The purpose of the indicator is to use it as a tool for when the market is closed for information purposes.

Thank you for your response.

 
ForexSurfr:

... that would display data versus an indicator line...


Please explain this in more detail, as I have no idea what you're trying to say.
 

ForexCoder,

I am trying to create the code that is in the Matrix EA. This EA is described in an article titled "Comparative Analysis of 30 Indicators and Oscillators".

 
That's a nice article, thanks for bringing it to my attention, but the code for Matrix.mq4 is included in the article. So do you have a problem with the code?
 
forexCoder:
That's a nice article, thanks for bringing it to my attention, but the code for Matrix.mq4 is included in the article. So do you have a problem with the code?

Yes, it does not work. I am trying to figure out how to code what is displayed in the article.
 
Ok, I checked it, indeed it doesn't work as stated. Taking a look.
 

A couple of problems with this piece of code:

From most important to least important ( in my opinion):

1) The code doesn't clean up after itself. The objects it creates, they stay exactly where they are when the EA is removed. This turns your computer into an unstable trashcan.

2) The numbers (flags) that are supposed to be shown are always written below the last bar at chart edge. Numbers get overwritten all over each other. Thus you see a big black smudge.

3) This runs on every tick!!! Sucks to be running this thing, but maybe it's how the author designed it. (don't think he wanted it this way :P)

I have changed the code so at least you're getting flags shown, but not whole history of flags. It's the simplest and fastest solution and most likely not up to your expectations :) But at least you'll know where and what to improve. Find the following block of code in matrix.mq4 (it's near the end) and alter it the way I did it. This will simply display the flags on your screen and get updated each M1 bar.

timeident=TimeCurrent(); //Time to form a unique object name
info = "";

for (i=0;i<=29;i++) //Loop of values displaying

//Forming unique object names
{ident=DoubleToStr(30-i,0)+"   "+DoubleToStr(timeident,0); 

//Creating objects, pointing their location
//ObjectCreate(ident,OBJ_TEXT,0,timeident,WindowPriceMin()+Point*5*(i+1));

info=StringConcatenate(info," ",DoubleToStr(f[30-i],0)); //Forming a text line to be displayed
//ObjectSetText(ident,info,6,"Arial", Black); //describing displaying format and displaying
   
 
}
   Comment(info);  
//-----------End of the block of flag values diaplying----------
 

Pic...

 
forexCoder:

Pic...


forexCoder,

Do you mind displaying the code that gives you the line of numbers?