情绪指示升级CHOP ZONE

前几天去了没网络的地方休息了几天,所以断更了。今天开始继续。 很多人都对于市场情绪和价格位置的高低感到困惑。所以,我发布了一些关于如何判断市场情绪和阶段的指标。
休假回来第一天就看到有人在TradingView社区里面给提意见:建议线条可以体现市场情绪。 这个功能也的确是现成的,分分钟集成进去发布了,效果还是真是不错。所以说,我常在TradingView社区泡着,也时不时的可以获得一些好想法的启发。

一些效果图:

anlık görüntü
BTCUSDT日线行情来自TradingView

anlık görüntü
上证指数日线行情来自TradingView

anlık görüntü
纳斯达克指数日线行情来自TradingView

anlık görüntü
黄金日线行情来自TradingView


最新更新的脚本的名称和链接: [blackcat] L1 Chop Zones
[blackcat] L1 Chop Zones


源代码:
```c
// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org/MPL/2.0/
// © blackcat1402
//version=4
study("[blackcat] L1 Chop Zones","L1 Chop Zones", overlay=false, max_bars_back=5000, max_labels_count =500)

len=input(500, title="Length", type=input.integer)
src=input(close, title="Source", type=input.source)
dist_limit_long_h = input(60, title="% Distance Threshold Center (Long)", step = 0.5, minval=0.0)
dist_limit_long_l = input(20, title="% Distance Threshold Lower (Long)", step = 0.5, maxval=0.0)
dist_limit_short_l= input(40, title="% Distance Threshold Center (Short)", step = 0.5, maxval=0.0)
dist_limit_short_h= input(80, title="% Distance Threshold Upper (Short)", step = 0.5, minval=0.0)

// ma=sma(src,len)
// dist=src-ma
// distpc=100*(dist/ma)

//functions
xrf(values, length) =>
r_val = float(na)
if length >= 1
for i = 0 to length by 1
if na(r_val) or not na(values)
r_val := values
r_val
r_val

xsa(src,len,wei) =>
sumf = 0.0
ma = 0.0
out = 0.0
sumf := nz(sumf[1]) - nz(src[len]) + src
ma := na(src[len]) ? na : sumf/len
out := na(out[1]) ? ma : (src*wei+out[1]*(len-wei))/len
out

//risk assessment algorithm
rsva1 = (close-lowest(low,9))/(highest(high,9)-lowest(low,9))*100
rsva2 = 100*(highest(high,9)-close)/(highest(high,9)-lowest(low,9))
var21 = xsa(rsva2,9,1)+100
var11 = xsa(rsva1,3,1)
var51 = xsa(var11,3,1)+100
poleline = var51-var21+50
var2 = lowest(low,33)
var3 = highest(high,21)
var4 = ema((close-var2)/(var3-var2)*100,10)*-1+100
trendstrength = 100-ema(0.191*xrf(var4,1)+0.809*var4,1)


// plot(trendstrength, linewidth=3, color=color.white)

p1 = hline(dist_limit_long_h, color=color.lime, title="% Distance Threshold Center (Long)" , linestyle=hline.style_dotted)
p2 = hline(dist_limit_short_l, color=color.red, title="% Distance Threshold Center (Short)", linestyle=hline.style_dotted)
p3 = hline(dist_limit_long_l, color=color.red, title="% Distance Threshold Lower (Long)")
p4 = hline(dist_limit_short_h, color=color.lime, title="% Distance Threshold Upper (Short)")
fill(p1, p2, color=#C7C1C4, transp=80, title="Chop Zone")
fill(p1, p4, color=color.lime, transp=80, title="Long Only")
fill(p2, p3, color=color.red, transp=80, title="Short Only")


var chopTable = table.new(position = position.middle_right, columns = 1, rows = 5, bgcolor = color.yellow, border_width = 1)
if barstate.islast
table.cell(table_id = chopTable, column = 0, row = 0, text = "Long & Short", bgcolor=color.new(color.gray,10))
table.cell(table_id = chopTable, column = 0, row = 1, text = "Long Only" , bgcolor=color.new(color.green,10))
table.cell(table_id = chopTable, column = 0, row = 2, text = "No Trade" , bgcolor=color.new(color.white,10))
table.cell(table_id = chopTable, column = 0, row = 3, text = "Short Only" , bgcolor=color.new(color.red,10))
table.cell(table_id = chopTable, column = 0, row = 4, text = "Long & Short", bgcolor=color.new(color.gray,10))


//PLOT courtesy of animecummer
var grad = array.new_color(na)
if barstate.isfirst
array.push(grad, color.gray)
array.push(grad, #2d0aff)
array.push(grad, #0038ff)
array.push(grad, #0050ff)
array.push(grad, #0062ff)
array.push(grad, #0071ff)
array.push(grad, #007eff)
array.push(grad, #0089ff)
array.push(grad, #0093ff)
array.push(grad, #009dff)
array.push(grad, #00a5ff)
array.push(grad, #00adff)
array.push(grad, #00b5ff)
array.push(grad, #00bcff)
array.push(grad, #00c2ff)
array.push(grad, #00c9ff)
array.push(grad, #00cfee)
array.push(grad, #00d6d9)
array.push(grad, #00dcc4)
array.push(grad, #00e2ae)
array.push(grad, #00e898)
array.push(grad, #00ed82)
array.push(grad, #00f26b)
array.push(grad, #00f753)
array.push(grad, #00fb38)
array.push(grad, #0ffe09)
array.push(grad, #1bf20a)
array.push(grad, #33f203)
array.push(grad, #43f300)
array.push(grad, #50f300)
array.push(grad, #5bf400)
array.push(grad, #64f400)
array.push(grad, #6df500)
array.push(grad, #76f500)
array.push(grad, #7df500)
array.push(grad, #85f600)
array.push(grad, #8cf600)
array.push(grad, #93f700)
array.push(grad, #99f700)
array.push(grad, #9ff700)
array.push(grad, #a5f800)
array.push(grad, #abf800)
array.push(grad, #b1f800)
array.push(grad, #b7f800)
array.push(grad, #bcf900)
array.push(grad, #c2f900)
array.push(grad, #c7f900)
array.push(grad, #ccf900)
array.push(grad, #d1fa00)
array.push(grad, #d6fa02)
array.push(grad, #dbfa09)
array.push(grad, #f6ff0d)
array.push(grad, #f9f700)
array.push(grad, #fbf000)
array.push(grad, #fde800)
array.push(grad, #ffe000)
array.push(grad, #ffd900)
array.push(grad, #ffd100)
array.push(grad, #ffc900)
array.push(grad, #ffc100)
array.push(grad, #ffb900)
array.push(grad, #ffb100)
array.push(grad, #ffa800)
array.push(grad, #ffa000)
array.push(grad, #ff9800)
array.push(grad, #ff8f00)
array.push(grad, #ff8600)
array.push(grad, #ff7d00)
array.push(grad, #ff7400)
array.push(grad, #ff6a00)
array.push(grad, #ff6000)
array.push(grad, #ff5600)
array.push(grad, #ff4a00)
array.push(grad, #ff3e00)
array.push(grad, #fc2f00)
array.push(grad, #fa1a09)
array.push(grad, #ff1e0d)
array.push(grad, #ff071b)
array.push(grad, #ff0025)
array.push(grad, #ff002f)
array.push(grad, #ff0038)
array.push(grad, #ff0041)
array.push(grad, #ff0049)
array.push(grad, #ff0052)
array.push(grad, #ff005b)
array.push(grad, #ff0064)
array.push(grad, #ff006e)
array.push(grad, #ff0077)
array.push(grad, #ff0081)
array.push(grad, #ff008a)
array.push(grad, #ff0094)
array.push(grad, #ff009e)
array.push(grad, #ff00a8)
array.push(grad, #ff00b2)
array.push(grad, #ff00bd)
array.push(grad, #ff00c7)
array.push(grad, #ff00d1)
array.push(grad, #ff00dc)
array.push(grad, #ff00e6)
array.push(grad, #ff00f0)
array.push(grad, #f709fa)

AvgValue = alma(close, 21, 0.85, 6)
rsival = round(rsi(AvgValue, 21))
gradcolor = array.get(grad, rsival)

plot(trendstrength, linewidth=3, color=gradcolor)

```


Trend Analysis

Avoid losing contact!Don't miss out! The first and most important thing to do is to join my Discord chat now! Click here to start your adventure: discord.com/invite/ZTGpQJq 防止失联,请立即行动,加入本猫聊天群: discord.com/invite/ZTGpQJq
Aynı zamanda::

Feragatname