Indicator level corruption unwanted, any ideas?

 

Hi Everybody

I have made a custom indicator that displays in a separate window that shows as a straight line. The reason is that I am using one buffer to feed back integer values about the state of the indicator and this buffer, although set to DRAW_NONE, interferes with the maximum level of the graph. The lines I wish to display have values of less than 0.01 so the integer buffer looks like the largest value and MT4 alters the maximum scale of the graph thus shrinking the lines I am interested in to a straight lines.

I thought that by not drawing a line MT4 would ignore it for the display scaling but clearly not. Does anybody have any suggestions on how to accomplish what I need?

Thanks

 

Use and manage your own array, not an indicator buffer, to hold the values.

 

Hi Phy

That rhymes like hi fi. Anyway what is the best way of passing a single integer back to an expert from a call of an indicator. I have been using an indicator buffer because it can return it as one of the mode values but it wastes a buffer and is a simple work around. What way would the experts do it?

Thanks

 

An Expert can call a CustomIndicator using iCustom()

 

Hi Phy

Yes but I can't see any way of returning a value via the iCustom call unless it is in an indicator buffer. An indirect method would be to create a global variable in the indicator and read it in the EA but that is clumsy when all I want is an integer returned from the iCustom call.

 

Why clumsy? That's how they set it up.

Why not calculate it in the Expert?

 

Hi Phy

I shall calculate the indicator in the expert when I have visually tested it and made the EA work correctly. I have found a good work around by multiplying up the indicator buffers to bring them in the same ball park as the integer so now I can see them as curves and not straight lines any more.

Thanks for your input.

Reason: