Nico.Muselle

[NM] EMADiff v01 - an indicator for everyone !

Allright gang, we are here with a new indicator that should help you with determining the direction to trade or whether you should trade at all.
It uses the close of the candle and 2 EMAs.
The faster moving line is the difference between the close and the Slow EMA, while the slower moving line shows the difference between the Fast EMA and the Slow EMA.

There are a couple of ways you can use this indicator, depending on your trading style :

For the quick profit, in and out :
- enable the safer trading option and keep smoothing at the default setting, buy when both lines are green, sell when both line are red and get out when one of the lines changes color (or when profit target is reached) (see the top option)

For longer trades :
- you can increase the smoothing, use a higher Slow EMA and disable the Safer trading option, enter either when both lines have the same color, either on a crossover. (the bottom option)

In both cases, if both lines hover around the zero line, the trend is definitely not strong.

Much more options are available so I would love to hear how you use this indicator. A thumbs up if you like it would be highly appreciated :)

Works nicely together with my other indicators below :

To add this indicator (or any other) to your chart, click the "Add to favorites" button. Then while having the chart you wish to apply it to open, click on Indicators > Favorites > EMADiff v01 (or any other indicator that you favorited.

Check out my FREE indicator scripts:
www.tradingview.com/u/Nico.Muselle/

Twitter: twitter.com/NicoMuselle
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?
//@version=1
// this code uses the difference between the close of a candle and the slow EMA on one hand
// and the difference between the slow EMA and the fast EMA on the other hand
// Use : if both lines color green : buy, if both lines color red : sell
// Advice : 
// - watch price action and eventual support/resistance to try and eliminate false entries
// - use an ADX indicator in order to determine what moves are backed by momentum
// - for safer entries wait till both lines are above zero for buying, below zero for selling
// You can select to smoothen both lines by enabling it in the settings
// You can adapt the EMA settings to your likings, higher EMAs will smoothen out more and thus show less color changes


study(title='[NM] EMADiff v01', shorttitle='EMADiffv01', overlay=false)
fastEMA = input(title = 'Fast EMA (default = 12)', type = integer, defval = 12)
slowEMA = input(title = 'Slow EMA (default = 26)', type = integer, defval = 26)
smooth = input(title='Smooth ? (default = Yes)', type=bool, defval=true)
smap = input(title='Smooth factor (default = 10)', type=integer, defval=10, minval=2, maxval=20)
sigma = input(title='Sigma default = 6)', type=integer, defval=6)
safer = input(title='Show safer trades (default = yes)', type = bool, defval = true)


emadiff = ema(close,fastEMA) - ema(close,slowEMA)
emadiffp = close - ema(close,slowEMA)



ep = smooth ? alma(emadiffp, smap, 0.9, sigma) : emadiffp
ef = smooth ? alma(emadiff, smap, 0.9, sigma) : emadiff
pcolor = safer ? (ep[0] > ep[1] and ef[0] > ef[1] ? green : ep[0] < ep[1] and ef[0] < ef[1] ? red : yellow) : ep[0] > ep[1] ? green : red
fcolor = safer ? (ef[0] > ef[1] and ef[0] > 0 ? green : ef[0] < ef[1] and ef[0] < 0 ? red : yellow) : ef[0] > ef[1] ? green : red


plot(title='EMA Difference', series=ef, style=line, linewidth=2, color= fcolor)
plot(title='Difference to close', series=ep, style=line, linewidth=2, color= pcolor)
plot(0,title='zero line', color= gray, linewidth=1)