커뮤니티

수식질문입니다.

프로필 이미지
무한대7
2021-01-11 15:11:05
1111
글번호 145354
답변완료
지표식 변환 부탁드립니다 myema = input(26, title="Center EMA", minval = 0) lookback = input(100, title="Lookback", minval = 0) multiplier = input(2, title="Multiplier", minval = 0, step = 0.01) shortema = input(13, title="Short EMA", minval=1) mode = input(title="Use Close?", type=bool, defval=true) centerline = ema(close, myema) myvar = mode == true ? abs(close - centerline) : max(abs(high - centerline), abs(low - centerline)) myvars = myvar * myvar mymov = sqrt(sma(myvars, lookback)) newmax = max(mymov, max(mymov[1], max(mymov[2], max(mymov[3], max(mymov[4], mymov[5] ) ) ) ) ) upper = centerline + (newmax * multiplier) lower = centerline - (newmax * multiplier) plot(centerline, title="Center EMA", color=#FFFF00, linewidth=3) plot(ema(close,shortema), title="Short EMA", color=#c900ff, linewidth=3) plot(upper, title="Upper Channel", linewidth=3) plot(lower, title="Lower Channel", linewidth=3)
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-01-11 15:58:38

안녕하세요 예스스탁입니다. input : myema(26),lookback(100),multiplier(2),shortema(13),Mode(1); var : centerline(0),myvar(0),myvars(0),mymov(0),newmax(0),upper(0),lower(0); centerline = ema(close, myema); myvar = iff(mode == 1, abs(close - centerline) , max(abs(high - centerline), abs(low - centerline))); myvars = myvar * myvar; mymov = sqrt(ma(myvars, lookback)); newmax = max(mymov, max(mymov[1], max(mymov[2], max(mymov[3], max(mymov[4], mymov[5] ) ) ) ) ); upper = centerline + (newmax * multiplier); lower = centerline - (newmax * multiplier); plot1(centerline, "Center EMA",RED); plot2(ema(close,shortema), "Short EMA",BLUE); plot3(upper, "Upper Channel"); plot4(lower, "Lower Channel"); 즐거운 하루되세요 > 무한대7 님이 쓴 글입니다. > 제목 : 수식질문입니다. > 지표식 변환 부탁드립니다 myema = input(26, title="Center EMA", minval = 0) lookback = input(100, title="Lookback", minval = 0) multiplier = input(2, title="Multiplier", minval = 0, step = 0.01) shortema = input(13, title="Short EMA", minval=1) mode = input(title="Use Close?", type=bool, defval=true) centerline = ema(close, myema) myvar = mode == true ? abs(close - centerline) : max(abs(high - centerline), abs(low - centerline)) myvars = myvar * myvar mymov = sqrt(sma(myvars, lookback)) newmax = max(mymov, max(mymov[1], max(mymov[2], max(mymov[3], max(mymov[4], mymov[5] ) ) ) ) ) upper = centerline + (newmax * multiplier) lower = centerline - (newmax * multiplier) plot(centerline, title="Center EMA", color=#FFFF00, linewidth=3) plot(ema(close,shortema), title="Short EMA", color=#c900ff, linewidth=3) plot(upper, title="Upper Channel", linewidth=3) plot(lower, title="Lower Channel", linewidth=3)