답변완료
문의 드립니다.
// --- settings
ATRperiod = input.int(defval=13, title='ATR Period', minval=1)
BBperiod = input.int(defval=6, title='Bollinger Bands Period', minval=1)
BBdeviation = input.float(defval=5.00, title='Bollinger Bands Deviation', minval=0.1, step=0.1)
UseATRfilter = input(defval=true, title='ATR Filter On/Off') // false = 0, true = 1
showsignals = input(title='Show Signals ', defval=true)
// --- end of settings
// Bollinger Bands calculation
BBUpper = ta.sma(close, BBperiod) + ta.stdev(close, BBperiod) * BBdeviation
BBLower = ta.sma(close, BBperiod) - ta.stdev(close, BBperiod) * BBdeviation
// ATR calculation
atrValue = ta.atr(ATRperiod)
// Signal initialization
var float FollowLine = na
var int BBSignal = 0
// Determine BB signal
if (close > BBUpper)
BBSignal := 1
else if (close < BBLower)
BBSignal := -1
// Buy signal logic
if (BBSignal == 1)
if (UseATRfilter)
FollowLine := low - atrValue
else
FollowLine := low
if (FollowLine < nz(FollowLine[1]))
FollowLine := nz(FollowLine[1])
// Sell signal logic
if (BBSignal == -1)
if (UseATRfilter)
FollowLine := high + atrValue
else
FollowLine := high
if (FollowLine > nz(FollowLine[1]))
FollowLine := nz(FollowLine[1])
// Trend direction determination
var int iTrend = 0
if (nz(FollowLine) > nz(FollowLine[1]))
iTrend := 1
else if (nz(FollowLine) < nz(FollowLine[1]))
iTrend := -1
// Trend line color based on trend direction
lineColor = iTrend > 0 ? color.rgb(9, 98, 232) : color.new(color.rgb(220, 20, 60), 0)
//buy & sell conditions
buy=0.0
sell=0.0
buy:=iTrend[1]==-1 and iTrend==1 ? 1 : na
sell:=iTrend[1]==1 and iTrend==-1? 1 : na
//alerts
alertcondition(sell == 1 ,title="Sell",message="Follow Line Sell")
alertcondition(buy == 1 ,title="Buy",message="Follow Line Buy")
alertcondition(buy == 1 or sell == 1 ,title="Signal",message="Follow Line Signal")
// Plot the trend line and signals
plot(FollowLine, color=lineColor, linewidth=2, title="Follow Line")
plotshape(buy == 1 and showsignals ? FollowLine-atrValue :na, text='BUY', style= shape.labelup, location=location.absolute, color=color.blue, textcolor=color.white, offset=0, transp=0,size=size.auto)
plotshape(sell == 1 and showsignals ? FollowLine+atrValue:na, text='SELL', style=shape.labeldown, location=location.absolute, color=color.rgb(102, 15, 15), textcolor=color.white, offset=0, transp=0,size=size.auto)
트레이딩뷰 수식입니다.
위 수식을 예스 지표로 만들어주시고
신호검색 수식도 만들어주세요.
2025-08-21
240
글번호 193420
시스템
답변완료
지표와 검색식 변환 부탁드립니다.
A = LinearRegressionValue(C, 11, 0);
B = AVG(A, 7);
C(1)<B && C>B
1. 지표에 B가 LINE으로 나타날수 있도록 부탁드립니다.
2. 검색식도 부탁드립니다.
-------------------------------
A = LinearRegressionValue(C, 11, 0);
B = AVG(A, 7);
B(2)>=B(1) && B(1)<B
3. 검색식 부탁드립니다.
즐거운 하루 보내세요~
2025-08-21
199
글번호 193416
종목검색
답변완료
지표와 검색식 부탁드리겠습니다.
키움수식입니다
혼자서 이래저래 해보다가
적용이 안되서 이렇게 문의드립니다.
늘 감사드립니다
가=ma(c,기간1);
나=ma(c,기간2);
다=shift((highest(high,9)+lowest(low,9)+highest(high,26)+lowest(low,26))/4,26-1);
라=shift((highest(high,52)+lowest(low,52))/2,26-1);
마=valuewhen(1,crossup(가,나),다);
바=valuewhen(1,crossup(가,나),라);
사=crossdown(c,max(마,바));
아=crossup(c,max(마(1),바(1)));
아 && eavg(c,기간3) < C && BarsSince(사) < 기간4 && BarsSince(아) < 기간5
기간1 20
기간2 60
기간3 33
기간4 33
기간5 52
2025-08-21
228
글번호 193415
검색