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)