예스스탁
예스스탁 답변
2024-07-17 14:19:35
안녕하세요
예스스탁입니다.
Input : AF(0.01), AFMAX(0.2),AF2(0.02), AFMAX2(0.2);
Input : p(0),P2(10);
var : Diff(0), mav(0);
Var : Direction(0), SAR_Value(Diff), AF_Value(.02), HighValue(diff), LowValue(diff), EP(0),CSARV(0);
var : Diff2(0), mav2(0);
Var : Direction2(0), SAR_Value2(Diff2), AF_Value2(.02), HighValue2(Diff2), LowValue2(Diff2), EP2(0),CSARV2(0);
Diff = (C);
mav = ma(Diff,P);
if Diff == 0 Then
Diff = Diff[1];
if EP != 0 Then
{
if Direction == 1 then
{
EP = HighValue;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if diff > HighValue then
{
HighValue = diff;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
if diff < SAR_Value then
{
Direction = -1;
SAR_Value = EP;
AF_Value = 0;
EP = 0;
LowValue = diff;
}
}
else
{
EP = LowValue;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if diff < LowValue then
{
LowValue = diff;
AF_Value = AF_Value + Af;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
if diff > SAR_Value then
{
Direction = 1;
SAR_Value = EP;
AF_Value = 0;
EP = 0;
HighValue = diff;
}
}
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 diff > HighValue then
{
HighValue = diff;
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 diff < LowValue then
{
LowValue = diff;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
}
CSarv = SAR_Value;
}
else
{
if Direction == 0 then
{
if diff > diff[1] then Direction = 1;
else
if diff < diff[1] then Direction = -1;
}
else
{
if Direction == 1 then
{
if diff < diff[1] then
{
Direction = -1;
SAR_Value = HighValue;
CSarv = SAR_Value;
}
}
if Direction == -1 then
{
if diff > diff[1] then
{
Direction = 1;
SAR_Value = LowValue;
CSarv = SAR_Value;
}
}
}
LowValue = min(diff, LowValue);
HighValue = max(diff, HighValue);
}
}
Diff2 = (C);
mav2 = ma(Diff2,P2);
if Diff2 == 0 Then
Diff2 = Diff2[1];
if EP2 != 0 Then
{
if Direction2 == 1 then
{
EP2 = HighValue2;
SAR_Value2 = SAR_Value2 + AF_Value2 * (EP2 - SAR_Value2);
if Diff2 > HighValue2 then
{
HighValue2 = Diff2;
AF_Value2 = AF_Value2 + AF2;
if AF_Value2 >= AFMAX2 then AF_Value2 = AFMAX2;
}
if Diff2 < SAR_Value2 then
{
Direction2 = -1;
SAR_Value2 = EP2;
AF_Value2 = 0;
EP2 = 0;
LowValue2 = Diff2;
}
}
else
{
EP2 = LowValue2;
SAR_Value2 = SAR_Value2 + AF_Value2 * (EP2 - SAR_Value2);
if Diff2 < LowValue2 then
{
LowValue2 = Diff2;
AF_Value2 = AF_Value2 + Af2;
if AF_Value2 >= AFMAX2 then AF_Value2 = AFMAX2;
}
if Diff2 > SAR_Value2 then
{
Direction2 = 1;
SAR_Value2 = EP2;
AF_Value2 = 0;
EP2 = 0;
HighValue2 = Diff2;
}
}
CSARV2 = SAR_Value2;
}
else
{
if SAR_Value2 != 0 && EP2 == 0 then
{
if Direction2 == 1 then
{
EP2 = HighValue2;
AF_Value2 = AF2;
SAR_Value2 = SAR_Value2 + AF_Value2 * (EP2 - SAR_Value2);
if Diff2 > HighValue2 then
{
HighValue2 = Diff2;
AF_Value2 = AF_Value2 + AF2;
if AF_Value2 >= AFMAX2 then AF_Value2 = AFMAX2;
}
}
else
{
EP2 = LowValue2;
AF_Value2 = Af2;
SAR_Value2 = SAR_Value2 + AF_Value2 * (EP2 - SAR_Value2);
if Diff2 < LowValue2 then
{
LowValue2 = Diff2;
AF_Value2 = AF_Value2 + AF2;
if AF_Value2 >= AFMAX2 then AF_Value2 = AFMAX2;
}
}
CSARV2 = SAR_Value2;
}
else
{
if Direction2 == 0 then
{
if Diff2 > Diff2[1] then Direction2 = 1;
else
if Diff2 < Diff2[1] then Direction2 = -1;
}
else
{
if Direction2 == 1 then
{
if Diff2 < Diff2[1] then
{
Direction2 = -1;
SAR_Value2 = HighValue2;
CSARV2 = SAR_Value2;
}
}
if Direction2 == -1 then
{
if Diff2 > Diff2[1] then
{
Direction2 = 1;
SAR_Value2 = LowValue2;
CSARV2 = SAR_Value2;
}
}
}
LowValue2 = min(Diff2, LowValue2);
HighValue2 = max(Diff2, HighValue2);
}
}
if (diff > CSARV) and (Diff2 > CSARV2) Then
buy("매수");
if (diff < CSARV) and (Diff2 < CSARV2) Then
sell("매도");
즐거운 하루되세요
> dkfvkrh7 님이 쓴 글입니다.
> 제목 : 문의 드립니다
>
> 수고하십니다
아래 1개의 수식을 활용해서
AF(0.01), AFMAX(0.2) and AF2(0.02), AFMAX2(0.2)로
작성할 수 있는 방법이 있는지 문의 드립니다
if (diff > CSARV) and (AF2(0.02), AFMAX2(0.2)) Then
buy("매수");
if (diff < CSARV) and (AF2(0.02), AFMAX2(0.2)) Then
sell("매도");
위의 AF2(0.02), AFMAX2(0.2)를 정의하는 방법을 알고 싶습니다
감사합니다
Input : AF(0.01), AFMAX(0.2),AF2(0.02), AFMAX2(0.2);
Input : p(0);
var : Diff(0), mav(0);
Diff = (C);
mav = ma(Diff,P);
Var : Direction(0), SAR_Value(Diff), AF_Value(.02), HighValue(diff), LowValue(diff), EP(0),CSARV(0);
if Diff == 0 Then
Diff = Diff[1];
if EP != 0 Then
{
if Direction == 1 then
{
EP = HighValue;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if diff > HighValue then
{
HighValue = diff;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
if diff < SAR_Value then
{
Direction = -1;
SAR_Value = EP;
AF_Value = 0;
EP = 0;
LowValue = diff;
}
}
else
{
EP = LowValue;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if diff < LowValue then
{
LowValue = diff;
AF_Value = AF_Value + Af;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
if diff > SAR_Value then
{
Direction = 1;
SAR_Value = EP;
AF_Value = 0;
EP = 0;
HighValue = diff;
}
}
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 diff > HighValue then
{
HighValue = diff;
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 diff < LowValue then
{
LowValue = diff;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
}
CSarv = SAR_Value;
}
else
{
if Direction == 0 then
{
if diff > diff[1] then Direction = 1;
else
if diff < diff[1] then Direction = -1;
}
else
{
if Direction == 1 then
{
if diff < diff[1] then
{
Direction = -1;
SAR_Value = HighValue;
CSarv = SAR_Value;
}
}
if Direction == -1 then
{
if diff > diff[1] then
{
Direction = 1;
SAR_Value = LowValue;
CSarv = SAR_Value;
}
}
}
LowValue = min(diff, LowValue);
HighValue = max(diff, HighValue);
}
}
if (diff > CSARV) Then
buy("매수");
if (diff < CSARV) Then
sell("매도");