아래의 수식을 17부터 다음날 05 시50에 강제 종료하고1 파라볼릭 신호 발생 시 최초 진입시는 실시간 진입하는 걸로 변경 부탁드립니다.
Input : af(0.02), maxAF(0.2);
Var : Sarv(0);
Sarv = sar(af,maxAF);
if tcond == true Then
{
If crossup(c,Sarv) Then
{
Buy("b");
}
If CrossDown(c,Sarv) Then
{
Sell("s");
}
}
답변 1
예스스탁
예스스탁 답변
2024-05-07 16:24:10
안녕하세요
예스스탁입니다.
input : StartTime(170000),EndTime(55000);
Input : af(0.02), maxAF(0.2);
Var : Direction(0), SAR_Value(Close), AF_Value(.02), HighValue(High), LowValue(Low), EP(0),Sarv(0);
Var : entry(0),Tcond(False);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if Bdate != Bdate[1] Then
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = true;
entry = 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 Low < 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 High > SAR_Value then
{
Direction = 1;
SAR_Value = EP;
AF_Value = 0;
EP = 0;
HighValue = High;
}
}
Sarv = 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;
}
}
Sarv = 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;
Sarv = SAR_Value;
}
}
if Direction == -1 then
{
if Close > Close[1] then
{
Direction = 1;
SAR_Value = LowValue;
Sarv = SAR_Value;
}
}
}
LowValue = min(Low, LowValue);
HighValue = max(High, HighValue);
}
}
if Tcond == true Then
{
if entry == 0 Then
{
var1 = Sarv+(AF_value)*(EP-SAR_Value);
if Direction == -1 Then
Buy("b1",AtStop,var1);
if Direction == 1 Then
Sell("s1",AtStop,var1);
}
Else
{
If crossup(c,Sarv) Then
{
Buy("b2");
}
If CrossDown(c,Sarv) Then
{
Sell("s2");
}
}
}
즐거운 하루되세요
> 산수유 님이 쓴 글입니다.
> 제목 : 수식 부탁드립니다.
> 아래의 수식을 17부터 다음날 05 시50에 강제 종료하고1 파라볼릭 신호 발생 시 최초 진입시는 실시간 진입하는 걸로 변경 부탁드립니다.
Input : af(0.02), maxAF(0.2);
Var : Sarv(0);
Sarv = sar(af,maxAF);
if tcond == true Then
{
If crossup(c,Sarv) Then
{
Buy("b");
}
If CrossDown(c,Sarv) Then
{
Sell("s");
}
}