Variables with SetIndexStyle?

 

Hi all.

I have an indicator where I'd like to be able to turn one set of lines on and off. I don't seem to be able to use variables to do this. Is there something I'm missing, or some other way to do this?

input string dispRF1 = "DRAW_LINE";// DRAW_NONE or DRAW_LINE

...

SetIndexBuffer(1, rngfilt1);
SetIndexStyle(1, dispRF1);
SetIndexLabel(1, "TRF rngfilt1");
 
rrsch: have an indicator where I'd like to be able to turn one set of lines on and off. I don't seem to be able to use variables to do this. Is there something I'm missing, or some other way to do this?

The Drawing style is an integer value, not a string!

input int dispRF1 = DRAW_LINE;  // DRAW_NONE or DRAW_LINE

...

SetIndexBuffer(1, rngfilt1);
SetIndexStyle(1, dispRF1);
SetIndexLabel(1, "TRF rngfilt1");

Drawing Styles

Drawing shape styles for SetIndexStyle() function.

ID

Value

Description

DRAW_LINE

0

Drawing line

DRAW_SECTION

1

Drawing sections

DRAW_HISTOGRAM

2

Drawing histogram

DRAW_ARROW

3

Drawing arrows (symbols)

DRAW_ZIGZAG

4

Drawing sections between even and odd indicator buffers, 2 buffers of values

DRAW_NONE

12

No drawing

 

To facilitate your input and make it easier for the user selection, create an enumeration ...

enum EDrawType {
   E_DrawType_Line = DRAW_LINE, // Draw Line
   E_DrawType_None = DRAW_NONE  // Draw None
};

input EDrawType eDrawType = E_DrawType_Line; // Drawing Type

...

SetIndexStyle( 1, (int) eDrawType );
 
Ah, I see. Thank you!
 
rrsch #: Ah, I see. Thank you!
You are welcome!