average EMA penetration

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #159598 quote
    smborowiczsmborowicz
    Participant
    New

    Hello,

    I am currently reading Alexander Elder’s “The new Trading For A Living” book and he describes setting a BUY target at an “average EMA penetration.”  I am looking for an indicator that can give me the following value:

    on a daily chart, if EMA value is in an uptrend, looking back at last 40 bars:

     

    calculate an average penetration :

    if closing price is lower than EMA, then subtract the closing price from the EMA (average this number for the last 40 bars)

    estimate the EMA of tomorrow:

    EMA tomorrow = EMA of today + (EMA of today – EMA of yesterday)

    Calculate an entry point:

    EntryPoint = EMA tomorrow – average penetration

    return Entry

     

    Is it possible to program this as an indicator?

    #159604 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    MyEma  = Average[20,1](close)
    IF (MyEma > MyEma[5]) THEN
       IF close < MyEma THEN
          Diff        = (MyEma - close)
          Penetration = average[40,0](Diff)
          FutureEma   = MyEma + (MyEma - MyEma[1])
          Entry       = FutureEma - Penetration
       ENDIF
    ENDIF
    RETURN Entry AS "Entry"

    I considered EMA being on an UPtrend when it’s higher than 5 bars ago, but you can change it as it best suits you.

    smborowicz and willi thanked this post
    #159609 quote
    VonasiVonasi
    Moderator
    Master

    This might be of interest to you:

    Average Penetration Indicator

    smborowicz and willi thanked this post
    #159611 quote
    smborowiczsmborowicz
    Participant
    New

    Many thanks you to you both this is perfect!

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

average EMA penetration


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
smborowicz @smborowicz Participant
Summary

This topic contains 3 replies,
has 3 voices, and was last updated by smborowiczsmborowicz
5 years, 8 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 01/27/2021
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...