커뮤니티

스크립트 변환 요청_추세추종형

프로필 이미지
통큰베팅
2015-09-07 10:24:23
150
글번호 90115
답변완료
아래 함수는 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-09-07 15:55:52

안녕하세요 예스스탁입니다. Input : Period( 5 ); Input : B1(0.7), B2(-1.6); Input : X1(2.3), X2(-0.9); Input : totalv(-2.1), bse2(20), ppf(-0.6); Vars : MP( 0 ), Buycount( 0 ), Sellcount( 0 ), totalprofit( 0 ); var : V0(0),V1(0),Month(0),v50(0); MP = Marketposition; V0 = DayofMonth( date ); V1 = dayofweek( date ); Month = Floor(FracPortion(sdate/10000)*100); If Mod(Month,3) == 0 and V0 >= 8 and V0 <= 14 and V1 == 4 Then Begin If stime == 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; If Condition1 Then Begin If PositionProfit < B2 Then ExitLong("매수 손절"); If PositionProfit > B1 Then Sell("역추세"); End; 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; 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");