lix

Lix_JAMES

Uses various trend algos to help indicate market turns
Remove from Favorite Scripts Add to Favorite Scripts
study(title="Lix_JAMES", shorttitle="Lix_JAMES", overlay=true)
len = input(14, minval=1, title="DI Length")
lensig = input(14, title="ADX Smoothing", minval=1, maxval=50)
up = change(high)
down = -change(low)
trur = rma(tr, len)
plus = fixnan(100 * rma(up > down and up > 0 ? up : 0, len) / trur)
minus = fixnan(100 * rma(down > up and down > 0 ? down : 0, len) / trur)
sum = plus + minus 
adx = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), lensig)
//EMAs
srcEma1 = close, len1 = input(6, minval=1, title="Fast EMA")
ema1 = ema(srcEma1, len1)
srcEma2 = close, len2 = input(20, minval=1, title="Slow EMA")
ema2 = ema(srcEma2, len2)
//
//
diffEma = (100 * (ema1 - ema2) / ((ema1 + ema2) / 2))
emaSignalBuy = ema1>ema2 ? 1 : 0
//SAR
startSAR = input(0.02)
incrementSAR = input(0.02)
maximumSAR = input(0.2)
//
outSAR = sar(startSAR, incrementSAR, maximumSAR)
//MACD
sourceMCD = close
fastLengthMCD = input(12, minval=1), slowLength=input(26,minval=1)
signalLengthMCD=input(9,minval=1)
fastMACD = ema(sourceMCD, fastLengthMCD)
slowMACD = ema(sourceMCD, slowLength)
macd = fastMACD - slowMACD
signal = sma(macd, signalLengthMCD)
hist = macd - signal
//plot(hist, color=red, style=histogram)
//plot(macd, color=blue)
//plot(signal, color=orange)
isSarUp = outSAR < close ? 1 : 0
isMacdUp = signal < macd ? 1 : 0
diff = (100 * (macd - signal) / ((macd + signal) / 2))
act = abs(diff) > 0.01 and abs(diff) < 2 ? diff : 0
c = low - (low/1000000)
signalBuy = (isSarUp > 0 and isMacdUp > 0 and emaSignalBuy > 0 and adx > 20) ? (c) : na
//signalBuy = (isMacdUp > 0 and emaSignalBuy > 0) ? (c) : na
//plot(outSAR)
//plot(signalBuy)
plot(signalBuy, style=circles, color=purple, linewidth = 2)
plot(ema1, color=red)
plot(ema2)
//plot(act, color=yellow)
Nice work !!! Added to my library.
Reply
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
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out