커뮤니티

설명 좀부탁드립니다.

프로필 이미지
fill
2015-04-25 00:28:29
288
글번호 85385
답변완료
안녕하십니까? 파라볼릭 수식을 옆에 설명 달아 주시면 감사 하겠습니다. /* Description : Parabolic (S)top (A)nd (R)eversal * * Provided By : YesStock Inc. (c) Copyright 2006 * E-Mail : webmaster@yesstock.com */ Input : AF(NumericSimple), AFMAX(NumericSimple); Var : Direction(0), SAR_Value(Close), AF_Value(.02), HighValue(High), LowValue(Low), 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 Low < 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 High > SAR_Value then { Direction = 1; SAR_Value = EP; AF_Value = 0; EP = 0; HighValue = High; } } Sar = 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; } } Sar = 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; Sar = SAR_Value; } } if Direction == -1 then { if Close > Close[1] then { Direction = 1; SAR_Value = LowValue; Sar = SAR_Value; } } } LowValue = min(Low, LowValue); HighValue = max(High, HighValue); } }
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2015-04-27 09:30:29

안녕하세요 예스스탁입니다. Input : AF(NumericSimple), AFMAX(NumericSimple); Var : Direction(0), SAR_Value(Close), AF_Value(.02), HighValue(High), LowValue(Low), EP(0); #EP가 0이 아닐때 if EP != 0 Then { #Direction이 1일때 if Direction == 1 then { #EP에 HighValue값 저장 EP = HighValue; #현재 SAR_Value에 EP와 AR_Value의 차이값의 2%를 더함 SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); #고가가 HighValue값보다 크면 if High > HighValue then { #HighValue에 현재고가로 저장 HighValue = High; # AF_Value에 AF를 추가로 더함 AF_Value = AF_Value + AF; # AF_Value가 AFMAX값이상이면 # AF_Value에는 AFMAX값을 저장 if AF_Value >= AFMAX then AF_Value = AFMAX; } #저가가 SAR_Value미만이면 if Low < SAR_Value then { Direction = -1; #Direction에 -1저장 SAR_Value = EP; #SAR_Value 에 EP저장 AF_Value = 0; #AF_Value 는 0으로 초기화 EP = 0;#EP는 0으로 초기화 LowValue = low;#LowValue에 저가저장 } } else #Direction이 1이 아닐때 { #EP는 LowValue저장 EP = LowValue; #현재 SAR_Value에 EP와 AR_Value의 차이값의 2%를 더함 SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); #자가가 LowValue보다 작으면 if Low < LowValue then { #LowValue에는 현재 저가 저장 LowValue = Low; # AF_Value에 AF를 추가로 더함 AF_Value = AF_Value + Af; # AF_Value가 AFMAX값이상이면 # AF_Value에는 AFMAX값을 저장 if AF_Value >= AFMAX then AF_Value = AFMAX; } #고가가 SAR_Value보다 크면 if High > SAR_Value then { Direction = 1; #Direction에 1저장 SAR_Value = EP; #SAR_Value 에 EP저장 AF_Value = 0; #AF_Value 는 0으로 초기화 EP = 0;#EP는 0으로 초기화 HighValue = High;#HighValue에 고가 저장 } } #SAR에 SAR_Value값 저장 Sar = SAR_Value; } else#EP가 0일&#46468; { #SAR_Value에는 0이 아닌값이 저장되었는데 EP는 0이면 if SAR_Value != 0 && EP == 0 then { #Direction이 1이면 if Direction == 1 then { #EP에 HighValue 저장 EP = HighValue; #AF_Value에 AF저장 AF_Value = AF; #현재 SAR_Value에 EP와 AR_Value의 차이값의 2%를 더함 SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); #고가가 HighValue보다 크면 if High > HighValue then { #HighValue에 고가 저장 HighValue = High; #AF_Value에 AF만큼 값을 증가 AF_Value = AF_Value + AF; #AF_Value가 AFMAX이상이면 AF_Value는 AFMAX를 저장 if AF_Value >= AFMAX then AF_Value = AFMAX; } } else#Direction이 1이 아니면 { #EP에 LowValue저장 EP = LowValue; #AF_Value에는 aF저장 AF_Value = Af; #현재 SAR_Value에 EP와 AR_Value의 차이값의 2%를 더함 SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value); #저가가 LowValue보다 작으면 if Low < LowValue then { #LowValue에는 저가 저장 LowValue = Low; #AF_Value에 AF만큼 값을 증가 AF_Value = AF_Value + AF; #AF_Value가 AFMAX이상이면 AF_Value는 AFMAX를 저장 if AF_Value >= AFMAX then AF_Value = AFMAX; } } #sar에 SAR_Value저장 Sar = SAR_Value; } else#SAR_Value != 0 && EP == 0조건이 아니면 { #Direction이 0이면 if Direction == 0 then { #종가가 전봉대비 상스이면 1, 하락이면 -1 if Close > Close[1] then Direction = 1; else if Close < Close[1] then Direction = -1; } else #Direction이0이 아니고 { #1이면 if Direction == 1 then { #종가가 하락하면 if Close < Close[1] then { #Direction은 -1 Direction = -1; #SAR_Value에는 HighValue저장 SAR_Value = HighValue; #sar에 SAR_Value저장 Sar = SAR_Value; } } #-1이면 if Direction == -1 then { #종가가 상승하면 if Close > Close[1] then { #Direction은 1 Direction = 1; #SAR_Value에는 LowValue 저장 SAR_Value = LowValue; #sar에 SAR_Value저장 Sar = SAR_Value; } } } #LowValue에는 저가와 LowValue중 작은값 저장 LowValue = min(Low, LowValue); #HighValue에는 고가와 HighValue 중 큰값 저장 HighValue = max(High, HighValue); } } 즐거운 하루되세요 > fill 님이 쓴 글입니다. > 제목 : 설명 좀부탁드립니다. > 안녕하십니까? 파라볼릭 수식을 옆에 설명 달아 주시면 감사 하겠습니다. /* Description : Parabolic (S)top (A)nd (R)eversal * * Provided By : YesStock Inc. (c) Copyright 2006 * E-Mail : webmaster@yesstock.com */ Input : AF(NumericSimple), AFMAX(NumericSimple); Var : Direction(0), SAR_Value(Close), AF_Value(.02), HighValue(High), LowValue(Low), 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 Low < 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 High > SAR_Value then { Direction = 1; SAR_Value = EP; AF_Value = 0; EP = 0; HighValue = High; } } Sar = 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; } } Sar = 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; Sar = SAR_Value; } } if Direction == -1 then { if Close > Close[1] then { Direction = 1; SAR_Value = LowValue; Sar = SAR_Value; } } } LowValue = min(Low, LowValue); HighValue = max(High, HighValue); } }