예스스탁
예스스탁 답변
2021-04-05 14:49:15
안녕하세요
예스스탁입니다.
input : resist(0),resist2(0),resist3(0);
수식안에서 값을 저장받는 변수는 내부저장변수이므로 var로 선언하셔야 합니다.
input은 외부저장변수선언입니다.
input : StartTime(91000),EndTime(151000);
Input : shortPeriod(4), longPeriod(40);
input : 손절(2.8);
input : 익절(3.5);
var : resist(0),resist2(0),resist3(0);
var : Tcond(false,Data1);
var : C2(0,Data2);
var : C3(0,Data3);
var : C4(0,Data4);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
C2 = Data2(c);
C3 = Data3(c);
C4 = Data4(c);
#
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 >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
Tcond = true;
if date != date[1] then
{
if stime>143000 and stime<153000 Then
{
if Lowest(c3,300)>-0.1 Then resist=1;
else if highest(c3,300)<0.1 Then resist=-1;
else resist=0;
if Average(c2,350)>0 and Lowest(c2,350)>-0.2 Then resist2=1;
else if Average(c2,350)<0 and highest(c2,350)<0.2 Then resist2=1;
else resist2=0;
if resist2==1 and resist==1 Then resist3=2;
Else if resist2==1 and resist==-1 Then resist3=-2;
Else resist3=0;
}
}
# 매수/매도청산
if Tcond == true and resist3<>2 and resist3<>-2 Then
{
If CrossUP(c, value2) Then
{
Buy();
}
If CrossDown(c, value2) Then
{
Sell();
}
}
SetStopEndofday(EndTime);
SetStoploss(손절,PointStop);
SetStopProfittarget(익절,PointStop);
즐거운 하루되세요
> 캣피쉬 님이 쓴 글입니다.
> 제목 : 오류 원인좀 부탁드립니다.
> 아래의 오류 구간이(31줄~42줄)
지표식에서는 문제없었는데
시스템식에서는 오류가 나옵니다.
뭔가 원인인지 잘 모르겠습니다.
부탁드리겠습니다.
감사합니다. !!!
---------------------------
input : StartTime(91000),EndTime(151000);
Input : shortPeriod(4), longPeriod(40);
input : 손절(2.8);
input : 익절(3.5);
input : resist(0),resist2(0),resist3(0);
var : Tcond(false,Data1);
var : C2(0,Data2);
var : C3(0,Data3);
var : C4(0,Data4);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
C2 = Data2(c);
C3 = Data3(c);
C4 = Data4(c);
#
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 >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
Tcond = true;
if date != date[1] then
{
if stime>143000 and stime<153000 Then
{
if Lowest(c3,300)>-0.1 Then resist=1;
else if highest(c3,300)<0.1 Then resist=-1;
else resist=0;
if Average(c2,350)>0 and Lowest(c2,350)>-0.2 Then resist2=1;
else if Average(c2,350)<0 and highest(c2,350)<0.2 Then resist2=1;
else resist2=0;
if resist2==1 and resist==1 Then resist3=2;
Else if resist2==1 and resist==-1 Then resist3=-2;
Else resist3=0;
}
}
# 매수/매도청산
if Tcond == true and resist3<>2 and resist3<>-2 Then
{
If CrossUP(c, value2) Then
{
Buy();
}
If CrossDown(c, value2) Then
{
Sell();
}
}
SetStopEndofday(EndTime);
SetStoploss(손절,PointStop);
SetStopProfittarget(익절,PointStop);