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?
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.
This might be of interest to you:
Average Penetration Indicator
Many thanks you to you both this is perfect!