Bullish Bar Closing above 2 Bearish Bar and vice versa

Forums ProRealTime English forum ProBuilder support Bullish Bar Closing above 2 Bearish Bar and vice versa

Viewing 15 posts - 1 through 15 (of 23 total)
  • #139235

    Hello,

    This simple code (if it can be simplified) can be used for identifying earliest reversals. The approach is to identify Bullish Bar Closing above 2 Bearish Bar and vice versa as shown in the document. The issue is if we use “if” statement then the program is becoming very big. Any simplification will be highly appreciated.

    Regards.

     

    #139246

    COND will be true whenever your pattern is detected:

     

    #139248

    You can add

     

    #139294

    Hello Robert, thank you for your response, however,

    Code is throwing error: as per the first chart in the attachment.

    When modified by remarking the “Bullish” line, it is not working as desired: as per the second chart in the attachment.

    The desired behaviour should be like the below: (as per my lengthy code, which I want to be shortened): as per the last chart in the attachment.

     

    #139319

    Attach image file types for images, JPG or PNG extensions, please. Thank you.

    I couldn’t  detect what you wanted to highlight in your second pic.

    I forgot to use the BULLISH variable. There you go:

    I also added the viceversa.

    In your first post you talked about “Bullish Bar Closing above 2 Bearish Bar” but your file had more patterns.

     

     

    #139392

    Thank you Robert, but it seems you have not correctly understood the conditions. Here they are:

    For identifying DOWN trend the requirement is

      1. bearish bar should close below the lowest low of the previous 2 bullish bars (they (bullish and/ or bearish) may not be consecutive and the last bullish bar’s low should be higher than the previous bullish bar’s low).

    For identifying UP trend the requirement is

      1. bullish bar should close above the highest high of the previous 2 bearish bars (they (bullish and/ or bearish) may not be consecutive and the last bearish bar’s high should be lower than the previous bearish bar’s high).

    Your new code is throwing wrong results (enclosed chart named robert.jpg). It should be like enclosed correct.jpg

    Many thanks for your time and effort.

     

    #139395

    No, you wrote you wanted to find “Bullish Bar Closing above 2 Bearish Bar”.

    To find something different, a different code is needed.

    I’ll make it as soon as I can.

    1 user thanked author for this post.
    #139440

    There you go:

     

    #139479

    Great help Robert. You are brilliant. The code is missing some of the signals as captured in the enclosed document. Can it be fixed please.

    Also, can it be possible to make it continuous histograms as shown in the enclosed document.

    Many thanks.

    #139492

    When you need to attach images, please use JPG or PNG files. PDF are just for documents AND TXT are for unfornatted text. Thank you 🙂

    Please tell me the rules you want to add, using text, not pics.

    If you remove line 55 you’ll have a continuous histogram, since the previous signal is retained when there’s currently none.

     

    #139517

    Roberto code above added as Log 230 here …

    Snippet Link Library

    1 user thanked author for this post.
    #139578

    Hello Robert, thank you for your time. The requirement is the same as before as written earlier and now as below:

    For identifying DOWN trend the requirement is

      1. bearish bar should close below the lowest low of the previous 2 bullish bars (they (bullish and/ or bearish) may not be consecutive and the last bullish bar’s low should be higher than the previous bullish bar’s low ignoring the inside bar in between is any).

    For identifying UP trend the requirement is

      1. bullish bar should close above the highest high of the previous 2 bearish bars (they (bullish and/ or bearish) may not be consecutive and the last bearish bar’s high should be lower than the previous bearish bar’s high ignoring the inside bar in between is any).

    Many thanks for your time and effort.

    #139586

    I’ll take care of it early next week.

    #139595

    Many thanks dear.

    #139655

    Try this one (not tested):

     

Viewing 15 posts - 1 through 15 (of 23 total)

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