커뮤니티

수정부탁드립니다

프로필 이미지
외국인
2022-12-21 22:03:13
1324
글번호 164782
답변완료
강조식 부탁드립니다. input : i_lenHARSI(14),i_smoothing(7),i_lenRSI(7); var : i_colUp(0),i_colDown(0),i_colWick(0),i_source(0); var : _closeRSI(0),_openRSI(0),_highRSI_raw(0),_lowRSI_raw(0); var : _highRSI(0),_lowRSI(0),_close(0),_open(0),_high(0),_low(0); Var : cnt(0), DownAmt1(0), UpAmt1(0), UpSum1(0), DownSum1(0), UpAvg1(0), DownAvg1(0),RSIV1(0); Var : DownAmt2(0), UpAmt2(0), UpSum2(0), DownSum2(0), UpAvg2(0), DownAvg2(0),RSIV2(0); var : bodyColour(0),wickColour(0); i_colUp = red; i_colDown = teal; i_colWick = gray; i_source = (o+h+l+c)/4; _closeRSI = rsi(i_lenHARSI)-50; _openRSI = IFF(IsNaN(_closeRSI[1]) == False, _closeRSI[1], _closeRSI); If CurrentBar == 1 AND i_lenHARSI > 0 Then Begin UpSum1 = 0; DownSum1 = 0; For cnt = 0 To i_lenHARSI - 1 Begin UpAmt1 = H[cnt] - H[cnt+1]; If UpAmt1 >= 0 Then DownAmt1 = 0; Else Begin DownAmt1 = -UpAmt1; UpAmt1 = 0; End; UpSum1 = UpSum1 + UpAmt1; DownSum1 = DownSum1 + DownAmt1; End; UpAvg1 = UpSum1 / i_lenHARSI; DownAvg1 = DownSum1 / i_lenHARSI; End Else If CurrentBar > 1 AND i_lenHARSI > 0 Then Begin UpAmt1 = H[0] - H[1]; If UpAmt1 >= 0 Then DownAmt1 = 0; Else Begin DownAmt1 = -UpAmt1; UpAmt1 = 0; End; UpAvg1 = (UpAvg1[1] * (i_lenHARSI - 1) + UpAmt1) / i_lenHARSI; DownAvg1 = (DownAvg1[1] * (i_lenHARSI - 1) + DownAmt1) / i_lenHARSI; End; If UpAvg1 + DownAvg1 <> 0 Then RSIV1 = 100 * UpAvg1 / (UpAvg1 + DownAvg1); Else RSIV1 = 0; If CurrentBar == 1 AND i_lenHARSI > 0 Then Begin UpSum2 = 0; DownSum2 = 0; For cnt = 0 To i_lenHARSI - 1 Begin UpAmt2 = L[cnt] - L[cnt+1]; If UpAmt2 >= 0 Then DownAmt2 = 0; Else Begin DownAmt2 = -UpAmt2; UpAmt2 = 0; End; UpSum2 = UpSum2 + UpAmt2; DownSum2 = DownSum2 + DownAmt2; End; UpAvg2 = UpSum2 / i_lenHARSI; DownAvg2 = DownSum2 / i_lenHARSI; End Else If CurrentBar > 2 AND i_lenHARSI > 0 Then Begin UpAmt2 = L[0] - L[1]; If UpAmt2 >= 0 Then DownAmt2 = 0; Else Begin DownAmt2 = -UpAmt2; UpAmt2 = 0; End; UpAvg2 = (UpAvg2[1] * (i_lenHARSI - 1) + UpAmt2) / i_lenHARSI; DownAvg2 = (DownAvg2[1] * (i_lenHARSI - 1) + DownAmt2) / i_lenHARSI; End; If UpAvg2 + DownAvg2 <> 0 Then RSIV2 = 100 * UpAvg2 / (UpAvg2 + DownAvg2); Else RSIV2 = 0; _highRSI_raw = RSIV1-50; _lowRSI_raw = RSIV2-50; _highRSI = max(_highRSI_raw, _lowRSI_raw); _lowRSI = min(_highRSI_raw, _lowRSI_raw); _close = (_openRSI + _highRSI + _lowRSI + _closeRSI) / 4; _open = iff(isnan(_open[i_smoothing]) == true, (_openRSI + _closeRSI) / 2 , (_open[1] * i_smoothing + _close[1]) / (i_smoothing + 1)); _high = max(_highRSI, max(_open, _close)); _low = min(_lowRSI, min(_open, _close)); bodyColour = iff(_close > _open , i_colUp , i_colDown); wickColour = i_colWick; var1 = TL_New_Self(sDate,sTime,_open,sDate,sTime,_close); var2 = TL_New_Self(sDate,sTime,_high,sDate,sTime,max(_open,_close)); var3 = TL_New_Self(sDate,sTime,_Low,sDate,sTime,min(_open,_close)); TL_SetColor(var1,bodyColour); TL_SetColor(var2,i_colWick); TL_SetColor(var2,i_colWick); TL_SetSize(var1,3); TL_SetSize(var2,1); TL_SetSize(var3,1);
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2022-12-22 11:17:47

안녕하세요 예스스탁입니다. 올리신 수식 내용으로는 강조식 작성이 가능하지 않습니다. 강조식은 봉차트 위에만 적용이 됩니다. 올리신 수식에서 계산되는 시고저종가는 0을 기준으로 하는 +-값입니다. 강조식으로 기본차트 위에 표시를 하지 못하는 내용이므로 추세선으로 봉과 같이 표시한 식입니다. 수식에 plot으로 지정된 값이 없어 표시가 Y축 스케일 문제로 표시가 원활하지 않으시면 1번수식과 같이 기준선 0을 추가해서 보셔야 합니다. 만약 해당식의 몸통과 같은 색상으로 봉의 색상을 변경해서 표시하고자 하시면 2번식을 사용하셔야 합니다. 추세선은 기본차트와 Y축스케일이 다른내용이라 제거하고 강조만 표시되게 해야 합니다. 1번 input : i_lenHARSI(14),i_smoothing(7),i_lenRSI(7); var : i_colUp(0),i_colDown(0),i_colWick(0),i_source(0); var : _closeRSI(0),_openRSI(0),_highRSI_raw(0),_lowRSI_raw(0); var : _highRSI(0),_lowRSI(0),_close(0),_open(0),_high(0),_low(0); Var : cnt(0), DownAmt1(0), UpAmt1(0), UpSum1(0), DownSum1(0), UpAvg1(0), DownAvg1(0),RSIV1(0); Var : DownAmt2(0), UpAmt2(0), UpSum2(0), DownSum2(0), UpAvg2(0), DownAvg2(0),RSIV2(0); var : bodyColour(0),wickColour(0); i_colUp = red; i_colDown = teal; i_colWick = gray; i_source = (o+h+l+c)/4; _closeRSI = rsi(i_lenHARSI)-50; _openRSI = IFF(IsNaN(_closeRSI[1]) == False, _closeRSI[1], _closeRSI); If CurrentBar == 1 AND i_lenHARSI > 0 Then Begin UpSum1 = 0; DownSum1 = 0; For cnt = 0 To i_lenHARSI - 1 Begin UpAmt1 = H[cnt] - H[cnt+1]; If UpAmt1 >= 0 Then DownAmt1 = 0; Else Begin DownAmt1 = -UpAmt1; UpAmt1 = 0; End; UpSum1 = UpSum1 + UpAmt1; DownSum1 = DownSum1 + DownAmt1; End; UpAvg1 = UpSum1 / i_lenHARSI; DownAvg1 = DownSum1 / i_lenHARSI; End Else If CurrentBar > 1 AND i_lenHARSI > 0 Then Begin UpAmt1 = H[0] - H[1]; If UpAmt1 >= 0 Then DownAmt1 = 0; Else Begin DownAmt1 = -UpAmt1; UpAmt1 = 0; End; UpAvg1 = (UpAvg1[1] * (i_lenHARSI - 1) + UpAmt1) / i_lenHARSI; DownAvg1 = (DownAvg1[1] * (i_lenHARSI - 1) + DownAmt1) / i_lenHARSI; End; If UpAvg1 + DownAvg1 <> 0 Then RSIV1 = 100 * UpAvg1 / (UpAvg1 + DownAvg1); Else RSIV1 = 0; If CurrentBar == 1 AND i_lenHARSI > 0 Then Begin UpSum2 = 0; DownSum2 = 0; For cnt = 0 To i_lenHARSI - 1 Begin UpAmt2 = L[cnt] - L[cnt+1]; If UpAmt2 >= 0 Then DownAmt2 = 0; Else Begin DownAmt2 = -UpAmt2; UpAmt2 = 0; End; UpSum2 = UpSum2 + UpAmt2; DownSum2 = DownSum2 + DownAmt2; End; UpAvg2 = UpSum2 / i_lenHARSI; DownAvg2 = DownSum2 / i_lenHARSI; End Else If CurrentBar > 2 AND i_lenHARSI > 0 Then Begin UpAmt2 = L[0] - L[1]; If UpAmt2 >= 0 Then DownAmt2 = 0; Else Begin DownAmt2 = -UpAmt2; UpAmt2 = 0; End; UpAvg2 = (UpAvg2[1] * (i_lenHARSI - 1) + UpAmt2) / i_lenHARSI; DownAvg2 = (DownAvg2[1] * (i_lenHARSI - 1) + DownAmt2) / i_lenHARSI; End; If UpAvg2 + DownAvg2 <> 0 Then RSIV2 = 100 * UpAvg2 / (UpAvg2 + DownAvg2); Else RSIV2 = 0; _highRSI_raw = RSIV1-50; _lowRSI_raw = RSIV2-50; _highRSI = max(_highRSI_raw, _lowRSI_raw); _lowRSI = min(_highRSI_raw, _lowRSI_raw); _close = (_openRSI + _highRSI + _lowRSI + _closeRSI) / 4; _open = iff(isnan(_open[i_smoothing]) == true, (_openRSI + _closeRSI) / 2 , (_open[1] * i_smoothing + _close[1]) / (i_smoothing + 1)); _high = max(_highRSI, max(_open, _close)); _low = min(_lowRSI, min(_open, _close)); bodyColour = iff(_close > _open , i_colUp , i_colDown); wickColour = i_colWick; var1 = TL_New_Self(sDate,sTime,_open,sDate,sTime,_close); var2 = TL_New_Self(sDate,sTime,_high,sDate,sTime,max(_open,_close)); var3 = TL_New_Self(sDate,sTime,_Low,sDate,sTime,min(_open,_close)); TL_SetColor(var1,bodyColour); TL_SetColor(var2,i_colWick); TL_SetColor(var2,i_colWick); TL_SetSize(var1,3); TL_SetSize(var2,1); TL_SetSize(var3,1); Plot1(0); 2번 input : i_lenHARSI(14),i_smoothing(7),i_lenRSI(7); var : i_colUp(0),i_colDown(0),i_colWick(0),i_source(0); var : _closeRSI(0),_openRSI(0),_highRSI_raw(0),_lowRSI_raw(0); var : _highRSI(0),_lowRSI(0),_close(0),_open(0),_high(0),_low(0); Var : cnt(0), DownAmt1(0), UpAmt1(0), UpSum1(0), DownSum1(0), UpAvg1(0), DownAvg1(0),RSIV1(0); Var : DownAmt2(0), UpAmt2(0), UpSum2(0), DownSum2(0), UpAvg2(0), DownAvg2(0),RSIV2(0); var : bodyColour(0),wickColour(0); i_colUp = red; i_colDown = teal; i_colWick = gray; i_source = (o+h+l+c)/4; _closeRSI = rsi(i_lenHARSI)-50; _openRSI = IFF(IsNaN(_closeRSI[1]) == False, _closeRSI[1], _closeRSI); If CurrentBar == 1 AND i_lenHARSI > 0 Then Begin UpSum1 = 0; DownSum1 = 0; For cnt = 0 To i_lenHARSI - 1 Begin UpAmt1 = H[cnt] - H[cnt+1]; If UpAmt1 >= 0 Then DownAmt1 = 0; Else Begin DownAmt1 = -UpAmt1; UpAmt1 = 0; End; UpSum1 = UpSum1 + UpAmt1; DownSum1 = DownSum1 + DownAmt1; End; UpAvg1 = UpSum1 / i_lenHARSI; DownAvg1 = DownSum1 / i_lenHARSI; End Else If CurrentBar > 1 AND i_lenHARSI > 0 Then Begin UpAmt1 = H[0] - H[1]; If UpAmt1 >= 0 Then DownAmt1 = 0; Else Begin DownAmt1 = -UpAmt1; UpAmt1 = 0; End; UpAvg1 = (UpAvg1[1] * (i_lenHARSI - 1) + UpAmt1) / i_lenHARSI; DownAvg1 = (DownAvg1[1] * (i_lenHARSI - 1) + DownAmt1) / i_lenHARSI; End; If UpAvg1 + DownAvg1 <> 0 Then RSIV1 = 100 * UpAvg1 / (UpAvg1 + DownAvg1); Else RSIV1 = 0; If CurrentBar == 1 AND i_lenHARSI > 0 Then Begin UpSum2 = 0; DownSum2 = 0; For cnt = 0 To i_lenHARSI - 1 Begin UpAmt2 = L[cnt] - L[cnt+1]; If UpAmt2 >= 0 Then DownAmt2 = 0; Else Begin DownAmt2 = -UpAmt2; UpAmt2 = 0; End; UpSum2 = UpSum2 + UpAmt2; DownSum2 = DownSum2 + DownAmt2; End; UpAvg2 = UpSum2 / i_lenHARSI; DownAvg2 = DownSum2 / i_lenHARSI; End Else If CurrentBar > 2 AND i_lenHARSI > 0 Then Begin UpAmt2 = L[0] - L[1]; If UpAmt2 >= 0 Then DownAmt2 = 0; Else Begin DownAmt2 = -UpAmt2; UpAmt2 = 0; End; UpAvg2 = (UpAvg2[1] * (i_lenHARSI - 1) + UpAmt2) / i_lenHARSI; DownAvg2 = (DownAvg2[1] * (i_lenHARSI - 1) + DownAmt2) / i_lenHARSI; End; If UpAvg2 + DownAvg2 <> 0 Then RSIV2 = 100 * UpAvg2 / (UpAvg2 + DownAvg2); Else RSIV2 = 0; _highRSI_raw = RSIV1-50; _lowRSI_raw = RSIV2-50; _highRSI = max(_highRSI_raw, _lowRSI_raw); _lowRSI = min(_highRSI_raw, _lowRSI_raw); _close = (_openRSI + _highRSI + _lowRSI + _closeRSI) / 4; _open = iff(isnan(_open[i_smoothing]) == true, (_openRSI + _closeRSI) / 2 , (_open[1] * i_smoothing + _close[1]) / (i_smoothing + 1)); _high = max(_highRSI, max(_open, _close)); _low = min(_lowRSI, min(_open, _close)); bodyColour = iff(_close > _open , i_colUp , i_colDown); wickColour = i_colWick; PlotPaintBar(H,L,"강조",bodyColour); 즐거운 하루되세요 > 외국인 님이 쓴 글입니다. > 제목 : 수정부탁드립니다 > 강조식 부탁드립니다. input : i_lenHARSI(14),i_smoothing(7),i_lenRSI(7); var : i_colUp(0),i_colDown(0),i_colWick(0),i_source(0); var : _closeRSI(0),_openRSI(0),_highRSI_raw(0),_lowRSI_raw(0); var : _highRSI(0),_lowRSI(0),_close(0),_open(0),_high(0),_low(0); Var : cnt(0), DownAmt1(0), UpAmt1(0), UpSum1(0), DownSum1(0), UpAvg1(0), DownAvg1(0),RSIV1(0); Var : DownAmt2(0), UpAmt2(0), UpSum2(0), DownSum2(0), UpAvg2(0), DownAvg2(0),RSIV2(0); var : bodyColour(0),wickColour(0); i_colUp = red; i_colDown = teal; i_colWick = gray; i_source = (o+h+l+c)/4; _closeRSI = rsi(i_lenHARSI)-50; _openRSI = IFF(IsNaN(_closeRSI[1]) == False, _closeRSI[1], _closeRSI); If CurrentBar == 1 AND i_lenHARSI > 0 Then Begin UpSum1 = 0; DownSum1 = 0; For cnt = 0 To i_lenHARSI - 1 Begin UpAmt1 = H[cnt] - H[cnt+1]; If UpAmt1 >= 0 Then DownAmt1 = 0; Else Begin DownAmt1 = -UpAmt1; UpAmt1 = 0; End; UpSum1 = UpSum1 + UpAmt1; DownSum1 = DownSum1 + DownAmt1; End; UpAvg1 = UpSum1 / i_lenHARSI; DownAvg1 = DownSum1 / i_lenHARSI; End Else If CurrentBar > 1 AND i_lenHARSI > 0 Then Begin UpAmt1 = H[0] - H[1]; If UpAmt1 >= 0 Then DownAmt1 = 0; Else Begin DownAmt1 = -UpAmt1; UpAmt1 = 0; End; UpAvg1 = (UpAvg1[1] * (i_lenHARSI - 1) + UpAmt1) / i_lenHARSI; DownAvg1 = (DownAvg1[1] * (i_lenHARSI - 1) + DownAmt1) / i_lenHARSI; End; If UpAvg1 + DownAvg1 <> 0 Then RSIV1 = 100 * UpAvg1 / (UpAvg1 + DownAvg1); Else RSIV1 = 0; If CurrentBar == 1 AND i_lenHARSI > 0 Then Begin UpSum2 = 0; DownSum2 = 0; For cnt = 0 To i_lenHARSI - 1 Begin UpAmt2 = L[cnt] - L[cnt+1]; If UpAmt2 >= 0 Then DownAmt2 = 0; Else Begin DownAmt2 = -UpAmt2; UpAmt2 = 0; End; UpSum2 = UpSum2 + UpAmt2; DownSum2 = DownSum2 + DownAmt2; End; UpAvg2 = UpSum2 / i_lenHARSI; DownAvg2 = DownSum2 / i_lenHARSI; End Else If CurrentBar > 2 AND i_lenHARSI > 0 Then Begin UpAmt2 = L[0] - L[1]; If UpAmt2 >= 0 Then DownAmt2 = 0; Else Begin DownAmt2 = -UpAmt2; UpAmt2 = 0; End; UpAvg2 = (UpAvg2[1] * (i_lenHARSI - 1) + UpAmt2) / i_lenHARSI; DownAvg2 = (DownAvg2[1] * (i_lenHARSI - 1) + DownAmt2) / i_lenHARSI; End; If UpAvg2 + DownAvg2 <> 0 Then RSIV2 = 100 * UpAvg2 / (UpAvg2 + DownAvg2); Else RSIV2 = 0; _highRSI_raw = RSIV1-50; _lowRSI_raw = RSIV2-50; _highRSI = max(_highRSI_raw, _lowRSI_raw); _lowRSI = min(_highRSI_raw, _lowRSI_raw); _close = (_openRSI + _highRSI + _lowRSI + _closeRSI) / 4; _open = iff(isnan(_open[i_smoothing]) == true, (_openRSI + _closeRSI) / 2 , (_open[1] * i_smoothing + _close[1]) / (i_smoothing + 1)); _high = max(_highRSI, max(_open, _close)); _low = min(_lowRSI, min(_open, _close)); bodyColour = iff(_close > _open , i_colUp , i_colDown); wickColour = i_colWick; var1 = TL_New_Self(sDate,sTime,_open,sDate,sTime,_close); var2 = TL_New_Self(sDate,sTime,_high,sDate,sTime,max(_open,_close)); var3 = TL_New_Self(sDate,sTime,_Low,sDate,sTime,min(_open,_close)); TL_SetColor(var1,bodyColour); TL_SetColor(var2,i_colWick); TL_SetColor(var2,i_colWick); TL_SetSize(var1,3); TL_SetSize(var2,1); TL_SetSize(var3,1);