lix

Lix_JAMES

Uses various trend algos to help indicate market turns
نص برمجي مفتوح المصدر

قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الكود في منشور تحكمه قواعد الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟
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)