커뮤니티
아래의 트레이디이뷰 수식을 변환부탁드립니다.
2025-11-05 02:43:02
179
글번호 227658
//@version=4
study("ATR Breakouts", overlay=true)
per = input(50, title="Length")
aper = input(20, title="Atr Length")
LongEntry = ema(close, per) + 2 * atr(aper)
LongStopLoss = ema(close, per) + atr(aper)
ShortEntry = ema(close, per) - 2 * atr(aper)
ShortStopLoss = ema(close, per) - atr(aper)
plot(LongEntry, "Long Entry Threshold", color=color.green, style=plot.style_line)
plot(LongStopLoss, "Long Stop Loss", color=color.blue, style=plot.style_line)
plot(ShortEntry, "Short Entry Threshold", color=color.red, style=plot.style_line)
plot(ShortStopLoss, "Short Stop Loss", color=color.black, style=plot.style_line)
답변 1
예스스탁 예스스탁 답변
2025-11-05 13:30:39
안녕하세요
예스스탁입니다.
input : per(50);
input : aper(20);
var : alpha(0),ATRV(0);
var : LongEntry(0),LongStopLoss(0),ShortEntry(0),ShortStopLoss(0);
alpha = 1 / aper ;
ATRV = IFf(IsNan(ATRV[1]) == true, ma(TrueRange,aper) , alpha * TrueRange + (1 - alpha) * IFf(isnan(ATRV[1])==true,0,ATRV[1]));
LongEntry = ema(close, per) + 2 * atrv;
LongStopLoss = ema(close, per) + atrv;
ShortEntry = ema(close, per) - 2 * atrv;
ShortStopLoss = ema(close, per) - atrv;
plot1(LongEntry, "Long Entry Threshold", green);
plot2(LongStopLoss, "Long Stop Loss", blue);
plot3(ShortEntry, "Short Entry Threshold", red);
plot4(ShortStopLoss, "Short Stop Loss", black);
즐거운 하루되세요
다음글
이전글