good indicator needs some tuning!

 

hi, i have programmed a good indicator i think, but i dont know how to go on. here´s a chart on which the 4 indicator lines are working.


I want only 2 lines on chart window, highesthigh or lowestlow and only one of the two dashed signal lines.


Can anybody help me with this pls?




 

"I want only 2 lines on chart window, highesthigh or lowestlow and only one of the two dashed signal lines."

For the indicator indexes you do not want to see, change DRAW_LINE to DRAW_NONE

 

hi phy,



thanks for ur answer,



but i want that the indicator is automatically switching between highesthigh and lowestlow in the same reasons i wrote on the chart.



do u have an idea how to do that?



thanks

 

Yes, see idea above.

 

i dont understant how u mean this phy.



if i change DRAW_LINE to DRAW_NONE i wont see this indicator anything the course of currency pair is doing. or am i wrong?

 

maybe i didn´t explain my problem very well, it´s caused by my bad english i think (i´m from germany)



i want that the two solid lines are only one indicatorbuffer and the two dashed lines are only one indicatorbuffer.



The reason for this is caused by programming an ea to trade this indicator automatically.



Do u have a idea how to get the indicatorbuffer switching between highesthigh and lowestlow ?



thanks

 

"Do u have a idea how to get the indicatorbuffer switching between highesthigh and lowestlow ?"

Well, you need data from all 4 existing buffers to make decisions.

Add two buffers.

Copy the values from the high or low lines into the new buffers according to your decision rules.

Have the EA read from the two new buffers.

If you don't want to see the original 4 lines, then set them to DRAW_NONE.

 

thanks again for your fast answer,

i have written it this way:



void start()
{
int counted = IndicatorCounted();
//----
if(counted < 0)
return (-1);
//----
if(counted > 0)
counted--;
int limit = Bars - counted;
//----
for(int i = 0; i < limit; i++)
{
if(iClose(NULL, 0,1 ) > iHigh(NULL, 0, iHighest(NULL, 0, MODE_CLOSE, N, i));

{
master[i] = iLow(NULL, 0, iLowest(NULL, 0, MODE_CLOSE, N, i));
commander[i] = iHigh(NULL, 0, iHighest(NULL, 0, MODE_CLOSE, N1, i)) - N3*Point;
}
else
{
master[i] = iHigh(NULL, 0, iHighest(NULL, 0, MODE_CLOSE, N, i));
commander[i] = iLow(NULL, 0, iLowest(NULL, 0, MODE_CLOSE, N1, i)) + N3*Point;
}
}
}



but now i am recieving a error: end of program unbalanced left parenthesis



but if i am looking are there as many left as right paenthesis on my indicator.

is it the way that u meant?



TY

 

"but now i am recieving a error: end of program unbalanced left parenthesis

but if i am looking are there as many left as right paenthesis on my indicator"

Look again.

 

best advice ever: look again :-)

thank u found it. was always looking for } but there was missing )



so the indicator is now this way, but if i put it on a chart there is not only one line, what have i done wrong?



void start()
{
int counted = IndicatorCounted();
//----
if(counted < 0)
return (-1);
//----
if(counted > 0)
counted--;
int limit = Bars - counted;
//----
for(int i = 0; i < limit; i++)
{
if(iClose(NULL, 0,1 ) > iHigh(NULL, 0, iHighest(NULL, 0, MODE_CLOSE, N, i)));
}{
{
UpperBuf[i] = iLow(NULL, 0, iLowest(NULL, 0, MODE_CLOSE, N, i));
LowerBuf[i] = iHigh(NULL, 0, iHighest(NULL, 0, MODE_CLOSE, N1, i)) - N3*Point;
}}
if(iClose(NULL, 0,1 ) < iHigh(NULL, 0, iHighest(NULL, 0, MODE_CLOSE, N, i)));

{
UpperBuf[i] = iHigh(NULL, 0, iHighest(NULL, 0, MODE_CLOSE, N, i));
LowerBuf[i] = iLow(NULL, 0, iLowest(NULL, 0, MODE_CLOSE, N1, i)) + N3*Point;

}
}

 

You still have a fault in your syntax, that the compiler doesn't catch:

if(iClose(NULL, 0,1 ) > iHigh(NULL, 0, iHighest(NULL, 0, MODE_CLOSE, N, i)));

That says, if ( condition is true) do nothing. Remove the ;

Same thing on this one:

if(iClose(NULL, 0,1 ) < iHigh(NULL, 0, iHighest(NULL, 0, MODE_CLOSE, N, i)));

Reason: