답변완료
예스트레이더 수식으로 변환 문의드립니다.
multi timeframe 버전이 아닌 수식으로 알고 있습니다.
1분봉, 5분봉, 30분봉 차트에서 사용할 수 있도록 변환 문의드립니다.
항상 부탁하는 입장이라 감사하고 죄송합니다.
감사합니다.
study("XYZT", 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])))
pcup=direction>0?longvs : na
pcdn=direction<0?shortvs : na
plot(pcup, color=aqua, style=circles, linewidth=2)
plot(pcup, color=aqua, style=linebr, linewidth=2)
plot(pcdn, color=fuchsia, style=circles, linewidth=2)
plot(pcdn, color=fuchsia, style=linebr, linewidth=2)
2020-01-29
240
글번호 135467
지표