# EZ Trend

336 0
EZ Trend creates a signal when the current open price is equal to, or within a set range of, the last close price AND current candle is the opposite color of last candle. This indicator is based on my observation that when O = C AND the last candle's color is opposite of the current candle, the NEXT candle seems to follow the color of the current candle and a change in trend tends to follow.

This is not an absolute rule and it seems to work better with middle and higher priced assets where there is a lesser probability of O = C. Assets with very low prices or low volatility should use a Signal Precision value of 0. (ex: DGBBTC             ) and larger time frames tend to yield fewer false signals.

Signal precision (the absolute value of the difference between O and C ) can be adjusted in 0.00000001 increments.
```// EZTrend creates a signal when the current open price is equal to, or within a set range of, the last close price AND
// current candle is the opposite color of last candle.
// This indicator is based on my observation that when O= C AND the last candle's color is opposite of the current candle,
// the NEXT candle seems to follow the color of the current candle and a change in trend tends to follow.
// Signal precision (the absolute value of the difference between O and C) can be adjusted in 0.00000001 increments.
// This is not an absolute rule and it seems to work better with middle and higher priced assets where there is a lesser probability of O = C.
// Assets with very low prices or low volatility should use a Signal Precision value of 0. (ex: DGBBTC) and larger time frames tend to yield fewer false signals.

study(title="EZTrend", shorttitle="EZT 1.0", overlay=true)

range = input(0.25,step= 0.00000001, title= "Signal Precision")
show_bgrnd = input(true, title= "Show Background Colors?")

aaa = abs(open[0] - close[1]) <= range ? 1 : 0

bbb = close[1] - open[1] > 0 ? 1 : 0
ccc = close[0] - open[0] > 0 ? 1 : 0

ddd = bbb != ccc ? 1 : 0
eee = aaa and ddd? 1 : 0

fff = ccc == 1 ? 1 : 0
ggg = ccc == 0 ? 1 :0

bgcolor(show_bgrnd and fff? green : na, transp= 75, title= "Buy Background Color" )
bgcolor(show_bgrnd and ggg? maroon : na, transp= 70, title= "Sell Background Color" )

plotchar(fff? eee : na, transp= 0, char= "B", color= green, location= location.belowbar, title= "Buy Character"  )
plotchar(ggg? eee : na, transp= 0, char= "S", color= red, location= location.abovebar, title= "Sell Character"  )

// end
```
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter