커뮤니티

지표식 부탁드립니다.

프로필 이미지
회원
2014-02-14 11:23:40
167
글번호 72559
답변완료
아래의 지표식 1은 rsi수식을 풀어서 종가대신 (예를 들어) 5이평을 넣은것입니다. == 지표식1 == inputs: Length(7),기간(5); Variables: Counter(0),DownAmt(0),UpAmt(0),UpSum(0),DownSum(0),UpAvg(0),DownAvg(0),RSIv(0); if CurrentBar == 1 and length >0 then begin UpSum = 0; DownSum = 0; For Counter = 0 To Length - 1 begin UpAmt = ma(c,기간)[Counter] - ma(c,기간)[Counter +1]; if UpAmt >= 0 then DownAmt = 0; Else begin DownAmt = -UpAmt; UpAmt = 0; End; UpSum = UpSum + UpAmt; DownSum = DownSum + DownAmt; End; UpAvg = UpSum/Length; DownAvg = DownSum/Length; End Else if CurrentBar > 1 and Length >0 then begin UpAamt = ma(c,기간)[0] - ma(c,기간)[1]; if UpAmt >= 0 then DownAmt = 0; Else Begin DownAmt = -UpAmt; UpAmt = 0; End; UpAvg = (UpAvg[1] * (Length - 1) + UpAmt)/Length; DownAvg = (DownAvg[1] * (Length - 1) + DownAmt)/Length; End; if UpAvg + DownAvg <> 0 then RSIv = 100*UpAvg/(UpAvg + DownAvg); Else RSIv = 0; if RSIv > RSIv[1] then plot1(RSIv, "rsi",red); Else plot1(RSIv,"rsi",blue); 아래의 지표식2는 macd가 0선을 돌파할때 수직선이 나오게하는 수식입니다. == 지표식2 == input : shortperiod(12),longperiod(26),period(9); var1 =MACD(shortperiod,longperiod); var2 = 0; if crossup(var1,var2) then plot1(999999999,"1",red); if corssdown(var1,var2) then plot1(999999999,"1",blue); 지표식1의 RSIv를 지표식2 처럼 50을 돌파할때 수직선이 나오게 지표식을 부탁드립니다.
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2014-02-14 12:48:43

안녕하세요 예스스탁입니다. 해당 식으로 차트에 수직선을 그리려면 지표속성과 기본차트속성에서 몇가지 옵션을 설정하셔야 합니다. 아래 순서대로 설정하시고 사용하시면 됩니다. 1-1. 아래의 식을 지표식으로 만든신후 1-2. 문법검증(f4) 후에 바로 f5키를 누르시면 지표속성화면이 나오게 됩니다. 지표속성화면의 차트표시탭에서 막대그래프로 설정하시고 굵기는 자동으로 하시고 색등을 지정하신 후에 지표속성화면의 Y축 표시탭에서 Y축을 가격으로 설정하시고 확인. 1-3. 차트의 기본차트속성화면에서 Y축을 화면(기본차트)로 설정하고 1-4. 해당 지표를 적용하시면 됩니다. 수식 inputs: Length(7),기간(5); Variables: Counter(0),DownAmt(0),UpAmt(0),UpSum(0),DownSum(0),UpAvg(0),DownAvg(0),RSIv(0); if CurrentBar == 1 and length >0 then begin UpSum = 0; DownSum = 0; For Counter = 0 To Length - 1 begin UpAmt = ma(c,기간)[Counter] - ma(c,기간)[Counter +1]; if UpAmt >= 0 then DownAmt = 0; Else begin DownAmt = -UpAmt; UpAmt = 0; End; UpSum = UpSum + UpAmt; DownSum = DownSum + DownAmt; End; UpAvg = UpSum/Length; DownAvg = DownSum/Length; End Else if CurrentBar > 1 and Length >0 then begin UpAmt = ma(c,기간)[0] - ma(c,기간)[1]; if UpAmt >= 0 then DownAmt = 0; Else Begin DownAmt = -UpAmt; UpAmt = 0; End; UpAvg = (UpAvg[1] * (Length - 1) + UpAmt)/Length; DownAvg = (DownAvg[1] * (Length - 1) + DownAmt)/Length; End; if UpAvg + DownAvg <> 0 then RSIv = 100*UpAvg/(UpAvg + DownAvg); Else RSIv = 0; if crossup(RSIv,50) then plot1(999999999,"수직선",red); if crossdown(RSIv,50) then plot1(999999999,"수직선",blue); 즐거운 하루되세요 > WT_su***** 님이 쓴 글입니다. > 제목 : 지표식 부탁드립니다. > 아래의 지표식 1은 rsi수식을 풀어서 종가대신 (예를 들어) 5이평을 넣은것입니다. == 지표식1 == inputs: Length(7),기간(5); Variables: Counter(0),DownAmt(0),UpAmt(0),UpSum(0),DownSum(0),UpAvg(0),DownAvg(0),RSIv(0); if CurrentBar == 1 and length >0 then begin UpSum = 0; DownSum = 0; For Counter = 0 To Length - 1 begin UpAmt = ma(c,기간)[Counter] - ma(c,기간)[Counter +1]; if UpAmt >= 0 then DownAmt = 0; Else begin DownAmt = -UpAmt; UpAmt = 0; End; UpSum = UpSum + UpAmt; DownSum = DownSum + DownAmt; End; UpAvg = UpSum/Length; DownAvg = DownSum/Length; End Else if CurrentBar > 1 and Length >0 then begin UpAamt = ma(c,기간)[0] - ma(c,기간)[1]; if UpAmt >= 0 then DownAmt = 0; Else Begin DownAmt = -UpAmt; UpAmt = 0; End; UpAvg = (UpAvg[1] * (Length - 1) + UpAmt)/Length; DownAvg = (DownAvg[1] * (Length - 1) + DownAmt)/Length; End; if UpAvg + DownAvg <> 0 then RSIv = 100*UpAvg/(UpAvg + DownAvg); Else RSIv = 0; if RSIv > RSIv[1] then plot1(RSIv, "rsi",red); Else plot1(RSIv,"rsi",blue); 아래의 지표식2는 macd가 0선을 돌파할때 수직선이 나오게하는 수식입니다. == 지표식2 == input : shortperiod(12),longperiod(26),period(9); var1 =MACD(shortperiod,longperiod); var2 = 0; if crossup(var1,var2) then plot1(999999999,"1",red); if corssdown(var1,var2) then plot1(999999999,"1",blue); 지표식1의 RSIv를 지표식2 처럼 50을 돌파할때 수직선이 나오게 지표식을 부탁드립니다.