답변완료
수식의뢰
study("RSI Bands [LazyBear]", shorttitle="RSIBANDS_LB", overlay=true)
obLevel = input(70, title="RSI Overbought")
osLevel = input(30, title="RSI Oversold")
length = input(14, title="RSI Length")
src=close
ep = 2 * length - 1
auc = ema( max( src - src[1], 0 ), ep )
adc = ema( max( src[1] - src, 0 ), ep )
x1 = (length - 1) * ( adc * obLevel / (100-obLevel) - auc)
ub = iff( x1 >= 0, src + x1, src + x1 * (100-obLevel)/obLevel )
x2 = (length - 1) * ( adc * osLevel / (100-osLevel) - auc)
lb = iff( x2 >= 0, src + x2, src + x2 * (100-osLevel)/osLevel )
plot( ub, title="Resistance", color=red, linewidth=2)
plot( lb, title="Support", color=green, linewidth=2)
plot( avg(ub, lb), title="RSI Midline", color=gray, linewidth=1)
트레이딩뷰에 있는 RSI Bands 라는 지표입니다
예스랭귀지로 구현해주세요
그리고
해당 지표 밴드의 하단선 근처에 온 종목을 찾는 검색기를 만들어주세요
2023-12-10
1254
글번호 174715
지표
답변완료
확인요청 드립니다. 83933글
좋은 한주 되십시요.
[ 요청1 ]
Input : Period(15),Upsim(50);
var1 = Simrido(Period);
if var1 >= Upsim Then PlotPaintBar(High, Low, "투자심리선",MAGENTA,Def,7);
else NoPlot(1);
상기 강조 지표에서 첫신호가 발생하고 10개봉(변수)중에 5개(변수) 이상이면
PlaySound("C:₩예스트레이더₩data₩Sound₩alert.wav");
소리가 날수 있도록 수식 좀 요청 드립니다.
[ 요청2]
아래글 재 확인 요청 드립니다. 83933글
즉 신호가 발생하면 다음신호에 의해서 수평선이 짧게(점수준) 됨니다.
이 점수준 수평선을 다음신호가 발생 해도
기본으로 Index <= var1 + 5 까지는 수평선이 그어지도록 요청 드립니다.
############################################################
83933글
############################################################
"기본 5봉 까지 수평 추세선을 그리고
5봉 보다 크면 다음신호가 발생할때 까지 계속 추세선을 그린다"
수정 좀 부탁 드립니다.
▶ 아래 수식
var : TX(0);
input : P(5),n(8),틱(3);
var : cnt(0),LL(0),HH(0);
Array : LTL[10](0),HTL[10](0);
var : LTL1(0),LTL2(0),LTL3(0),LTL4(0),LTL5(0),LTL6(0);
var : HTL1(0),HTL2(0),HTL3(0),HTL4(0),HTL5(0),HTL6(0);
if L < Lowest(L,P)[1] and (LL == 0 or (LL > 0 and abs(L-LL) >= PriceScale*틱)) Then
{
LL = L;
For cnt = 9 DownTo 1
{
LTL[cnt] = LTL[cnt-1];
}
LTL[0] = TL_new(sDate,sTime,LL,NextBarSdate,NextBarStime,LL);
TL_SetColor(LTL[0],Black);
TL_Delete(LTL[n]);
TL_SetSize(LTL[0],2);
}
Else
{
TL_SetEnd(LTL[0],sDate,sTime,LL);
}
if H > highest(H,P)[1] and (HH == 0 or (HH > 0 and abs(H-HH) >= PriceScale*틱)) Then
{
HH = H;
For cnt = 9 DownTo 1
{
HTL[cnt] = HTL[cnt-1];
}
HTL[0] = TL_new(sDate,sTime,HH,NextBarSdate,NextBarStime,HH);
TL_SetColor(HTL[0],Magenta);
TL_SetSize(HTL[0],2);
TL_Delete(HTL[n]);
}
Else
{
TL_SetEnd(HTL[0],sDate,sTime,HH);
}
#######################################################################33
수고하십시요.
2023-12-10
966
글번호 174711
검색
답변완료
부탁드립니다.
변환 부탁 드립니다.
감기조심하세요
선형회귀 관련 캔들입니다.
study("Linear Regression Channel", overlay = true, max_bars_back = 1000, max_lines_count = 300)
src = input(defval = close, title = "Source")
len = input(defval = 100, title = "Length", minval = 10)
devlen = input(defval = 2., title = "Deviation", minval = 0.1, step = 0.1)
extendit = input(defval = true, title = "Extend Lines")
showfibo = input(defval = false, title = "Show Fibonacci Levels")
showbroken = input(defval = true, title = "Show Broken Channel", inline = "brk")
brokencol = input(defval = color.blue, title = "", inline = "brk")
upcol = input(defval = color.lime, title = "Up/Down Trend Colors", inline = "trcols")
dncol = input(defval = color.red, title = "", inline = "trcols")
widt = input(defval = 2, title = "Line Width")
var fibo_ratios = array.new_float(0)
var colors = array.new_color(2)
if barstate.isfirst
array.unshift(colors, upcol)
array.unshift(colors, dncol)
array.push(fibo_ratios, 0.236)
array.push(fibo_ratios, 0.382)
array.push(fibo_ratios, 0.618)
array.push(fibo_ratios, 0.786)
get_channel(src, len)=>
mid = sum(src, len) / len
slope = linreg(src, len, 0) - linreg(src, len, 1)
intercept = mid - slope * floor(len / 2) + ((1 - (len % 2)) / 2) * slope
endy = intercept + slope * (len - 1)
dev = 0.0
for x = 0 to len - 1
dev := dev + pow(src[x] - (slope * (len - x) + intercept), 2)
dev := sqrt(dev/len)
[intercept, endy, dev, slope]
[y1_, y2_, dev, slope] = get_channel(src, len)
outofchannel = (slope > 0 and close < y2_ - dev * devlen) ? 0 : (slope < 0 and close > y2_ + dev * devlen) ? 2 : -1
var reglines = array.new_line(3)
var fibolines = array.new_line(4)
for x = 0 to 2
if not showbroken or outofchannel != x or nz(outofchannel[1], -1) != -1
line.delete(array.get(reglines, x))
else
line.set_color(array.get(reglines, x), color = brokencol)
line.set_width(array.get(reglines, x), width = 2)
line.set_style(array.get(reglines, x), style = line.style_dotted)
line.set_extend(array.get(reglines, x), extend = extend.none)
array.set(reglines, x,
line.new(x1 = bar_index - (len - 1),
y1 = y1_ + dev * devlen * (x - 1),
x2 = bar_index,
y2 = y2_ + dev * devlen * (x - 1),
color = array.get(colors, round(max(sign(slope), 0))),
style = x % 2 == 1 ? line.style_solid : line.style_dashed,
width = widt,
extend = extendit ? extend.right : extend.none))
if showfibo
for x = 0 to 3
line.delete(array.get(fibolines, x))
array.set(fibolines, x,
line.new(x1 = bar_index - (len - 1),
y1 = y1_ - dev * devlen + dev * devlen * 2 * array.get(fibo_ratios, x),
x2 = bar_index,
y2 = y2_ - dev * devlen + dev * devlen * 2 * array.get(fibo_ratios, x),
color = array.get(colors, round(max(sign(slope), 0))),
style = line.style_dotted,
width = widt,
extend = extendit ? extend.right : extend.none))
var label sidelab = label.new(x = bar_index - (len - 1), y = y1_, text = "S", size = size.large)
txt = slope > 0 ? slope > slope[1] ? "⇑" : "⇗" : slope < 0 ? slope < slope[1] ? "⇓" : "⇘" : "⇒"
stl = slope > 0 ? slope > slope[1] ? label.style_label_up : label.style_label_upper_right : slope < 0 ? slope < slope[1] ? label.style_label_down : label.style_label_lower_right : label.style_label_right
label.set_style(sidelab, stl)
label.set_text(sidelab, txt)
label.set_x(sidelab, bar_index - (len - 1))
label.set_y(sidelab, slope > 0 ? y1_ - dev * devlen : slope < 0 ? y1_ + dev * devlen : y1_)
label.set_color(sidelab, slope > 0 ? upcol : slope < 0 ? dncol : color.blue)
alertcondition(outofchannel, title='Channel Broken', message='Channel Broken')
// direction
trendisup = sign(slope) != sign(slope[1]) and slope > 0
trendisdown = sign(slope) != sign(slope[1]) and slope < 0
alertcondition(trendisup, title='Up trend', message='Up trend')
alertcondition(trendisdown, title='Down trend', message='Down trend')
2023-12-09
1168
글번호 174707
지표
답변완료
볼밴돌파수식
84895번에 답변에 대한 후속문의 있읍니다.
===================================================
이건 다른건데요,
아래 수식은 종전에 60봉간 좁은 볼밴폭 유지 후 볼밴상한선 돌파하는 봉을 검색하는 것이었는데, 거의 나오지 않아 다음과 같이 단순화하고 싶어 수식수정바랍니다.
.동일 볼밴 이용(120,1)
.종가가 120봉간 볼밴상한선 미만(120봉간 한번도 상한선돌파하는 종가가 없음)
.상/하 볼밴의 폭은 무시
.0봉에 볼밴상한선 돌파
간단한거 같아 시도해봐도 안되어서 할 수 없이 문의드립니다.
====================================================
input : Period(120),dv(1);
input : N(60),Per1(10),Per2(5);
var : BBup(0),BBdn(0),Emav(0),R(0);
BBup = BollBandUp(Period,dv);
BBdn = BollBandDown(Period,dv);
Emav = Ema(c,Period);
R = (Emav-Emav[N])/Emav[N]*100;
value1 = highest(BBup,Period);
value2 = lowest(BBdn,Period);
if CrossUp(c,bbup) and
CountIf(H > bbup,N)[1] < 1 and
value1[1] <= Value2[1]*(1+Per1/100) and
R <= Per2 and R >= -Per2 Then
Find(1);
2023-12-11
1183
글번호 174706
종목검색