커뮤니티

문의 드립니다.

프로필 이미지
조지1
2024-12-07 12:59:54
484
글번호 186040
답변완료
안녕하세요? 아래의 지표를 일봉/ 주봉/ 월봉에 적용시 수정 수식 부탁드립니다. 감사합니다. Input : AF(0.02), AFMAX(0.2); Var : Direction(0), SAR_Value(Close), AF_Value(.02), HighValue(High), LowValue(Low), EP(0),CSarv(0); if Index == 0 or (Bdate != Bdate[1]) Then { Direction = 0; SAR_Value = C; AF_Value = 0.02; HighValue = H; LowValue = L; EP = 0; } if EP != 0 Then { if Direction == 1 then { EP = HighValue; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if High > HighValue then { HighValue = High; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } if Close < SAR_Value then { Direction = -1; SAR_Value = EP; AF_Value = 0; EP = 0; LowValue = low; } } else { EP = LowValue; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if Low < LowValue then { LowValue = Low; AF_Value = AF_Value + Af; if AF_Value >= AFMAX then AF_Value = AFMAX; } if Close > SAR_Value then { Direction = 1; SAR_Value = EP; AF_Value = 0; EP = 0; HighValue = High; } } 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 High > HighValue then { HighValue = High; 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 Low < LowValue then { LowValue = Low; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } } CSarv = SAR_Value; } else { if Direction == 0 then { if Close > Close[1] then Direction = 1; else if Close < Close[1] then Direction = -1; } else { if Direction == 1 then { if Close < Close[1] then { Direction = -1; SAR_Value = HighValue; CSarv = SAR_Value; } } if Direction == -1 then { if Close > Close[1] then { Direction = 1; SAR_Value = LowValue; CSarv = SAR_Value; } } } LowValue = min(Low, LowValue); HighValue = max(High, HighValue); } } var : t(0),hh(0),hl(0),lh(0),ll(0); var : hh1(0),hl1(0),lh1(0),ll1(0); var : hh2(0),hl2(0),lh2(0),ll2(0); if CrossUp(C,CSarv) Then { t = 1; hh = h; hl = l; hh1 = hh[1]; hl1 = hl[1]; var1 = hh1*2-ll; Var2 = hh1; Var3 = ll; Var7 = ll*2-hh1; Var9 = CSarv; } if CrossDown(C,CSarv) Then { t = -1; lh = h; ll = l; lh1 = lh[1]; ll1 = ll[1]; var4 = ll1*2-hh; Var5 = ll1; Var6 = hh; Var8 = hh*2-ll1; Var10= CSarv; } if t == 1 Then { if h > hh Then hh = h; if l < hl Then hl = h; } if t == -1 Then { if h > lh Then lh = h; if l < ll Then ll = l; } Plot1(var1,"상승목표"); Plot2(var2,"HH1"); Plot3(var3,"LL"); Plot4(var4,"하락목표"); #녹밴 하락대칭 Plot5(var5,"LL1"); Plot6(var6,"HH"); Plot7(var7,"하락목표1"); Plot8(var8,"상승목표1"); Plot9(var1+PriceScale,"상승목표+"); Plot10(var8+PriceScale,"상승목표1+"); Plot11(var4-PriceScale,"하락목표-"); Plot12(var7-PriceScale,"하락목표1-");
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-12-09 10:30:26

안녕하세요 예스스탁입니다. 올리신 수식이 분봉이하 주기에서 당일 데이터로만 계산하게 되어 있습니다. 날짜 변경시 초기화하는 내용을 삭제해 드립니다. Input : AF(0.02), AFMAX(0.2); Var : Direction(0), SAR_Value(Close), AF_Value(.02), HighValue(High), LowValue(Low), EP(0),CSarv(0); if EP != 0 Then { if Direction == 1 then { EP = HighValue; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if High > HighValue then { HighValue = High; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } if Close < SAR_Value then { Direction = -1; SAR_Value = EP; AF_Value = 0; EP = 0; LowValue = low; } } else { EP = LowValue; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if Low < LowValue then { LowValue = Low; AF_Value = AF_Value + Af; if AF_Value >= AFMAX then AF_Value = AFMAX; } if Close > SAR_Value then { Direction = 1; SAR_Value = EP; AF_Value = 0; EP = 0; HighValue = High; } } 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 High > HighValue then { HighValue = High; 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 Low < LowValue then { LowValue = Low; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } } CSarv = SAR_Value; } else { if Direction == 0 then { if Close > Close[1] then Direction = 1; else if Close < Close[1] then Direction = -1; } else { if Direction == 1 then { if Close < Close[1] then { Direction = -1; SAR_Value = HighValue; CSarv = SAR_Value; } } if Direction == -1 then { if Close > Close[1] then { Direction = 1; SAR_Value = LowValue; CSarv = SAR_Value; } } } LowValue = min(Low, LowValue); HighValue = max(High, HighValue); } } var : t(0),hh(0),hl(0),lh(0),ll(0); var : hh1(0),hl1(0),lh1(0),ll1(0); var : hh2(0),hl2(0),lh2(0),ll2(0); if CrossUp(C,CSarv) Then { t = 1; hh = h; hl = l; hh1 = hh[1]; hl1 = hl[1]; var1 = hh1*2-ll; Var2 = hh1; Var3 = ll; Var7 = ll*2-hh1; Var9 = CSarv; } if CrossDown(C,CSarv) Then { t = -1; lh = h; ll = l; lh1 = lh[1]; ll1 = ll[1]; var4 = ll1*2-hh; Var5 = ll1; Var6 = hh; Var8 = hh*2-ll1; Var10= CSarv; } if t == 1 Then { if h > hh Then hh = h; if l < hl Then hl = h; } if t == -1 Then { if h > lh Then lh = h; if l < ll Then ll = l; } Plot1(var1,"상승목표"); Plot2(var2,"HH1"); Plot3(var3,"LL"); Plot4(var4,"하락목표"); #녹밴 하락대칭 Plot5(var5,"LL1"); Plot6(var6,"HH"); Plot7(var7,"하락목표1"); Plot8(var8,"상승목표1"); Plot9(var1+PriceScale,"상승목표+"); Plot10(var8+PriceScale,"상승목표1+"); Plot11(var4-PriceScale,"하락목표-"); Plot12(var7-PriceScale,"하락목표1-"); 즐거운 하루되세요 > 조지1 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 안녕하세요? 아래의 지표를 일봉/ 주봉/ 월봉에 적용시 수정 수식 부탁드립니다. 감사합니다. Input : AF(0.02), AFMAX(0.2); Var : Direction(0), SAR_Value(Close), AF_Value(.02), HighValue(High), LowValue(Low), EP(0),CSarv(0); if Index == 0 or (Bdate != Bdate[1]) Then { Direction = 0; SAR_Value = C; AF_Value = 0.02; HighValue = H; LowValue = L; EP = 0; } if EP != 0 Then { if Direction == 1 then { EP = HighValue; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if High > HighValue then { HighValue = High; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } if Close < SAR_Value then { Direction = -1; SAR_Value = EP; AF_Value = 0; EP = 0; LowValue = low; } } else { EP = LowValue; SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); if Low < LowValue then { LowValue = Low; AF_Value = AF_Value + Af; if AF_Value >= AFMAX then AF_Value = AFMAX; } if Close > SAR_Value then { Direction = 1; SAR_Value = EP; AF_Value = 0; EP = 0; HighValue = High; } } 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 High > HighValue then { HighValue = High; 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 Low < LowValue then { LowValue = Low; AF_Value = AF_Value + AF; if AF_Value >= AFMAX then AF_Value = AFMAX; } } CSarv = SAR_Value; } else { if Direction == 0 then { if Close > Close[1] then Direction = 1; else if Close < Close[1] then Direction = -1; } else { if Direction == 1 then { if Close < Close[1] then { Direction = -1; SAR_Value = HighValue; CSarv = SAR_Value; } } if Direction == -1 then { if Close > Close[1] then { Direction = 1; SAR_Value = LowValue; CSarv = SAR_Value; } } } LowValue = min(Low, LowValue); HighValue = max(High, HighValue); } } var : t(0),hh(0),hl(0),lh(0),ll(0); var : hh1(0),hl1(0),lh1(0),ll1(0); var : hh2(0),hl2(0),lh2(0),ll2(0); if CrossUp(C,CSarv) Then { t = 1; hh = h; hl = l; hh1 = hh[1]; hl1 = hl[1]; var1 = hh1*2-ll; Var2 = hh1; Var3 = ll; Var7 = ll*2-hh1; Var9 = CSarv; } if CrossDown(C,CSarv) Then { t = -1; lh = h; ll = l; lh1 = lh[1]; ll1 = ll[1]; var4 = ll1*2-hh; Var5 = ll1; Var6 = hh; Var8 = hh*2-ll1; Var10= CSarv; } if t == 1 Then { if h > hh Then hh = h; if l < hl Then hl = h; } if t == -1 Then { if h > lh Then lh = h; if l < ll Then ll = l; } Plot1(var1,"상승목표"); Plot2(var2,"HH1"); Plot3(var3,"LL"); Plot4(var4,"하락목표"); #녹밴 하락대칭 Plot5(var5,"LL1"); Plot6(var6,"HH"); Plot7(var7,"하락목표1"); Plot8(var8,"상승목표1"); Plot9(var1+PriceScale,"상승목표+"); Plot10(var8+PriceScale,"상승목표1+"); Plot11(var4-PriceScale,"하락목표-"); Plot12(var7-PriceScale,"하락목표1-");