예스스탁
예스스탁 답변
2022-03-21 14:58:20
안녕하세요
예스스탁입니다.
수식을 적용해 보았지만 별도로 잘못 출력되는 부분들이 없습니다.
수식내용에도 이상이 없습니다.
당일 파라볼릭만 작성해 드립니다.
Input : af(0.02), maxAF(0.2);
var : T(0);
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 >= maxAF then AF_Value = maxAF;
}
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 >= maxaf then AF_Value = maxaf;
}
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 >= maxaf then AF_Value = maxaf;
}
}
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 >= maxaf then AF_Value = maxaf;
}
}
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);
}
}
var1 = CSarv;
if CrossUp(C,var1) Then
{
T = 1;
value1 = H;
Value2 = DayLow;
}
if CrossDown(C,var1) Then
{
T = -1;
value3 = L;
Value4 = DayHigh;
}
if T == 1 Then
{
Plot1(value1,"H");
Plot2(value2,"LL");
Plot3(value1+abs(value1-Value2),"H+");
Plot4(value2-abs(value1-Value2),"H-");
Plot5(value1+abs(value1-Value2)*2,"H1+");
Plot6(value2-abs(value1-Value2)*2,"H1-");
}
Else
{
NoPlot(1);
NoPlot(2);
NoPlot(3);
NoPlot(4);
NoPlot(5);
NoPlot(6);
}
if T == -1 Then
{
Plot7(value3,"L");
Plot8(value4,"HH");
Plot9(value3-abs(value3-Value4),"L-");
Plot10(value4+abs(value3-Value4),"L+");
Plot11(value3-abs(value3-Value4)*2,"L1-");
Plot12(value4+abs(value3-Value4)*2,"L1+");
}
Else
{
NoPlot(7);
NoPlot(8);
NoPlot(9);
NoPlot(10);
NoPlot(11);
NoPlot(12);
}
즐거운 하루되세요
> 크라켄 님이 쓴 글입니다.
> 제목 : 부탁드립니다
> $,아래식은 일봉적용 수식인데요 틱봉에 적용하니까 첨부파일 처럼 수평선출력이
맞는부분도 있고 틀린부분도 있습니다,여기서 틀린부분 수정도움 부탁드립니다.
1,그림파일 4각박스1번처럼 수정해서 대칭적용합니다
2,파라볼릭을 전일연속이 아닌 당일시작부터 적용할때 1번조건수식을 별도로 부탁드립
니다
Input : af(0.02), maxAF(0.2);
var : T(0);
var1 = CSAR(af,maxAF);
if CrossUp(C,var1) Then
{
T = 1;
value1 = H;
Value2 = DayLow;
}
if CrossDown(C,var1) Then
{
T = -1;
value3 = L;
Value4 = DayHigh;
}
if T == 1 Then
{
Plot1(value1,"H");
Plot2(value2,"LL");
Plot3(value1+abs(value1-Value2),"H+");
Plot4(value2-abs(value1-Value2),"H-");
Plot5(value1+abs(value1-Value2)*2,"H1+");
Plot6(value2-abs(value1-Value2)*2,"H1-");
}
Else
{
NoPlot(1);
NoPlot(2);
NoPlot(3);
NoPlot(4);
NoPlot(5);
NoPlot(6);
}
if T == -1 Then
{
Plot7(value3,"L");
Plot8(value4,"HH");
Plot9(value3-abs(value3-Value4),"L-");
Plot10(value4+abs(value3-Value4),"L+");
Plot11(value3-abs(value3-Value4)*2,"L1-");
Plot12(value4+abs(value3-Value4)*2,"L1+");
Else
{
NoPlot(7);
NoPlot(8);
NoPlot(9);
NoPlot(10);
NoPlot(11);
NoPlot(12);
}
$$,고맙습니다.