답변완료
문의 드립니다
> 수고하십니다
아래 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("매도");
2024-07-16
825
글번호 181562
시스템
답변완료
문의 드립니다
수고하십니다
아래는 AF(0.02), AFMAX(0.2) 1개의 크기를 위한 수식입니다
그러면
AF2(0.02), AFMAX2(0.2) and
AF3(0.03), AFMAX3(0.2) and
AF4(0.04), AFMAX4(0.2) and ... 등등
여러 크기의 AF(0), AFMAX(0) 가 필요할 때에는
아래 수식도 그 갯수만큼 각각 만들야 되는지요
아니면 아래 1개의 수식을 활용해서 여러개의 다른 크기별로
작성할 수 있는 방법이 있는지 문의 드립니다
감사합니다
Input : AF(0.02), AFMAX(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("매도");
2024-07-16
733
글번호 181551
시스템
답변완료
파라볼릭 하락2파
Input : af(0.02), maxAF(0.2);
var : T(0),B(0),S(0),tx(0),HH(0),LL(0),box(0),B1(0),S1(0),H1(0),L1(0);
var1 = CSar(af,maxAF);
if CrossUp(C,var1) Then
{
T = 1;
B = var1;
B1 = B[1];
HH = H;
H1 = HH[1];
if abs(S-LL) < 0.9 Then
Text_Delete(tx);
tx = Text_New(sDate,sTime,HH,NumToStr(abs(HH-B),2));
Text_SetColor(tx,Red);
Text_SetSize(tx,25);
Text_SetStyle(tx,1,1);
Text_SetBold(tx,1);
box = Box_New(sDate,sTime,B,NextBarSdate,NextBarStime,HH);
if MarketPosition == -1 Then
ExitShort();
}
if CrossDown(C,var1) Then
{
T = -1;
S = var1;
S1 = S[1];
LL = L;
L1 = LL[1];
if abs(B-HH) < 0.8 Then
Text_Delete(tx);
tx = Text_New(sDate,sTime,LL,NumToStr(abs(LL-S),2));
Text_SetColor(tx,Blue);
Text_SetSize(tx,25);
Text_SetStyle(tx,1,0);
Text_SetBold(tx,1);
box = Box_New(sDate,sTime,S,NextBarSdate,NextBarStime,LL);
}
Else
{
if T == 1 Then
{
if H > HH Then
HH = H;
Text_SetString(tx,NumToStr(abs(HH-B),2));
Text_SetLocation(tx,sDate,sTime,HH);
Box_SetEnd(box,NextBarSdate,NextBarStime,hh);
if HH < B+0.6 Then
{
Box_SetColor(box,Orange);
Box_SetFill(box,true,90);
}
Else if HH >= B+0.6 and HH < B+0.8 Then
{
Box_SetColor(box,Gray);
Box_SetFill(box,true,80);
}
Else if HH >= B+0.8 and HH < B+1.3 Then
{
Box_SetColor(box,Magenta);
Box_SetFill(box,true,50);
}
Else if HH >= B+1.3 and HH < B+1.9 Then
{
Box_SetColor(box,Gray);
Box_SetFill(box,true,60);
}
Else
{
Box_SetColor(box,Pink);
Box_SetFill(box,true,90);
}
}
if T == -1 Then
{
if L < LL Then
LL = L;
Text_SetString(tx,NumToStr(abs(LL-S),2));
Text_SetLocation(tx,sDate,sTime,LL);
Box_SetEnd(box,NextBarSdate,NextBarStime,LL);
if LL > S-0.6 Then
{
Box_SetColor(box,Cyan);
Box_SetFill(box,true,120);
}
Else if LL <= S-0.6 and ll > S-0.9 Then
{
Box_SetColor(box,Yellow);
Box_SetFill(box,true,150);
}
Else if LL <= S-0.9 and ll > S-1.3 Then
{
Box_SetColor(box,Lime);
Box_SetFill(box,true,120);
}
Else if LL <= S-1.3 and ll > S-1.6 Then
{
Box_SetColor(box,Cyan);
Box_SetFill(box,true,90);
}
Else if LL <= S-1.6 and ll > S-1.9 Then
{
Box_SetColor(box,Blue);
Box_SetFill(box,true,30);
}
Else
{
Box_SetColor(box,Yellow);
Box_SetFill(box,true,120);
}
if S1 > 0 and S < S1 and CrossDown(c,L1) Then
{
Sell();
}
}
}
선물 120틱에서 몇군데 매도 신호가 안나옵니다. 검토 부탁드립니다.
2024-07-16
760
글번호 181546
시스템