Input : AF(0.02), AFMAX(0.2),pt(1);
Var : Direction(0), SAR_Value(Close), AF_Value(.02), HighValue(High), LowValue(Low), EP(0),CSarv(0);
var : box(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);
}
}
if Bdate != Bdate[1] Then
Condition1 = False;
if CrossUp(c,CSarv) Then
Condition1 = False;
if CrossDown(c,CSarv) Then
{
if CSarv <= DayHigh-pt Then
{
Condition1 = true;
var1 = CSarv;
Var2 = (DayHigh-var1)/618;
var3 = DayHigh-Var2*1000;
Var4 = var1-(DayHigh-var1);
}
}
Plot1(CSarv);
if Condition1 == true Then
{
if C < CSarv Then
{
plot2(Var3);
plot3(Var3-PriceScale);
}
Else
{
NoPlot(2);
NoPlot(3);
}
if C < CSarv Then
{
plot4(Var4);
plot5(Var4-PriceScale);
}
Else
{
NoPlot(4);
NoPlot(5);
}
}
Else
{
NoPlot(2);
NoPlot(3);
NoPlot(4);
NoPlot(5);
}
일자그래프에 색 채우기를 하면 직전 출력 부분과 연결되어 사선이 생기는데,사선을 없애는 방법이 있는지요?
안되면 전일은 무시하고 당일만 출력되게 수정 부탁합니다.
답변 1
예스스탁
예스스탁 답변
2022-08-18 09:55:06
안녕하세요
예스스탁입니다.
해당부분은 수식으로 별도처리할 방법이 없습니다.
당일만 출력되게 수정해 드립니다.
Input : AF(0.02), AFMAX(0.2),pt(1);
Var : Direction(0), SAR_Value(Close), AF_Value(.02), HighValue(High), LowValue(Low), EP(0),CSarv(0);
var : box(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);
}
}
if Bdate != Bdate[1] Then
Condition1 = False;
if CrossUp(c,CSarv) Then
Condition1 = False;
if CrossDown(c,CSarv) Then
{
if CSarv <= DayHigh-pt Then
{
Condition1 = true;
var1 = CSarv;
Var2 = (DayHigh-var1)/618;
var3 = DayHigh-Var2*1000;
Var4 = var1-(DayHigh-var1);
}
}
Plot1(CSarv);
if CurrentDate == sDate Then
{
if Condition1 == true Then
{
if C < CSarv Then
{
plot2(Var3);
plot3(Var3-PriceScale);
}
Else
{
NoPlot(2);
NoPlot(3);
}
if C < CSarv Then
{
plot4(Var4);
plot5(Var4-PriceScale);
}
Else
{
NoPlot(4);
NoPlot(5);
}
}
Else
{
NoPlot(2);
NoPlot(3);
NoPlot(4);
NoPlot(5);
}
}
즐거운 하루되세요
> 고성 님이 쓴 글입니다.
> 제목 : 피보나치 사선 제거
>
Input : AF(0.02), AFMAX(0.2),pt(1);
Var : Direction(0), SAR_Value(Close), AF_Value(.02), HighValue(High), LowValue(Low), EP(0),CSarv(0);
var : box(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);
}
}
if Bdate != Bdate[1] Then
Condition1 = False;
if CrossUp(c,CSarv) Then
Condition1 = False;
if CrossDown(c,CSarv) Then
{
if CSarv <= DayHigh-pt Then
{
Condition1 = true;
var1 = CSarv;
Var2 = (DayHigh-var1)/618;
var3 = DayHigh-Var2*1000;
Var4 = var1-(DayHigh-var1);
}
}
Plot1(CSarv);
if Condition1 == true Then
{
if C < CSarv Then
{
plot2(Var3);
plot3(Var3-PriceScale);
}
Else
{
NoPlot(2);
NoPlot(3);
}
if C < CSarv Then
{
plot4(Var4);
plot5(Var4-PriceScale);
}
Else
{
NoPlot(4);
NoPlot(5);
}
}
Else
{
NoPlot(2);
NoPlot(3);
NoPlot(4);
NoPlot(5);
}
일자그래프에 색 채우기를 하면 직전 출력 부분과 연결되어 사선이 생기는데,사선을 없애는 방법이 있는지요?
안되면 전일은 무시하고 당일만 출력되게 수정 부탁합니다.