커뮤니티

문의 드립니다

프로필 이미지
만강
2024-10-31 09:58:26
665
글번호 184812
답변완료
안녕하세요 트레이딩지표 전환 부탁드립니다 1. res1 = input(title="Close Time Frame", type=resolution, defval="D") cld=security(tickerid, res1, close[1]) opd=security(tickerid,res1, open[1]) tu=(cld +opd)/2 plot( tu, "Breakout",color=black ,style=line,linewidth=2,transp=0) 2.다음지표에 현재가을 추가해주세요 input : Periods(10); input : Multiplier(3.0); input : changeATR(1);#1:SMA 0:RMA 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,"UpTrend",green); Else NoPlot(1); if trend == -1 then Plot2(dn,"Down Trend",red); Else NoPlot(2); if trend == 1 and trend[1] == -1 Then { tx =Text_New(sDate,sTime,up,"●"); Text_SetStyle(tx,2,2); Text_SetColor(tx,Green); } if trend == -1 and trend[1] == 1 Then { tx =Text_New(sDate,sTime,dn,"●"); Text_SetStyle(tx,2,2); Text_SetColor(tx,Red); } 감사합니다
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-10-31 11:43:27

안녕하세요 예스스탁입니다. 1 var :cld(0),opd(0),tu(0); cld = DayClose(1); opd = DayOpen(1); tu=(cld +opd)/2; plot1(tu, "Breakout",black); 2 input : Periods(10); input : Multiplier(3.0); input : changeATR(1);#1:SMA 0:RMA 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,"UpTrend",green); Else NoPlot(1); if trend == -1 then Plot2(dn,"Down Trend",red); Else NoPlot(2); if trend == 1 and trend[1] == -1 Then { tx =Text_New(sDate,sTime,up,"●"); Text_SetStyle(tx,2,2); Text_SetColor(tx,Green); } if trend == -1 and trend[1] == 1 Then { tx =Text_New(sDate,sTime,dn,"●"); Text_SetStyle(tx,2,2); Text_SetColor(tx,Red); } plot3(c,"현재가"); 즐거운 하루되세요 > 만강 님이 쓴 글입니다. > 제목 : 문의 드립니다 > 안녕하세요 트레이딩지표 전환 부탁드립니다 1. res1 = input(title="Close Time Frame", type=resolution, defval="D") cld=security(tickerid, res1, close[1]) opd=security(tickerid,res1, open[1]) tu=(cld +opd)/2 plot( tu, "Breakout",color=black ,style=line,linewidth=2,transp=0) 2.다음지표에 현재가을 추가해주세요 input : Periods(10); input : Multiplier(3.0); input : changeATR(1);#1:SMA 0:RMA 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,"UpTrend",green); Else NoPlot(1); if trend == -1 then Plot2(dn,"Down Trend",red); Else NoPlot(2); if trend == 1 and trend[1] == -1 Then { tx =Text_New(sDate,sTime,up,"●"); Text_SetStyle(tx,2,2); Text_SetColor(tx,Green); } if trend == -1 and trend[1] == 1 Then { tx =Text_New(sDate,sTime,dn,"●"); Text_SetStyle(tx,2,2); Text_SetColor(tx,Red); } 감사합니다