TradingView
jchang274
10 אוק׳ 2020 08:00

TWO by Jchang274 

WTI CRUDE OILTVC

תיאור

In statistics, a moving average is a calculation used to analyze data points by creating a series of averages of different subsets of the full data set. In finance, a moving average (MA) is a stock indicator that is commonly used in technical analysis. The reason for calculating the moving average of a stock is to help smooth out the price data by creating a constantly updated average price.
By calculating the moving average, the impacts of random, short-term fluctuations on the price of a stock over a specified time-frame are mitigated.
Rebuild this code, make it more easy to understand.

הערות שחרור

Set the predict days on the same vertical height.
Make the numbers light color.
תגובות
wjw668
太感谢了!真的谢谢您!
leaveasap
您好!我今天刚使用上您参考雷公的脚本指标。感觉特别好用,先说一声感激!

我属于炒股初级阶段。想问一下就是出现危险的时候K BAR颜色会变黑。变黑的原因是什么呀?是均线交叉 还是抵扣价点位什么的。可以解释一下吗?实在感谢!我尝试了下但是实在看不懂代码...
Alan_bit
@leaveasap, 当前价低于20日MA和EMA均线,并且低于20均线抵扣价,就会变黑。可以理解为价格跌破20均线并且20均线将不可避免地发生拐头,就会变黑。另外,如果价格一直在水下,k线也会一直是黑色。
aliveApple28406
大神,谢谢您的分享。
有一个问题请教下,关于k线变色的功能中,设置后和 雷公视频里的k线颜色不一样。
对于 TSLA 2021-01-29日的k线,
雷公视频里当天的颜色是 蓝色,而我用您这个公式显示的颜色是 灰色的。
请问我哪里设置错了吗?

用的代码如下:
//==========Short Trend Change K线变色功能==========
ConAqua = close>ema(close,20) and close>sma(close,20) and close>close[20]
ConBlack = close<ema(close,20) and close<sma(close,20) and close<close[20]
ConGray = not(ConAqua and ConBlack)
ChangeColorGray = (ConGray and Switch==1) ? color.silver:na
ChangeColorAqua = (ConAqua and Switch==1) ? color.aqua:na
ChangeColorBlack = (ConBlack and Switch==1) ? color.black:na
barcolor(ChangeColorAqua,editable=false)
barcolor(ChangeColorBlack,editable=false)
barcolor(ChangeColorGray,editable=false)
jchang274
@aliveApple28406, 我不知道老雷的逻辑,只是猜测的一些。
jotaekbong
大神, 免费版能添加嘛?
jchang274
@jotaekbong, 可以
jotaekbong
@jchang274, 😄大神。颜色怎么修改成图片里那样啊?
SlowRichJohnnyB
the way to draw dash line is great, thanks🙏
jchang274
@johnnybai, Thx
עוד