Download MetaTrader 5

Indicator Line Plotting Question Continue!

To add comments, please log in or register
Saji
162
Saji  

Hello, all:

Remenber that I created a trendline display different color under different trendcondition, as below:

02 

 And that trendline is plot using DRAW_LINE setting, means that every indexbuffer value will be plotted.

but what I want to improve is that, the trendline will not have a value in every bar,  just in bars I specified. As what ZigZag do.

So I realize that i should use the  DRAW_SECTION.

But since I use 2 Buffers for different color, what I got is below:

01 

You can see that: in my thoughts, the line between 1 and 2 should be the blue line. But since the DRAW_SECTION, the red line is also be plotted.

what can i do?

Really hope someone can give me an advice.Thank you in advance!

saji 

Saji
162
Saji  
can any one help?
Keith Watford
Moderator
10619
Keith Watford  

As you don't post any code, and explain your problem, how can anyone help?

Is your problem that the blue line is drawn where a red line should be

and

a red line where the blue should be? 

If so, change the colour of the lines 

Saji
162
Saji  
GumRai:

As you don't post any code, and explain your problem, how can anyone help?

Is your problem that the blue line is drawn where a red line should be

and

a red line where the blue should be? 

If so, change the colour of the lines 

Thank you for reply, Rai. I'll try my best to express myself.

I use the following code in the first pic:

......
      //------TrendLine Value Calculation
      if(TrendCondition[shift] == 1)
      {
         if(TrendCondition[shift+1] == 1)    //UpWard
         {
            HighBuffer[shift] = 0;
            LowBuffer[shift] = Low[shift];
         }
         else if(TrendCondition[shift+1] == 2)     //DownWard to UpWard
         {
            HighBuffer[shift] = Low[shift];
            LowBuffer[shift] = Low[shift];
         }
      }
      else if(TrendCondition[shift] == 2)
      {
         if(TrendCondition[shift+1] == 2)    //DownWard
         {
            HighBuffer[shift] = High[shift];
            LowBuffer[shift] = 0;
         }
         else if(TrendCondition[shift+1] == 1)     //UpWard to DownWard
         {
            HighBuffer[shift] = High[shift];
            LowBuffer[shift] = High[shift];
         }
      }      
......

 Briefly speaking, I used 2 buffers for my trendline plotting. Each for one color to show the trendcondition.

But in the second pic, there are EMPTY_VALUE in  HighBuffer[shift]/LowBuffer[shift]  

So I have to use  DRAW_SECTION for plot setting.

And then I got pic2.

What I want is the hide the red line between point 1 and 2, and just let the blue line show.

Thanks!

saji 

To add comments, please log in or register