답변완료
변환 부탁 드립니다.
한 개 더 변환 부탁 드립니다.
바쁘실 텐데 정말 죄송합니다.
다음은 트레이딩뷰 소스코드입니다.
//@version=5
indicator(overlay = true, max_lines_count = 500, max_labels_count = 500, max_bars_back=500)
//------------------------------------------------------------------------------
//Settings
//-----------------------------------------------------------------------------{
h = input.float(8.,'Bandwidth', minval = 0)
mult = input.float(3., minval = 0)
src = input(close, 'Source')
repaint = input(true, 'Repainting Smoothing', tooltip = 'Repainting is an effect where the indicators historical output is subject to change over time. Disabling repainting will cause the indicator to output the endpoints of the calculations')
//Style
upCss = input.color(color.teal, 'Colors', inline = 'inline1', group = 'Style')
dnCss = input.color(color.red, '', inline = 'inline1', group = 'Style')
//-----------------------------------------------------------------------------}
//Functions
//-----------------------------------------------------------------------------{
//Gaussian window
gauss(x, h) => math.exp(-(math.pow(x, 2)/(h * h * 2)))
//-----------------------------------------------------------------------------}
//Append lines
//-----------------------------------------------------------------------------{
n = bar_index
var ln = array.new_line(0)
if barstate.isfirst and repaint
for i = 0 to 499
array.push(ln,line.new(na,na,na,na))
//-----------------------------------------------------------------------------}
//End point method
//-----------------------------------------------------------------------------{
var coefs = array.new_float(0)
var den = 0.
if barstate.isfirst and not repaint
for i = 0 to 499
w = gauss(i, h)
coefs.push(w)
den := coefs.sum()
out = 0.
if not repaint
for i = 0 to 499
out += src[i] * coefs.get(i)
out /= den
mae = ta.sma(math.abs(src - out), 499) * mult
upper = out + mae
lower = out - mae
//-----------------------------------------------------------------------------}
//Compute and display NWE
//-----------------------------------------------------------------------------{
float y2 = na
float y1 = na
nwe = array.new<float>(0)
if barstate.islast and repaint
sae = 0.
//Compute and set NWE point
for i = 0 to math.min(499,n - 1)
sum = 0.
sumw = 0.
//Compute weighted mean
for j = 0 to math.min(499,n - 1)
w = gauss(i - j, h)
sum += src[j] * w
sumw += w
y2 := sum / sumw
sae += math.abs(src[i] - y2)
nwe.push(y2)
sae := sae / math.min(499,n - 1) * mult
for i = 0 to math.min(499,n - 1)
if i%2
line.new(n-i+1, y1 + sae, n-i, nwe.get(i) + sae, color = upCss)
line.new(n-i+1, y1 - sae, n-i, nwe.get(i) - sae, color = dnCss)
if src[i] > nwe.get(i) + sae and src[i+1] < nwe.get(i) + sae
label.new(n-i, src[i], '▼', color = color(na), style = label.style_label_down, textcolor = dnCss, textalign = text.align_center)
if src[i] < nwe.get(i) - sae and src[i+1] > nwe.get(i) - sae
label.new(n-i, src[i], '▲', color = color(na), style = label.style_label_up, textcolor = upCss, textalign = text.align_center)
y1 := nwe.get(i)
//-----------------------------------------------------------------------------}
//Dashboard
//-----------------------------------------------------------------------------{
var tb = table.new(position.top_right, 1, 1
, bgcolor = #1e222d
, border_color = #373a46
, border_width = 1
, frame_color = #373a46
, frame_width = 1)
if repaint
tb.cell(0, 0, 'Repainting Mode Enabled', text_color = color.white, text_size = size.small)
//-----------------------------------------------------------------------------}
//Plot
//-----------------------------------------------------------------------------}
plot(repaint ? na : out + mae, 'Upper', upCss)
plot(repaint ? na : out - mae, 'Lower', dnCss)
//Crossing Arrows
plotshape(ta.crossunder(close, out - mae) ? low : na, "Crossunder", shape.labelup, location.absolute, color(na), 0 , text = '▲', textcolor = upCss, size = size.tiny)
plotshape(ta.crossover(close, out + mae) ? high : na, "Crossover", shape.labeldown, location.absolute, color(na), 0 , text = '▼', textcolor = dnCss, size = size.tiny)
//-----------------------------------------------------------------------------}
2024-04-21
802
글번호 178767
지표
답변완료
수식 문의드립니다.
안녕하세요.
아래는 트레이딩뷰 소스코드입니다.
예스로 변환 부탁드립니다. 감사합니다.
//@version=5
indicator( overlay = true, max_lines_count = 500, max_labels_count = 500, max_bars_back=500)
//------------------------------------------------------------------------------
//Settings
//-----------------------------------------------------------------------------{
h = input.float(8.,'Bandwidth', minval = 0)
src = input(close,'Source')
repaint = input(true, 'Repainting Smoothing', tooltip = 'Repainting is an effect where the indicators historical output is subject to change over time. Disabling repainting will cause the indicator to output the endpoint of the estimator')
//Style
upCss = input.color(color.teal, 'Colors', inline = 'inline1', group = 'Style')
dnCss = input.color(color.red, '', inline = 'inline1', group = 'Style')
//-----------------------------------------------------------------------------}
//Functions
//-----------------------------------------------------------------------------{
//Gaussian window
gauss(x, h) => math.exp(-(math.pow(x, 2)/(h * h * 2)))
//-----------------------------------------------------------------------------}
//Append lines
//-----------------------------------------------------------------------------{
n = bar_index
var ln = array.new_line(0)
if barstate.isfirst and repaint
for i = 0 to 499
array.push(ln,line.new(na,na,na,na))
//-----------------------------------------------------------------------------}
//End point method
//-----------------------------------------------------------------------------{
var coefs = array.new_float(0)
var den = 0.
if barstate.isfirst and not repaint
for i = 0 to 499
w = gauss(i, h)
coefs.push(w)
den := coefs.sum()
out = 0.
if not repaint
for i = 0 to 499
out += src[i] * coefs.get(i)
out /= den
//-----------------------------------------------------------------------------}
//Compute and display NWE
//-----------------------------------------------------------------------------{
float y2 = na
float y1 = na
float y1_d = na
line l = na
label lb = na
if barstate.islast and repaint
//Compute and set NWE point
for i = 0 to math.min(499,n - 1)
sum = 0.
sumw = 0.
//Compute weighted mean
for j = 0 to math.min(499,n - 1)
w = gauss(i - j, h)
sum += src[j] * w
sumw += w
y2 := sum / sumw
d = y2 - y1
//Set coordinate line
l := array.get(ln,i)
line.set_xy1(l,n-i+1,y1)
line.set_xy2(l,n-i,y2)
line.set_color(l,y2 > y1 ? dnCss : upCss)
line.set_width(l,2)
if d * y1_d < 0
label.new(n-i+1, src[i], y1_d < 0 ? '▲' : '▼'
, color = color(na)
, style = y1_d < 0 ? label.style_label_up : label.style_label_down
, textcolor = y1_d < 0 ? upCss : dnCss
, textalign = text.align_center)
y1 := y2
y1_d := d
//-----------------------------------------------------------------------------}
//Dashboard
//-----------------------------------------------------------------------------{
var tb = table.new(position.top_right, 1, 1
, bgcolor = #1e222d
, border_color = #373a46
, border_width = 1
, frame_color = #373a46
, frame_width = 1)
if repaint
tb.cell(0, 0, 'Repainting Mode Enabled', text_color = color.white, text_size = size.small)
//-----------------------------------------------------------------------------}
//Plot
//-----------------------------------------------------------------------------}
plot(repaint ? na : out, 'NWE Endpoint Estimator', out > out[1] ? upCss : dnCss)
//-----------------------------------------------------------------------------}
2024-04-21
648
글번호 178766
지표
답변완료
수식 부탁드립니다.
종목검색식 도움 부탁드립니다.
기본조건 - 일봉이 양봉입니다.
순매수체결량이 0선 이상에서 상승추세유지(누적순매수체결량이상승)중입니다.
//Upvol "상승형 체결거래량";
//DownVol "하락형 체결거래량"
input: 막대굵기 (1);
var : sumPL(0);
if sDate != sDate[1] Then
{
sumPL = 0;
}
Else
{
sumPL = sumPL + (Upvol-DownVol);
If sumPL > 0 Then
Plot1(sumPL, "순매수체결량",RGB(255,0,0),def,막대굵기 );
Else
Plot1(sumPL, "순매수체결량",RGB(0,0,255),def,막대굵기 );
}
PlotBaseLine1(0, "기준선0");
가 수식입니다.
input : 횡보율(0.3),이평(5);
var : 상승개수(0) ,AA(0), DD(0), TT(0), FF(0);
#10지수이평~30지수이평 중 정봉대비 횡보율만큼 상승한 갯수
상승개수 = iff(Ema(c,10)>Ema(c,10)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,11)>Ema(c,11)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,12)>Ema(c,12)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,13)>Ema(c,13)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,14)>Ema(c,14)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,15)>Ema(c,15)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,16)>Ema(c,16)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,17)>Ema(c,17)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,18)>Ema(c,18)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,19)>Ema(c,19)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,20)>Ema(c,20)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,21)>Ema(c,21)[1]*(1+횡보율/100),1,0)+
iff(ema(c,22)>Ema(c,22)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,23)>Ema(c,23)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,24)>Ema(c,24)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,25)>Ema(c,25)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,26)>Ema(c,26)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,27)>Ema(c,27)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,28)>Ema(c,28)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,29)>Ema(c,29)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,30)>Ema(c,30)[1]*(1+횡보율/100),1,0);
AA = 상승개수/21*100;
DD = Ema(Ema(AA,이평),이평);
TT = EmA(EmA(EmA(AA,이평),이평),이평);
FF =EmA(TT,이평);
if CrossUp(dd,FF) && DD<=15 Then
Find(1);
나 수식입니다.
input : 횡보율(0.3),이평(5);
var : 상승개수(0) ,AA(0), DD(0), TT(0), FF(0);
#10지수이평~30지수이평 중 정봉대비 횡보율만큼 상승한 갯수
상승개수 = iff(Ema(c,10)>Ema(c,10)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,11)>Ema(c,11)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,12)>Ema(c,12)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,13)>Ema(c,13)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,14)>Ema(c,14)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,15)>Ema(c,15)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,16)>Ema(c,16)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,17)>Ema(c,17)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,18)>Ema(c,18)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,19)>Ema(c,19)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,20)>Ema(c,20)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,21)>Ema(c,21)[1]*(1+횡보율/100),1,0)+
iff(ema(c,22)>Ema(c,22)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,23)>Ema(c,23)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,24)>Ema(c,24)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,25)>Ema(c,25)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,26)>Ema(c,26)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,27)>Ema(c,27)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,28)>Ema(c,28)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,29)>Ema(c,29)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,30)>Ema(c,30)[1]*(1+횡보율/100),1,0);
AA = 상승개수/21*100;
DD = Ema(Ema(AA,이평),이평);
TT = EmA(EmA(EmA(AA,이평),이평),이평);
FF =EmA(TT,이평);
if CrossUp(dd,15) && dd>tt && tT>fF Then
Find(1);
다 수식 부탁드립니다. 현재봉이 390봉중 최고거래량갱신한 양봉입니다.
라 수식 부탁드립니다. 현재봉이 1봉전 종가보다 1% 이상 상승한 양봉입니다.
**************************************
첫번째는 ((가 or 나) and 다 and 라)를 만족하는 종목검색식 부탁드립니다.
일봉은 양봉이고 누적순매수체결량이 0선위에서 상승하는 종목중에서
(가 또는 나) 조건을 만족하는 종목이 1봉전 종가보다 1% 이상 상승한 양봉으로
390봉 최고거래량을 갱신한 양봉 종목을 검색되게 해 주십시오.
두번째는 ((가 or 나) and 다 and 라)를 만족했던 종목이
당일 고가를 갱신 직전(당일고가-2%이내접근시)에 검색되게 검색식 부탁드립니다.
세번째는 검색시 검색에 필요한 최소기간을 500봉으로 설정해야 하는지요?
이 검색식에서는 최소 기간값을 얼마로 설정해야 효율적인지요...
제가 만든 검색식은 장중에 검색추출시간이 너무 걸려서,
검색진행하다가 멈추거나 검색이 안되어 부득이 운영자님께 문의드립니다.
늘 도움주셔서 감사드립니다.
2024-04-21
674
글번호 178762
종목검색