커뮤니티

수식 의뢰드립니다!

프로필 이미지
qha71
2021-09-08 09:36:32
742
글번호 152069
답변완료
안녕하세요! 아래 파라볼릭수식의 양전환과 음전환시 종가를 사용하여 바탕색을 넣고 싶습니다! 당일 장이 열리면 전일 장과 파라볼릭이 연결되지 않은 새로운 장으로 바탕색이 나타나도록 부탁드립니다! 항상 감사합니다! 참고 그림 첨부합니다! 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 Bdate != Bdate[1] Then { Direction = 0; SAR_Value = Close; AF_Value = 0.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 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); } } Plot1(CSarv,"파라볼릭종가",iff(C>CSarv,RED,BLUE)); ---------------------------------------------------------- 아래 수식은 당일 고저가 진폭을 나타내는 수식입니다! 지난번처럼 제 임의로 간격이 당일 고가에서 위로, 당일 저가에서 아래로 간격을 조정할 수 있도록 부탁드립니다! if Bdate != Bdate[1] Then Condition1 = False; if Condition1 == False and DayHigh >= daylow+1 then { Condition1 = true; var1 = Text_New(sdate,stime,DayHigh,"당일고가 : "+NumToStr(DayHigh,2)+" 진폭 : "+NumToStr(DayHigh-daylow,2)); var2 = Text_New(sdate,stime,Daylow,"당일저가 : "+NumToStr(Daylow,2)+" 진폭 : "+NumToStr(DayHigh-daylow,2)); } if Condition1 == true Then { Text_SetString(var1,NumToStr(DayHigh,2)+" 진폭 : "+NumToStr(DayHigh-daylow,2)); Text_SetString(var2,NumToStr(Daylow,2)+" 진폭 : "+NumToStr(DayHigh-daylow,2)); Text_SetLocation(var1,sDate,sTime,DayHigh); Text_SetLocation(var2,sDate,sTime,DayLow); plot1(DayHigh); plot2(daylow); plot3((DayHigh)-0.65); plot4((daylow)+0.65); } Else { NoPlot(1); NoPlot(2); }
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-09-07 11:15:38

안녕하세요 예스스탁입니다. 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 Bdate != Bdate[1] Then { Direction = 0; SAR_Value = Close; AF_Value = 0.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 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); } } Plot1(C,"종가"); Plot2(CSarv,"파라볼릭종가",iff(C>CSarv,RED,BLUE)); 2 input : 간격(0.65); if Bdate != Bdate[1] Then Condition1 = False; if Condition1 == False and DayHigh >= daylow+1 then { Condition1 = true; var1 = Text_New(sdate,stime,DayHigh,"당일고가 : "+NumToStr(DayHigh,2)+" 진폭 : "+NumToStr(DayHigh-daylow,2)); var2 = Text_New(sdate,stime,Daylow,"당일저가 : "+NumToStr(Daylow,2)+" 진폭 : "+NumToStr(DayHigh-daylow,2)); } if Condition1 == true Then { Text_SetString(var1,NumToStr(DayHigh,2)+" 진폭 : "+NumToStr(DayHigh-daylow,2)); Text_SetString(var2,NumToStr(Daylow,2)+" 진폭 : "+NumToStr(DayHigh-daylow,2)); Text_SetLocation(var1,sDate,sTime,DayHigh); Text_SetLocation(var2,sDate,sTime,DayLow); plot1(DayHigh); plot2(daylow); plot3((DayHigh)-간격); plot4((daylow)+간격); } Else { NoPlot(1); NoPlot(2); } 즐거운 하루되세요 > qha71 님이 쓴 글입니다. > 제목 : 수식 의뢰드립니다! > 안녕하세요! 아래 파라볼릭수식의 양전환과 음전환시 종가를 사용하여 바탕색을 넣고 싶습니다! 당일 장이 열리면 전일 장과 파라볼릭이 연결되지 않은 새로운 장으로 바탕색이 나타나도록 부탁드립니다! 항상 감사합니다! 참고 그림 첨부합니다! 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 Bdate != Bdate[1] Then { Direction = 0; SAR_Value = Close; AF_Value = 0.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 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); } } Plot1(CSarv,"파라볼릭종가",iff(C>CSarv,RED,BLUE)); ---------------------------------------------------------- 아래 수식은 당일 고저가 진폭을 나타내는 수식입니다! 지난번처럼 제 임의로 간격이 당일 고가에서 위로, 당일 저가에서 아래로 간격을 조정할 수 있도록 부탁드립니다! if Bdate != Bdate[1] Then Condition1 = False; if Condition1 == False and DayHigh >= daylow+1 then { Condition1 = true; var1 = Text_New(sdate,stime,DayHigh,"당일고가 : "+NumToStr(DayHigh,2)+" 진폭 : "+NumToStr(DayHigh-daylow,2)); var2 = Text_New(sdate,stime,Daylow,"당일저가 : "+NumToStr(Daylow,2)+" 진폭 : "+NumToStr(DayHigh-daylow,2)); } if Condition1 == true Then { Text_SetString(var1,NumToStr(DayHigh,2)+" 진폭 : "+NumToStr(DayHigh-daylow,2)); Text_SetString(var2,NumToStr(Daylow,2)+" 진폭 : "+NumToStr(DayHigh-daylow,2)); Text_SetLocation(var1,sDate,sTime,DayHigh); Text_SetLocation(var2,sDate,sTime,DayLow); plot1(DayHigh); plot2(daylow); plot3((DayHigh)-0.65); plot4((daylow)+0.65); } Else { NoPlot(1); NoPlot(2); }