TREND LINE through Peaks and Troughs

Forums ProRealTime English forum ProBuilder support TREND LINE through Peaks and Troughs

Viewing 9 posts - 16 through 24 (of 24 total)
  • #144084

    Many thanks Vonasi and Nicolas. I define Trend Lines in 3 different categories: 1. Invalid Trend Line, 2. Tentative Trend Line and 3. Valid Trend Line.

    I join 2 Swing Lows (2nd swing low higher than 1st) with an Up Trend line, provided there is a Swing High (SH) in-between those 2 swing lows. This is a Valid Up trend line.

    If there is no in-between swing high, we can not join 2 Swing Lows (2nd swing low higher than the 1st) with an up trend line. This will be an INVALID up trend line.

    Similarly, I join 2 Swing highs (2nd swing high lower than the 1st) with an Down Trend line, provided there is a Swing Low (SL) in-between those 2 swing highs. This is a Valid Down trend line.

    If there is no in-between swing low, we can not join 2 Swing highs (2nd swing high lower than the 1st) with an down trend line. This will be an INVALID down trend line. These are all shown in the 2 enclosed chart.

    Now the question is how to incorporate this concept of valid Trend Line in our previous program as attached please.

    Many thanks for your would be response.

     

     

    #144192

    Compare the BARINDEX between each of the points to be sure there is a low swing between 2 high swings, something like:

    BARINDEXhigh1< BARINDEXlow < BARINDEXhigh2

    #144485

    Many thanks Nicolas. I tried to find the in-between swing high between the 2 swing lows for drawing the up trend segment via the code, “IF Ltt>Ltt[1] and htt>ltt and htt>ltt[1] THEN” and tried to find the in-between swing low between the 2 swing highs for drawing the down trend segment via the code, “IF htt<Htt[1] and ltt<htt and ltt<htt[1] THEN” but it is drawing the segment even if there is no in-between swing high or low.

    The captured chart shows an up trend segment by joining 2 swing lows when there is no swing high present in-between the 2 swing lows. This is not correct (marked as “incorrect segment”).

    Your assistance would be of great help.

    Regards,

    #144502

    But you are comparing price and not bar number! What I was talking about is the sequence of events of the swings: a swing high event must be present between 2 swings low events, and you can test that with their barindex numbers.

    #144552

    Thank you Nicolas, but honestly I am not a master in Barindex numbers coding. Appreciate your help please.

    Best Regards,

    #144559

    Please provide the itf file that embed all your external variables? or add them into the code please.

    #144612

    Many thanks dear. Here it is. Much appreciated

     

    .

    #144625

    In that version, descending trend line can be plotted only if the last swing before the current one was a red dot, and vice-versa for an ascending trend line.

     

    #144662

    This is brilliant. You are a genius Nicolas.

    Many thanks for your intention, effort and time.

Viewing 9 posts - 16 through 24 (of 24 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login