Hammer on EMA5 screener

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

    Dear all,I wonder if you could help me please. I posted this already before. Tried unsuccessfully to code this. I’d like a screener to fulfil the following criteria:

    LONG

    1. Price closes above EMA5

    2. Bullish hammer crosses and rests on EMA5

    3. EMA5 above EMA20

    4. ADX above 25

     

    SHORT

    1. Price closes below EMA5

    2. Bearish hammer crosses and rests on EMA5

    3. EMA5 below EMA20

    4. ADX above 25

     

    Any help is appreciated.

    Thanks.

    #135879 quote
    robertogozzi
    Moderator
    Master

    There you go (non tested):

    Ema5          = average[5,1](close)
    Ema20         = average[20,1](close)
    MyAdx         = Adx[14]
    Body          = abs(close - open)
    UpperShadow   = high - max(open,close)
    LowerShadow   = min(open,close) - low
    BullishHammer = (Body <= (LowerShadow * 0.30)) AND (UpperShadow <= (Body * 0.10))
    BearishHammer = (Body <= (UpperShadow * 0.30)) AND (LowerShadow <= (Body * 0.10))
    L1            = close Crosses Over Ema5
    L2            = Ema5 > Ema20
    L3            = MyAdx > 25
    L4            = low <= Ema5
    Lcond         = L1 and L2 and L3 and L4 and BullishHammer
    S1            = close Crosses Under Ema5
    S2            = Ema5 < Ema20
    S3            = MyAdx > 25
    S4            = high >= Ema5
    Scond         = S1 and S2 and S3 and S4 and BearishHammer
    Screener[Lcond or Scond]
    MrMagic thanked this post
    #135925 quote
    MrMagic
    Participant
    Average

    Thanks a lot @robertogozzi. I’ll test it and get back to you. Bless.

    #135949 quote
    MrMagic
    Participant
    Average

    Hi @robertogozzi, I tried the screener but it didn’t come up with any instruments even though manually, I could see the hammers form on EMA5.

    #135962 quote
    robertogozzi
    Moderator
    Master

    Please report instrument, TF, date and time, so I can check what’s wrong.

    #135987 quote
    robertogozzi
    Moderator
    Master

    It works, despite returning very few signals. I selected ALL shares, currencies and Indices, but only 11 items were found matching the conditions (see attached pic).

    I also realized that, due to the above Hammer difinition, there can be (though rare) times when both signals are true, so I suggest that you get rid of line 19 and append these lines, instead:

    IF Scond AND Lcond THEN
       Lcond = 0
       Scond = 0
    ENDIF
    Screener[Lcond or Scond]
    x-12.jpg x-12.jpg
    #137802 quote
    MrMagic
    Participant
    Average

    Hi @robertogozzi, thanks for the code. It works just like you described, few but valid hammers.

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

Hammer on EMA5 screener


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
MrMagic @mrmagic Participant
Summary

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

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 06/13/2020
Status: Active
Attachments: 1 files
Logo Logo
Loading...