예스스탁
예스스탁 답변
2024-11-11 11:09:27
안녕하세요
예스스탁입니다.
input : Length(22);
input : ATRPeriod(22);
input : Mult(3);
var : short_stop(0),long_stop(0);
var : shortvs(0),longvs(0);
var : longswitch(0),shortswitch(0);
var : direction(0),pc(0);
short_stop = lowest(L,Length)+Mult*atr(ATRPeriod);
long_stop = highest(H,Length)-Mult*atr(ATRPeriod);
shortvs = IFf( IsNan(shortvs[1]) == true , short_stop , iff(close>shortvs[1], short_stop , min(short_stop,shortvs[1])));
longvs = iff( IsNaN(longvs[1]) == true , long_stop , iff(close<longvs[1], long_stop, max(long_stop,longvs[1])));
longswitch=iff (close>=shortvs[1] and close[1]<shortvs[1] , 1 , 0);
shortswitch=iff (close<=longvs[1] and close[1]>longvs[1] , 1 , 0);
direction= iff(IsNan(direction[1]) == true, 0,
iff (direction[1]<=0 and longswitch, 1,
iff (direction[1]>=0 and shortswitch, -1, direction[1])));
pc=iff(direction>0,longvs,shortvs);
plot1(pc,"원그래프",iff(direction>0,Cyan,Pink));
plot2(pc,"선그래프",iff(direction>0,Cyan,Pink));
즐거운 하루되세요
> 신대륙발견 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> study("Chandelier Stop", overlay=true)
//input variables
Length=input(title="Look Back Period", type=integer, defval=22)
ATRPeriod=input(title="ATR Period", type=integer, defval=22)
Mult=input(title="ATR Multiplier", type=integer, defval=3)
//calculate stop value
short_stop = lowest(Length)+Mult*atr(ATRPeriod)
long_stop = highest(Length)-Mult*atr(ATRPeriod)
shortvs=na(shortvs[1]) ? short_stop : iff(close>shortvs[1], short_stop , min(short_stop,shortvs[1]))
longvs=na(longvs[1]) ? long_stop : iff(close<longvs[1], long_stop, max(long_stop,longvs[1]))
longswitch=iff (close>=shortvs[1] and close[1]<shortvs[1] , 1 , 0)
shortswitch=iff (close<=longvs[1] and close[1]>longvs[1] , 1 , 0)
direction= iff(na(direction[1]), 0,
iff (direction[1]<=0 and longswitch, 1,
iff (direction[1]>=0 and shortswitch, -1, direction[1])))
pc=direction>0?longvs:shortvs
plot(pc, color=direction>0?aqua:fuchsia, style=circles, linewidth=2)
plot(pc, color=direction>0?aqua:fuchsia, style=line, linewidth=2)
트레이딩뷰 수식입니다.
예스로 좀 변화해주세요.
라인으로만 만들어주세요.