CCI & EMA_CROSS_Paydar

Paydar · study · 57 行 · 点赞 1,144 · TradingView 原页

本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。

Pine Script

//   __________      _________   __       __  _________       _________    __________
//    |        \    |         |   \       /    |       \     |         |    |        \
//    |         \   |         |    \     /     |        \    |         |    |         \
//    |         /   |         |     \   /      |        |    |         |    |         /
//    |________/    |_________|      \_/       |        |    |_________|    |________/
//    |             |         |       |        |        |    |         |    |   \
//    |             |         |       |        |        |    |         |    |    \
//    |             |         |       |        |        /    |         |    |     \
//    |             |         |       |        |_______/     |         |    |      \
 
 
study(title="CCI & EMA_CROSS_Paydar", shorttitle="CCI & EMA_CROSS_Paydar")
 
//////// CCI>>
length1 = input(20, minval=1, title="CCI")
 
//////// EMA>>
ma_length = input(9, minval=1, title="EMA")
 
//////// SRC>>
src = input(close, title="Source")
 
//_______________________________________________________________________________
 
Stochlength = 14, minval=1
StochOverBought = 80
StochOverSold = 20
smoothK = 3
smoothD = 3
k = sma(stoch(close, high, low, Stochlength), smoothK)
d = sma(k, smoothD)
 
//_______________________________________________________________________________
 
ma1 = sma(src, length1)
cci1 = (src - ma1) / (0.015 * dev(src, length1))
plot(cci1, color=blue, linewidth=1)
plot(cci1, linewidth=1)
plot(ema(cci1, ma_length), color=#ffffff, transp=0, linewidth=1)
 
//_______________________________________________________________________________
 
plotColour = (cci1 > ema(cci1, ma_length)) ? #00ff00 : #ff0000
plotCCIEMA = plot(series=cci1, color=plotColour, transp=0, linewidth=2)
plotHoriz  = plot(series=0, color=blue, style=circles)
fill(plot1=plotCCIEMA, plot2=plotHoriz, color=blue, transp=100)
 
//_______________________________________________________________________________
 
band0 = hline(200, color=#aa8000)
band1 = hline(75, color=#aa8000)
band2 = hline(0, color=#ffe500, title="Base")
band3 = hline(-75, color=#aa8000)
band4 = hline(-200, color=#aa8000)
fill(band1, band3, color=#aa8000, transp=80)
 
//_______________________________________________________________________________

← 返回列表