답변완료
화살표 표시 도움 부탁드립니다.
다음과 같이 조건(단기과열예고)에 해당하는 일봉에 화살표를 표시하려고 합니다.
제가 보기에 아래 코드에는 문제가 없는것 같은데 검증을 하게 되면
"스크립트 괄호 사용에 오류가 있습니다.;40009"
라는 에러가 발생하네요. 도움 주시면 감사하겠습니다.
(나무 HTS에서 신호 스크립트 작성시 발생합니다)
var : condition1(false),condition2(false),condition3(false),condition4(false), a(0);
condition1 = ma(C,40)[1]*1.3 <= C;
condition2 = ma(M,40)[1]*6 <= ma(M,2);
a = (H-L)/(H+L)/2;
condition3 = ma(a,40)[1]*1.5 <= ma(a,2);
condition4 = C[1] < C[0];
if condition1 and condition2 and condition3 and condition4 then
plot1(H,"검색",red);
2022-07-01
1415
글번호 160347
강조
답변완료
수식 문의
아래의 수식을 예트의 수식으로
변환해 주시기를 요청 드립니다.
엔밸롭지표에 RSI와 ART 변동성을 추가한 지표라고 합니다.
아래 링크를 참고 하시기 바랍니다.
https://www.tradingview.com/scr ipt/MKPAvSrz-RS-MTF-RSI-Weighted-Range-Envelope-V0/
덕분에 예트에서 벗어나지 못하고 있습니다.
항상 친절한 답변 미리 감사드립니다.
//@version=2
study(title='[RS]MTF RSI Weighted Range Envelope V0', shorttitle='E', overlay=true)
tf = input('5')
src = input(open)
ema_length = input(1)
rsi_length = input(20)
atr_length = input(20)
atr_offset = input(1)
ob_value = input(70)*0.01
os_value = input(30)*0.01
rsi = rsi(ema(src, ema_length), rsi_length)
range = atr(atr_length)[atr_offset] * (0.01*rsi_length)
h = src + ((100 - rsi) * range)
l = src - (rsi * range)
sh = security(tickerid, tf, h)
sl = security(tickerid, tf, l)
sob = sl + ((sh - sl)*ob_value)
sm = sl + ((sh - sl)*0.50)
sos = sl + ((sh - sl)*os_value)
p100 = plot(series=sh, title='', color=black, style=line, transp=0, linewidth=1)
pob = plot(series=sob, title='', color=red, style=circles, transp=0, linewidth=1)
pm = plot(series=sm, title='', color=black, style=circles, transp=0, linewidth=1)
pos = plot(series=sos, title='', color=lime, style=circles, transp=0, linewidth=1)
p0 = plot(series=sl, title='', color=black, style=line, transp=0, linewidth=1)
fill(pos, pob, color=purple, transp=90)
2022-07-01
1449
글번호 160341
지표
답변완료
수식 문의
아래의 수식을 예트의 수식으로
변환해 주시기를 요청 드립니다.
엔밸롭지표를 커널 필터로 평활화한 지표라고 합니다.
아래 링크를 참고 하시기 바랍니다.
https://www.tradingview.com/scr ipt/Iko0E2kL-Nadaraya-Watson-Envelope-LUX/
덕분에 예트에서 벗어나지 못하고 있습니다.
항상 친절한 답변 미리 감사드립니다.
indicator("Nadaraya-Watson Envelope [LUX]",overlay=true,max_bars_back=1000,max_lines_count=500,max_labels_count=500)
length = input.float(500,'Window Size',maxval=500,minval=0)
h = input.float(8.,'Bandwidth')
mult = input.float(3.)
src = input.source(close,'Source')
up_col = input.color(#39ff14,'Colors',inline='col')
dn_col = input.color(#ff1100,'',inline='col')
//----
n = bar_index
var k = 2
var upper = array.new_line(0)
var lower = array.new_line(0)
lset(l,x1,y1,x2,y2,col)=>
line.set_xy1(l,x1,y1)
line.set_xy2(l,x2,y2)
line.set_color(l,col)
line.set_width(l,2)
if barstate.isfirst
for i = 0 to length/k-1
array.push(upper,line.new(na,na,na,na))
array.push(lower,line.new(na,na,na,na))
//----
line up = na
line dn = na
//----
cross_up = 0.
cross_dn = 0.
if barstate.islast
y = array.new_float(0)
sum_e = 0.
for i = 0 to length-1
sum = 0.
sumw = 0.
for j = 0 to length-1
w = math.exp(-(math.pow(i-j,2)/(h*h*2)))
sum += src[j]*w
sumw += w
y2 = sum/sumw
sum_e += math.abs(src[i] - y2)
array.push(y,y2)
mae = sum_e/length*mult
for i = 1 to length-1
y2 = array.get(y,i)
y1 = array.get(y,i-1)
up := array.get(upper,i/k)
dn := array.get(lower,i/k)
lset(up,n-i+1,y1 + mae,n-i,y2 + mae,up_col)
lset(dn,n-i+1,y1 - mae,n-i,y2 - mae,dn_col)
if src[i] > y1 + mae and src[i+1] < y1 + mae
label.new(n-i,src[i],'▼',color=#00000000,style=label.style_label_down,textcolor=dn_col,textalign=text.align_center)
if src[i] < y1 - mae and src[i+1] > y1 - mae
label.new(n-i,src[i],'▲',color=#00000000,style=label.style_label_up,textcolor=up_col,textalign=text.align_center)
cross_up := array.get(y,0) + mae
cross_dn := array.get(y,0) - mae
alertcondition(ta.crossover(src,cross_up),'Down','Down')
alertcondition(ta.crossunder(src,cross_dn),'Up','Up')
2022-07-01
1229
글번호 160340
지표