커뮤니티
함수변환 요청
2019-04-09 09:45:08
218
글번호 127706
안녕하세요?
아래는 시그널메이커로 작성된 스크립트입니다.
예스랭귀지로 변환 요청드립니다.
Vars : st(0), et(0);
V1 = Dayofweek((10000 * Year(D)) + (100 * 3) + 1);
If V1 = 0 Then Value2 = 8
Else Value2 = 15 - V1; // 3월 두번째 일요일 날짜
V2 = Dayofweek((10000 * Year(D)) + (100 * 11) + 1);
If V2 = 0 Then Value4 = 1
Else value4 = 8 - V2; // 11월 첫번째 일요일 날짜
If date > (10000 * Year(D)) + (100 * 3) + value2
And date < (10000 * Year(D)) + (100 * 11) + value4 Then
Begin
st = 070000; // 써머타임 적용 시, 장시작 시간
et = 060000; // 써머타임 적용 시, 장종료 시간
v77 = 150000;
v88 = 200000;
End
Else
Begin
st = 080000; // 장 시작 시간
et = 070000; // 장 종료 시간
v77 = 160000;
v88 = 210000;
End;
condition1 = (IntPortion(time/10000) > IntPortion(et/10000)
And IntPortion(time[1]/10000) <= IntPortion(et/10000)) Or st <> st[1];
/////////////////////////////////////////////////////////////////
Var : vTT(0), vPrice1(0), vPrice2(0);
IF condition1 Then vTT = 0;
If TIME[1] < v77 And v77 <= TIME Then vPrice1 = data2(C);
If TIME[1] < v88 And v88 <= TIME Then vPrice2 = data2(C);
Vars : TCOND(False);
If v88 < et Then
Begin
If v88 < TIME And TIME <= et Then TCONd = True
Else TCONd = False;
End
Else
Begin
If v88 < TIME Or TIME <= et Then TCOND = True
Else tCOND = False;
End;
If TCOND And vTT = 0 And vPrice1 > 0 And vPrice2 > 0 Then
Begin
if vPrice1 > vPrice2 Then
Begin
buy("b");
vTT = 1;
End;
if vPrice1 < vPrice2 Then
Begin
sell("s");
vTT = 1;
End;
End;
답변 1
예스스탁 예스스탁 답변
2019-04-09 15:29:54
안녕하세요
예스스탁입니다.
Var : st(0), et(0),Year(0);
var : v1(0),v2(0),v77(0),v88(0);
Year = data2(Floor(sdate/10000));
V1 = data2(Dayofweek((10000 * Year) + (100 * 3) + 1));
If V1 == 0 Then
Value2 = 8;
Else
Value2 = 15 - V1; // 3월 두번째 일요일 날짜
V2 = data2(Dayofweek((10000 * Year) + (100 * 11) + 1));
If V2 == 0 Then
Value4 = 1;
Else
value4 = 8 - V2; // 11월 첫번째 일요일 날짜
If data2(sdate > (10000 * Year) + (100 * 3) + value2
And sdate < (10000 * Year) + (100 * 11) + value4) Then
Begin
st = 070000; // 써머타임 적용 시, 장시작 시간
et = 060000; // 써머타임 적용 시, 장종료 시간
v77 = 150000;
v88 = 200000;
End
Else
Begin
st = 080000; // 장 시작 시간
et = 070000; // 장 종료 시간
v77 = 160000;
v88 = 210000;
End;
condition1 = (IntPortion(stime/10000) > IntPortion(et/10000)
And IntPortion(stime[1]/10000) <= IntPortion(et/10000)) Or st <> st[1];
/////////////////////////////////////////////////////////////////
Var : vTT(0), vPrice1(0), vPrice2(0);
IF condition1 Then vTT = 0;
If data2(sTIME[1] < v77 And v77 <= sTIME) Then vPrice1 = data2(C);
If data2(sTIME[1] < v88 And v88 <= sTIME) Then vPrice2 = data2(C);
Vars : TCOND(False);
If v88 < et Then
Begin
If data2(v88 < sTIME And sTIME <= et) Then TCONd = True;
Else TCONd = False;
End
Else
Begin
If data2(v88 < TIME Or TIME <= et) Then TCOND = True;
Else tCOND = False;
End;
If TCOND And vTT == 0 And vPrice1 > 0 And vPrice2 > 0 Then
Begin
if vPrice1 > vPrice2 Then
Begin
buy("b");
vTT = 1;
End;
if vPrice1 < vPrice2 Then
Begin
sell("s");
vTT = 1;
End;
End;
즐거운 하루되세요
> 흰둥이아빠 님이 쓴 글입니다.
> 제목 : 함수변환 요청
> 안녕하세요?
아래는 시그널메이커로 작성된 스크립트입니다.
예스랭귀지로 변환 요청드립니다.
Vars : st(0), et(0);
V1 = Dayofweek((10000 * Year(D)) + (100 * 3) + 1);
If V1 = 0 Then Value2 = 8
Else Value2 = 15 - V1; // 3월 두번째 일요일 날짜
V2 = Dayofweek((10000 * Year(D)) + (100 * 11) + 1);
If V2 = 0 Then Value4 = 1
Else value4 = 8 - V2; // 11월 첫번째 일요일 날짜
If date > (10000 * Year(D)) + (100 * 3) + value2
And date < (10000 * Year(D)) + (100 * 11) + value4 Then
Begin
st = 070000; // 써머타임 적용 시, 장시작 시간
et = 060000; // 써머타임 적용 시, 장종료 시간
v77 = 150000;
v88 = 200000;
End
Else
Begin
st = 080000; // 장 시작 시간
et = 070000; // 장 종료 시간
v77 = 160000;
v88 = 210000;
End;
condition1 = (IntPortion(time/10000) > IntPortion(et/10000)
And IntPortion(time[1]/10000) <= IntPortion(et/10000)) Or st <> st[1];
/////////////////////////////////////////////////////////////////
Var : vTT(0), vPrice1(0), vPrice2(0);
IF condition1 Then vTT = 0;
If TIME[1] < v77 And v77 <= TIME Then vPrice1 = data2(C);
If TIME[1] < v88 And v88 <= TIME Then vPrice2 = data2(C);
Vars : TCOND(False);
If v88 < et Then
Begin
If v88 < TIME And TIME <= et Then TCONd = True
Else TCONd = False;
End
Else
Begin
If v88 < TIME Or TIME <= et Then TCOND = True
Else tCOND = False;
End;
If TCOND And vTT = 0 And vPrice1 > 0 And vPrice2 > 0 Then
Begin
if vPrice1 > vPrice2 Then
Begin
buy("b");
vTT = 1;
End;
if vPrice1 < vPrice2 Then
Begin
sell("s");
vTT = 1;
End;
End;
다음글
이전글