搜索
产品
社区
市场
新闻
经纪商
更多
CN
开始
OPEN-SOURCE SCRIPT
已更新
2022年5月19日
RSI +ADX Martket Trend
图表
原始码
更多
2
1
3
添加到收藏
添加到收藏
4
4
2022年5月19日
Hi Please find the useful trend direction indicator
2022年5月19日
版本注释
//
version
=4
study(title="RSI Market", shorttitle="RSI", format=format.price, precision=2)
src = close, len = input(14, minval=1, title="Length"), th = input(20),
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
plot(rsi, color=#000000, title="RSI", transp=0, linewidth=1)
rv = rsi
ob = input(title="Overbought", type=input.integer, defval = 70)
us = input(title="Undersold", type=input.integer, defval = 30)
h1 = hline(ob, color=#b2b5be, linestyle=hline.style_dashed, title="Overbought")
h2 = hline(50, color=#b2b5be, linestyle=hline.style_dashed, title="middle")
h3 = hline(us, color=#b2b5be, linestyle=hline.style_dashed, title="Undersold")
ref = plot(50, editable=false, title="Overbought")
oblv = plot(rv>50? rv : 50, transp=100, editable=false, title="Uptrend", display=display.none)
obld = plot(rv>50? 50 : rv, transp=100, editable=false, title="Downtrend", display=display.none)
fill(oblv,ref, color=color.green, transp=50, title="Up trend")
fill(obld,ref, color=color.red, transp=50, title="Down trend")
switch=input(true, title="Show consolidation areas? (The color changes there each bar)")
ShowConsolidation = 2
GetBgColor = iff( (hl2 > hl2[1]) and (hlc3 > hlc3[1]) and (close > close[1]) and (hl2[1] > hl2[2]) and (hlc3[1] > hlc3[2]) and (close[1] > close[2]), 1,
iff( (hl2 < hl2[1]) and (hlc3 < hlc3[1]) and (close < close[1]) and (hl2[1] < hl2[2]) and (hlc3[1] < hlc3[2]) and (close[1] < close[2]), -1, nz(GetBgColor[switch?ShowConsolidation:1], 0) ))
SelectBgColor = GetBgColor == -1 ? red: GetBgColor == 1 ? green: na
bgcolor(SelectBgColor, transp = 85)
Piyu-sanj
关注
Trend Analysis
开源脚本
本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受
网站规则
约束。 您可以收藏它以在图表上使用。
想在图表上使用此脚本?
Piyu-sanj
关注
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在
使用条款
阅读更多信息。