HA- short set up after a rally

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #175210 quote
    cavineet
    Participant
    Average

    Hello Robert,

    Is it possible to create the opposite screener if the attached code. Basically, I a looking for “HA-ShortSetupAfterRally”.

    Attached is a file.

     

    Thanks

    Vineet

    HA-LongSetupAfterCorrection.itf
    #175215 quote
    robertogozzi
    Moderator
    Master

    I just reverted conditions:

    // Trend Template
    c1 = Average[13](close) < Average[26](close)
    c2 = Average[26](close) < Average[52](close)
    c3 = average[52](volume*close) > 3000000
    n = 0
    if barindex = 0 then
    haOpen  = open
    haClose = close
    elsif N = 0 then
    haClose =(Open+High+Low+Close)/4
    haOpen =(haOpen[1]+haClose[1])/2
    elsif (barindex MOD N) = 0 then
    haClose =(Open[N]+Highest[N](high)+Lowest[N](low)+Close)/4
    haOpen  =(haOpen[1]+haClose[1])/2
    endif
    c4 = haclose < haopen
    c5 = haclose[1] > haopen[1]
    c6 = haclose[2] > haopen[2]
    c7 = haclose[3] > haopen[3]
    SCREENER[c1 and c2 and c3 and c4 and c5 and c6 and c7 ](volume*close as "traded volume")
    HA-ShortSetupAfterRally.itf
    #175237 quote
    cavineet
    Participant
    Average

    Thanks, Robert,

     

    But I tried to do that earlier but it is still not working as expected. I am looking for just one bar HA reversals after the rally and it is giving results for several bars. Please look at the screenshot

    Rally.jpg Rally.jpg
    #175289 quote
    robertogozzi
    Moderator
    Master

    There’s no data on your pic.

    Can you post gthe rules to go short?

    #175375 quote
    cavineet
    Participant
    Average

    It is a simple rule, Robert. If HA turns red it is short. I expect this screener to find those scrips. Currently as shown in the picture, this screener is showing scrips after several HA candles

    #175532 quote
    robertogozzi
    Moderator
    Master

    Ok, then no moving average is needed to simply spot any reversion, just after a P number of green candles, the first red one is returned:

    P = 10
    N = 0
    if barindex = 0 then
       haOpen  = open
       haClose = close
    elsif N = 0 then
       haClose =(Open+High+Low+Close)/4
       haOpen =(haOpen[1]+haClose[1])/2
    elsif (barindex MOD N) = 0 then
       haClose =(Open[N]+Highest[N](high)+Lowest[N](low)+Close)/4
       haOpen  =(haOpen[1]+haClose[1])/2
    endif
    haBullish = haClose > haOpen
    haBearish = haClose < haOpen
    Cond = 0
    IF haBearish AND (summation[P](haBullish[1]) = P) THEN
       Cond = 1
    ENDIF
    SCREENER[Cond]
    Midlanddave thanked this post
    #175580 quote
    cavineet
    Participant
    Average

    Thank you so much Robert, really appreciate it. you are awesome 🙂

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

HA- short set up after a rally


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
cavineet @cavineet Participant
Summary

This topic contains 6 replies,
has 2 voices, and was last updated by cavineet
4 years, 5 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 08/13/2021
Status: Active
Attachments: 3 files
Logo Logo
Loading...