커뮤니티

문의 드립니다

프로필 이미지
dkfvkrh7
2023-01-17 15:52:41
594
글번호 165516
답변완료
수고하십니다 아래 사항에 대해 문의드리겠습니다 ㅇ차트조건 : d1,d2,d3 모두 당일자 자료만 적용합니다 (전일자 연결하지 않습니다) - 아래 서식이 가끔 실행되는 때도 있지만 ㅇ문의점 : 대부분은 잔량차파파볼릭 선이 잔량차 선을 따라가지 않고 정 반대로 휘어져 나가서 장초반 최초 교차 이후에는 하루 내내 전혀 교차하지 않습니다 잘못된 부분 수정 부탁드립니다 감사합니다 Input : AF(0.01), AFMAX(0.09),period(0),p(0); var : Diff(0), mav(0); Diff = (Data2(c)+Data3(c)); mav = ma(Diff,P); Var : Direction(0), SAR_Value(Diff), AF_Value(.02), HighValue(Diff), LowValue(Diff), EP(0),CSARV(0); if Diff == 0 Then Diff = Diff[1]; if EP != 0 Then { if Direction == 1 then { EP = HighValue; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if Diff > HighValue then { HighValue = Diff; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } if Diff < SAR_Value then { Direction = -1; SAR_Value = EP; AF_Value = 0; EP = 0; LowValue = Diff ; } } else { EP = LowValue; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if Diff < LowValue then { LowValue = Diff; AF_Value = AF_Value + Af; if AF_Value >= AFMAX then AF_Value = AFMAX; } if Diff > SAR_Value then { Direction = 1; SAR_Value = EP; AF_Value = 0; EP = 0; HighValue = Diff; } } CSarv = SAR_Value; } else { if SAR_Value != 0 && EP == 0 then { if Direction == 1 then { EP = HighValue; AF_Value = AF; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if Diff > HighValue then { HighValue = Diff; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } } else { EP = LowValue; AF_Value = Af; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if Diff < LowValue then { LowValue = Diff; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } } CSarv = SAR_Value; } else { if Direction == 0 then { if Diff > Diff[1] then Direction = 1; else if Diff < Diff[1] then Direction = -1; } else { if Direction == 1 then { if Diff < Diff[1] then { Direction = -1; SAR_Value = HighValue; CSarv = SAR_Value; } } if Direction == -1 then { if Diff > Diff[1] then { Direction = 1; SAR_Value = LowValue; CSarv = SAR_Value; } } } LowValue = min(Diff, LowValue); HighValue = max(Diff, HighValue); } } plot1(diff,"잔량차"); plot2(CSARv,"잔량차파라볼릭"); //속성에서 점그래프
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2023-01-18 11:42:12

안녕하세요 예스스탁입니다. 수식에 크게 수정해 드릴 부분은 없습니다. 다만 참조데이타를 이용할 경우 각 내부변수가 어떤 데이타를 기준으로 저장되고 이전값 참조를 하는지 지정하기 위해 데이타번호를 지정해 주셔야 합니다. 첨부된 그림과 같이 크게 차이는 없고 일부봉에서 차이가 조금 발생합니다. Input : AF(0.01), AFMAX(0.09),period(0),p(0); var : Diff(0,Data2), mav(0,Data2); Var : Direction(0,Data2), SAR_Value(Diff,Data2), AF_Value(.02,Data2), HighValue(Diff,Data2), LowValue(Diff,Data2), EP(0,Data2); var : Csarv(0,Data2); Diff = (Data2(c)+Data3(c)); mav = ma(Diff,P); if EP != 0 Then { if Direction == 1 then { EP = HighValue; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if Diff > HighValue then { HighValue = Diff; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } if Diff < SAR_Value then { Direction = -1; SAR_Value = EP; AF_Value = 0; EP = 0; LowValue = Diff; } } else { EP = LowValue; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if Diff < LowValue then { LowValue = Diff; AF_Value = AF_Value + Af; if AF_Value >= AFMAX then AF_Value = AFMAX; } if Diff > SAR_Value then { Direction = 1; SAR_Value = EP; AF_Value = 0; EP = 0; HighValue = Diff; } } CSarv = SAR_Value; } else { if SAR_Value != 0 && EP == 0 then { if Direction == 1 then { EP = HighValue; AF_Value = AF; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if Diff > HighValue then { HighValue = Diff; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } } else { EP = LowValue; AF_Value = Af; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if diff < LowValue then { LowValue = diff; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } } CSarv = SAR_Value; } else { if Direction == 0 then { if Diff > Diff[1] then Direction = 1; else if Diff < Diff[1] then Direction = -1; } else { if Direction == 1 then { if Diff < Diff[1] then { Direction = -1; SAR_Value = HighValue; CSarv = SAR_Value; } } if Direction == -1 then { if Diff > Diff[1] then { Direction = 1; SAR_Value = LowValue; CSarv = SAR_Value; } } } LowValue = min(Diff, LowValue); HighValue = max(Diff, HighValue); } } plot1(diff,"잔량차"); plot2(CSARv,"잔량차파라볼릭",iff(diff>CSaRV,Red,Blue)); //속성에서 점그래프 즐거운 하루되세요 > dkfvkrh7 님이 쓴 글입니다. > 제목 : 문의 드립니다 > 수고하십니다 아래 사항에 대해 문의드리겠습니다 ㅇ차트조건 : d1,d2,d3 모두 당일자 자료만 적용합니다 (전일자 연결하지 않습니다) - 아래 서식이 가끔 실행되는 때도 있지만 ㅇ문의점 : 대부분은 잔량차파파볼릭 선이 잔량차 선을 따라가지 않고 정 반대로 휘어져 나가서 장초반 최초 교차 이후에는 하루 내내 전혀 교차하지 않습니다 잘못된 부분 수정 부탁드립니다 감사합니다 Input : AF(0.01), AFMAX(0.09),period(0),p(0); var : Diff(0), mav(0); Diff = (Data2(c)+Data3(c)); mav = ma(Diff,P); Var : Direction(0), SAR_Value(Diff), AF_Value(.02), HighValue(Diff), LowValue(Diff), EP(0),CSARV(0); if Diff == 0 Then Diff = Diff[1]; if EP != 0 Then { if Direction == 1 then { EP = HighValue; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if Diff > HighValue then { HighValue = Diff; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } if Diff < SAR_Value then { Direction = -1; SAR_Value = EP; AF_Value = 0; EP = 0; LowValue = Diff ; } } else { EP = LowValue; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if Diff < LowValue then { LowValue = Diff; AF_Value = AF_Value + Af; if AF_Value >= AFMAX then AF_Value = AFMAX; } if Diff > SAR_Value then { Direction = 1; SAR_Value = EP; AF_Value = 0; EP = 0; HighValue = Diff; } } CSarv = SAR_Value; } else { if SAR_Value != 0 && EP == 0 then { if Direction == 1 then { EP = HighValue; AF_Value = AF; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if Diff > HighValue then { HighValue = Diff; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } } else { EP = LowValue; AF_Value = Af; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if Diff < LowValue then { LowValue = Diff; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } } CSarv = SAR_Value; } else { if Direction == 0 then { if Diff > Diff[1] then Direction = 1; else if Diff < Diff[1] then Direction = -1; } else { if Direction == 1 then { if Diff < Diff[1] then { Direction = -1; SAR_Value = HighValue; CSarv = SAR_Value; } } if Direction == -1 then { if Diff > Diff[1] then { Direction = 1; SAR_Value = LowValue; CSarv = SAR_Value; } } } LowValue = min(Diff, LowValue); HighValue = max(Diff, HighValue); } } plot1(diff,"잔량차"); plot2(CSARv,"잔량차파라볼릭"); //속성에서 점그래프