커뮤니티
수식변환요청
2015-06-05 10:46:57
161
글번호 86848
SK수식인데 예스로 변환 요청드립니다.
Input : Period( 5 );
Vars : MP( 0 ), Buycount( 0 ), Sellcount( 0 ), totalprofit( 0 );
MP = Marketposition;
V0 = DayofMonth( date );
V1 = dayofweek( date );
If Mod( Month(date), 3) = 0 and V0 >= 8 and V0 <= 14 and V1 = THURSDAY
Then
Begin
If time = 144000 Then v50 = NetProfit;
totalprofit = NetProfit - v50 + PositionProfit;
SetStopEndofday(143000);
End
Else
Begin
If time = 151500 Then v50 = NetProfit;
totalprofit = NetProfit - v50 + PositionProfit;
SetStopEndofday(150000);
End;
If date <> date[1] Then
Begin
Sellcount = 0;
Buycount = 0;
End;
Condition1 = time > 090000 And time < 150000;
condition2 = CrossUp(Close, Average(Close, period));
If Sellcount = 0
Then
Begin
If MP = 0 And condition1 and condition2 And Buycount < 2
Then
Begin
Buy("B1");
Buycount = Buycount + 1 ;
End;
Input : B1(0.7), B2(-1.6);
If Condition1 Then
Begin
If PositionProfit < B2 Then ExitLong("매수 손절");
If PositionProfit > B1 Then Sell("역추세");
End;
Input : X1(2.3), X2(-0.9);
If MP = -1 Then
Begin
If PositionProfit > X1 Then ExitShort("역추세 익절");
If PositionProfit < X2 Then ExitShort("역추세 손절");
End;
Input : bse(50);
If MP = 1 And BarsSinceEntry = bse then
Begin
Sell("S1");
End;
End;
Input : totalv(-2.1), bse2(20), ppf(-0.6);
If mp = 0 And totalprofit < totalv And Buycount >= 2 And Sellcount = 0
Then
Begin
Sell("S2");
Sellcount = 1;
End;
If IsEntryName("역추세") = true and barssinceentry < bse2 And PositionProfit < ppf then Buy("B2");
답변 1
예스스탁 예스스탁 답변
2015-06-05 15:09:35
안녕하세요
예스스탁입니다.
sk의 랭귀지는 사용본 경험이 없습니다.
랭귀지의 구조와 함수의 정확한 내용을 모르므로
의도하신 내용과 다를수 있습니다.
Input : Period( 5 );
Vars : MP(0), Buycount(0), Sellcount(0), totalprofit(0);
var : V0(0),V1(0),month(0),v50(0);
MP = Marketposition;
month = int(date/100)-int(date/10000)*100;
V0 = date - int(date/100)*100;
v1 = DayOfWeek(date);
If Month%3 == 0 and V0 >= 8 and V0 <= 14 and V1 == 4
Then
Begin
If time == 144000 Then v50 = NetProfit;
totalprofit = NetProfit - v50 + PositionProfit;
SetStopEndofday(143000);
End
Else
Begin
If stime == 151500 Then v50 = NetProfit;
totalprofit = NetProfit - v50 + PositionProfit;
SetStopEndofday(150000);
End;
If date <> date[1] Then
Begin
Sellcount = 0;
Buycount = 0;
End;
Condition1 = stime > 090000 And stime < 150000;
condition2 = CrossUp(Close, ma(Close, period));
If Sellcount = 0
Then
Begin
If MP == 0 And condition1 and condition2 And Buycount < 2
Then
Begin
Buy("B1");
Buycount = Buycount + 1 ;
End;
Input : B1(0.7), B2(-1.6);
If Condition1 Then
Begin
If PositionProfit < B2 Then ExitLong("매수 손절");
If PositionProfit > B1 Then Sell("역추세");
End;
Input : X1(2.3), X2(-0.9);
If MP = -1 Then
Begin
If PositionProfit > X1 Then ExitShort("역추세 익절");
If PositionProfit < X2 Then ExitShort("역추세 손절");
End;
Input : bse(50);
If MP == 1 And BarsSinceEntry == bse then
Begin
Sell("S1");
End;
End;
Input : totalv(-2.1), bse2(20), ppf(-0.6);
If mp == 0 And totalprofit < totalv And Buycount >= 2 And Sellcount == 0
Then
Begin
Sell("S2");
Sellcount = 1;
End;
If IsEntryName("역추세") == true and barssinceentry < bse2 And PositionProfit < ppf then Buy("B2");
즐거운 하루되세요
> 통큰베팅 님이 쓴 글입니다.
> 제목 : 수식변환요청
> SK수식인데 예스로 변환 요청드립니다.
Input : Period( 5 );
Vars : MP( 0 ), Buycount( 0 ), Sellcount( 0 ), totalprofit( 0 );
MP = Marketposition;
V0 = DayofMonth( date );
V1 = dayofweek( date );
If Mod( Month(date), 3) = 0 and V0 >= 8 and V0 <= 14 and V1 = THURSDAY
Then
Begin
If time = 144000 Then v50 = NetProfit;
totalprofit = NetProfit - v50 + PositionProfit;
SetStopEndofday(143000);
End
Else
Begin
If time = 151500 Then v50 = NetProfit;
totalprofit = NetProfit - v50 + PositionProfit;
SetStopEndofday(150000);
End;
If date <> date[1] Then
Begin
Sellcount = 0;
Buycount = 0;
End;
Condition1 = time > 090000 And time < 150000;
condition2 = CrossUp(Close, Average(Close, period));
If Sellcount = 0
Then
Begin
If MP = 0 And condition1 and condition2 And Buycount < 2
Then
Begin
Buy("B1");
Buycount = Buycount + 1 ;
End;
Input : B1(0.7), B2(-1.6);
If Condition1 Then
Begin
If PositionProfit < B2 Then ExitLong("매수 손절");
If PositionProfit > B1 Then Sell("역추세");
End;
Input : X1(2.3), X2(-0.9);
If MP = -1 Then
Begin
If PositionProfit > X1 Then ExitShort("역추세 익절");
If PositionProfit < X2 Then ExitShort("역추세 손절");
End;
Input : bse(50);
If MP = 1 And BarsSinceEntry = bse then
Begin
Sell("S1");
End;
End;
Input : totalv(-2.1), bse2(20), ppf(-0.6);
If mp = 0 And totalprofit < totalv And Buycount >= 2 And Sellcount = 0
Then
Begin
Sell("S2");
Sellcount = 1;
End;
If IsEntryName("역추세") = true and barssinceentry < bse2 And PositionProfit < ppf then Buy("B2");
다음글
이전글