커뮤니티

함수변환 요청(키움)

프로필 이미지
통큰베팅
2017-04-19 14:02:29
218
글번호 108949
답변완료
안녕하세요? 아래는 키움증권에서 사용하는 언어로 쓰여진 함수입니다. YT언어로 변환 요청드립니다. 감사합니다. 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
프로필 이미지

예스스탁 예스스탁 답변

2017-04-20 10:58:00

안녕하세요 예스스탁입니다. Input : Period( 5 ); Vars : MP( 0 ), Buycount( 0 ), Sellcount( 0 ), totalprofit( 0 ),Month(0); var : V0(0),V1(0),v50(0); MP = Marketposition; V0 = date%100; V1 = dayofweek(date); month = int(date/100)-int(date/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 = 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"); 즐거운 하루되세요 > 통큰베팅 님이 쓴 글입니다. > 제목 : 함수변환 요청(키움) > 안녕하세요? 아래는 키움증권에서 사용하는 언어로 쓰여진 함수입니다. YT언어로 변환 요청드립니다. 감사합니다. 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");