커뮤니티

문의 드립니다

프로필 이미지
만강
2025-02-19 10:37:45
439
글번호 188312
답변완료
안녕하세요 input : Periods(10); input : Multiplier(3.0); input : changeATR(1);#1:SMA 0:RMA input : upcolor(Red),downcolor(Blue); var : src(0),alpha(0),source(0),ATR1(0),ATR2(0),ATRV(0); var : up(0),up1(0),dn(0),dn1(0),trend(0),tx(0); src = (H+L)/2; alpha = 1 / Periods; atr1 = IFf(IsNan(atr1[1]) == true , ma(TrueRange, Periods) , alpha * TrueRange + (1 - alpha) * atr1[1]); atr2 = ATR(Periods); atrv = IFf(changeATR == 1 , atr1 , atr2); up=src-(Multiplier*atrv); up1 = IFf(IsNan(up[1]) == False,up[1],up); up = iff(close[1] > up1 , max(up,up1) , up); dn=src+(Multiplier*atrv); dn1 = IFf(IsNan(dn[1]) == False,dn[1], dn); dn = iff(close[1] < dn1 , min(dn, dn1) , dn); trend = 1; trend = IFf(IsNan(trend[1]) == False,trend[1], trend); trend = IFf(trend == -1 and close > dn1 , 1 , iff(trend == 1 and close < up1 , -1 , trend)); if trend == 1 Then plot1(up,"Trend",upcolor); Else Plot1(dn,"Trend",downcolor); 위 트랜드 라인을 다른변수로 2개 더 추가하고 싶습니다 부탁드립니다 감사합니다
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2025-02-19 14:17:51

안녕하세요 예스스탁입니다. input : xPeriods(10),xMultiplier(3.0),xchangeATR(1);#1:SMA 0:RMA input : xupcolor(Red),xdowncolor(Blue); input : yPeriods(20),yMultiplier(3.0),ychangeATR(1);#1:SMA 0:RMA input : yupcolor(Red),ydowncolor(Blue); input : zPeriods(60),zMultiplier(3.0),zchangeATR(1);#1:SMA 0:RMA input : zupcolor(Red),zdowncolor(Blue); var : xsrc(0),xalpha(0),xsource(0),xATR1(0),xATR2(0),xATRV(0); var : xup(0),xup1(0),xdn(0),xdn1(0),xtrend(0); var : ysrc(0),yalpha(0),ysource(0),yATR1(0),yATR2(0),yATRV(0); var : yup(0),yup1(0),ydn(0),ydn1(0),ytrend(0); var : zsrc(0),zalpha(0),zsource(0),zATR1(0),zATR2(0),zATRV(0); var : zup(0),zup1(0),zdn(0),zdn1(0),ztrend(0); xsrc = (H+L)/2; xalpha = 1 / xPeriods; xatr1 = IFf(IsNan(xatr1[1]) == true , ma(TrueRange, xPeriods) , xalpha * TrueRange + (1 - xalpha) * xatr1[1]); xatr2 = ATR(xPeriods); xatrv = IFf(xchangeATR == 1 , xatr1 , xatr2); xup = xsrc-(xMultiplier*xatrv); xup1 = IFf(IsNan(xup[1]) == False,xup[1], xup); xup = iff(close[1] > xup1 , max(xup,xup1) , xup); xdn = xsrc+(xMultiplier*xatrv); xdn1 = IFf(IsNan(xdn[1]) == False,xdn[1], xdn); xdn = iff(close[1] < xdn1 , min(xdn, xdn1) , xdn); xtrend = 1; xtrend = IFf(IsNan(xtrend[1]) == False,xtrend[1], xtrend); xtrend = IFf(xtrend == -1 and close > xdn1 , 1 , iff(xtrend == 1 and close < xup1 , -1 , xtrend)); if xtrend == 1 Then plot1(xup,"xTrend",xupcolor); Else Plot1(xdn,"xTrend",xdowncolor); ysrc = (H+L)/2; yalpha = 1 / yPeriods; yatr1 = IFf(IsNan(yatr1[1]) == true , ma(TrueRange, yPeriods) , yalpha * TrueRange + (1 - yalpha) * yatr1[1]); yatr2 = ATR(yPeriods); yatrv = IFf(ychangeATR == 1 , yatr1 , yatr2); yup = ysrc-(yMultiplier*yatrv); yup1 = IFf(IsNan(yup[1]) == False,yup[1], yup); yup = iff(close[1] > yup1 , max(yup,yup1) , yup); ydn = ysrc+(yMultiplier*yatrv); ydn1 = IFf(IsNan(ydn[1]) == False,ydn[1], ydn); ydn = iff(close[1] < ydn1 , min(ydn, ydn1) , ydn); ytrend = 1; ytrend = IFf(IsNan(ytrend[1]) == False,ytrend[1], ytrend); ytrend = IFf(ytrend == -1 and close > ydn1 , 1 , iff(ytrend == 1 and close < yup1 , -1 , ytrend)); if ytrend == 1 Then plot2(yup,"yTrend",yupcolor); Else Plot2(ydn,"yTrend",ydowncolor); zsrc = (H+L)/2; zalpha = 1 / zPeriods; zatr1 = IFf(IsNan(zatr1[1]) == true , ma(TrueRange, zPeriods) , zalpha * TrueRange + (1 - zalpha) * zatr1[1]); zatr2 = ATR(zPeriods); zatrv = IFf(zchangeATR == 1 , zatr1 , zatr2); zup = zsrc-(zMultiplier*zatrv); zup1 = IFf(IsNan(zup[1]) == False,zup[1], zup); zup = iff(close[1] > zup1 , max(zup,zup1) , zup); zdn = zsrc+(zMultiplier*zatrv); zdn1 = IFf(IsNan(zdn[1]) == False,zdn[1], zdn); zdn = iff(close[1] < zdn1 , min(zdn, zdn1) , zdn); ztrend = 1; ztrend = IFf(IsNan(ztrend[1]) == False,ztrend[1], ztrend); ztrend = IFf(ztrend == -1 and close > zdn1 , 1 , iff(ztrend == 1 and close < zup1 , -1 , ztrend)); if ztrend == 1 Then plot3(zup,"zTrend",zupcolor); Else Plot3(zdn,"zTrend",zdowncolor); 즐거운 하루되세요 > 만강 님이 쓴 글입니다. > 제목 : 문의 드립니다 > 안녕하세요 input : Periods(10); input : Multiplier(3.0); input : changeATR(1);#1:SMA 0:RMA input : upcolor(Red),downcolor(Blue); var : src(0),alpha(0),source(0),ATR1(0),ATR2(0),ATRV(0); var : up(0),up1(0),dn(0),dn1(0),trend(0),tx(0); src = (H+L)/2; alpha = 1 / Periods; atr1 = IFf(IsNan(atr1[1]) == true , ma(TrueRange, Periods) , alpha * TrueRange + (1 - alpha) * atr1[1]); atr2 = ATR(Periods); atrv = IFf(changeATR == 1 , atr1 , atr2); up=src-(Multiplier*atrv); up1 = IFf(IsNan(up[1]) == False,up[1],up); up = iff(close[1] > up1 , max(up,up1) , up); dn=src+(Multiplier*atrv); dn1 = IFf(IsNan(dn[1]) == False,dn[1], dn); dn = iff(close[1] < dn1 , min(dn, dn1) , dn); trend = 1; trend = IFf(IsNan(trend[1]) == False,trend[1], trend); trend = IFf(trend == -1 and close > dn1 , 1 , iff(trend == 1 and close < up1 , -1 , trend)); if trend == 1 Then plot1(up,"Trend",upcolor); Else Plot1(dn,"Trend",downcolor); 위 트랜드 라인을 다른변수로 2개 더 추가하고 싶습니다 부탁드립니다 감사합니다