how to connect line high to higher high bars only(even inside bars present)

 

HI TO ALL!

GOOD MORNING.

Though i am new, i am learning myself to write a important code. i struct here unable to get the idea.

Any one suggestion or help please.

highly appreciated.


 

You have to decide on the criteria to identify the 3 bars

Then find the time of the 2nd and 3rd bars

Use the price of the high and time of these 2 bars to draw a trend-line

 
GumRai:

You have to decide on the criteria to identify the 3 bars

Then find the time of the 2nd and 3rd bars

Use the price of the high and time of these 2 bars to draw a trend-line


Hello. what u are saying is exactly true. I just want a code how u decide the 3 bars. Then as u said connect highs of bars for last two bars. My problem is how can i define those three bars. so that it can i connet las two bars. Please help me.

 
naickmt4: My problem is how can i define those three bars.

That is your problem. There are no mind readers here. Unless you can come up with your definition, no one here can help you.

  1. Possibly use something like.
    #define LOOKBACK 10
    int iCurHi = iHighest(NULL,0,MODE_HIGH,LOOKBACK,0);
    if(iCurHi == 0){
       int iPrevHi = iHighest(NULL,0,MODE_HIGH,LOOKBACK,1);
       TLine("H2H"+Time[0], Time[iPrevHi], High[iPrevHi], Time[0], High[0], Green);
    }
  2. Another would be to use every other zigzag point
 
naickmt4:


Hello. what u are saying is exactly true. I just want a code how u decide the 3 bars. Then as u said connect highs of bars for last two bars. My problem is how can i define those three bars. so that it can i connet las two bars. Please help me.


It is up to you to define the criteria. Look at the image. All 3 examples meet your criteria as you have stated so far, and that is just from 8 bars

Highs

 
GumRai:

It is up to you to define the criteria. Look at the image. All 3 examples meet your criteria as you have stated so far, and that is just from 8 bars




Sir very nice for your invaluable time spending and reading my condtion.