커뮤니티

시스템수식 작성좀 봐주세요.

프로필 이미지
타고난스캘퍼
2012-02-27 12:50:16
354
글번호 48225
답변완료
예스트레이더 사용하는데 다른프로그램으로 작성된거거든요. 이식을 예쓰랭귀지 식으로 작성해주시면 고맙겠습니다.;; 부탁드릴게요 20분걸쳐서 옮겨적은거라서ㅠ //Dim 는 변수선언같네요. Dim target_count '목표가 카운트선언 Dim Call_entry_count, Put_entry_count Dim Callentrystop, putentrystop Dim ENT_NUM Dim stopTime Dim Profithigh Dim moh,mol Dim aa Dim countToday sub Creat() P=FUNC.Position("POSITION") '현재포지션 countAll=FUNC.BongCountAll("1") '전체 봉갯수 countAll2=FUNC.BoungCountAll("2") '전체 봉갯수 countToday=FUNC.BongCountToday("1") '금일 봉갯수 jdate=func.option_date ("잔존일") edate=func.option_date ("경과일") 잔존일과 경과일 변수. if countToday=0 then if jdate=0 then stopTime=140000 Else stopTime=144000 End if profithigh=-999 Call_entry_count=0 Put_entry_count=0 callentrystop=False Putentrystop=False ENT_NUM=0 CountAll=0 End if 초기화과정 tD=FUNC.tDate("1",0) tT=FUNC.tTime("1",0) CO=FUNC.GET_Attack("Call","시차") CH=FUNC.GET_Attack("call","고차") CL=FUNC.GET_Attack("call","저차") PO=FUNC.GET_Attack("PUT","시차") PH=FUNC.GET_Attack("PUT","고차") PL=FUNC.GET_Attack("PUT","저차") 앞에서만든 변수를 콜과 풋으로 구분한 것. FUNC.SET_VAR "2", "var1", CO '콜시차 FUNC.SET_VAR "2", "var2", CH '콜고차 FUNC.SET_VAR "2", "var3", CL '콜저차 FUNC.SET_VAR "2", "var4", PO '풋시차 FUNC.SET_VAR "2", "var5", PH '풋고차 FUNC.SET_VAR "2", "var6", PL '풋저차 CA= FUNC.SET_Theplus("Call","시가합") CB= FUNC.SET_Theplus("Call","시가비차") CC= FUNC.SET_Theplus("Call","중심") CD= FUNC.SET_Theplus("Call","지지차") PA= FUNC.SET_Theplus("Put","시가합") PB= FUNC.SET_Theplus("Put","시가비차") PC= FUNC.SET_Theplus("Put","중심") PD= FUNC.SET_Theplus("Put","지지차") FUNC.SET_VAR "2", "var7", CA '콜시가합 FUNC.SET_VAR "2", "var8", CB '콜시가비차 FUNC.SET_VAR "2", "var9", CC '콜중심 FUNC.SET_VAR "2", "var10", CD '콜지지차 FUNC.SET_VAR "2", "var11", PA '풋시가합 FUNC.SET_VAR "2", "var12", PB '풋시가비차 FUNC.SET_VAR "2", "var13", PC '풋중심 FUNC.SET_VAR "2", "var14", PD '풋지지차 exitMessage=func.positionText("lastExitMessage") if InStr(exitMessage,"TS") of InStr(exitMessage,"손절") then target_count=0 profithigh=-999 Call_entry_count=0 Put_entry_count=0 End if moh=fumc.highD("1",var20",counttoday) mol=func.LowD("1","var20",counttoday) POWER=Round((((CO+CL+PH)*(CA+CB+CC+CD))-((PO+PL+CH)*(PA+PB+PC+PD)))*(counttoday+edate*10)/(360+(edate+jdate)*5),2) 단일변수를만들었다. FUNC.set_var "1", "var1",POWER If P <> 0 then DIm o,c '진입가,종가 Dim Profit '수익율 o=FUNC.position("OPEN") '현재포지션 c=FUNC.position("CLOSE") '현재포지션 profit=(c-o)/o*100 if profit>profithigh Then profithigh = profit Else profit=-998 End if If jdate < 16 then if counttoday > 0 And countToday <342 Then P=FUNC.position("POSITION") '현재 포지션 if power >= 0.15 And p <> 1 And Call_entry_count <> 999 And tT < stopTime Then if P=-1 Then FUNC.order_Exit 1, "콜때문에풋청산1" target_count=0 FUNC,VIEW("콜때문에풋청산 1") profithigh=-999 End if FUNC.order_BuySell 0, "콜신규" FUNC.VIEW("콜신규") target_count=0 ENT_NUM=countAll powerH=func.highD("1","var1",countAll-ENT_NUM) powerL=func.LowD("1","var1",countAll-ENT_NUM) P=FUNC.position("POSITION") '현재 포지션 End if if power <= -0.15 And p <> -1 And Put_entry_count <>999 And tT < stopTime then if P=1 Then FUNC.order_Exit 0, "풋때문에콜청산1" target_count=0 FUNC.VIEW ("풋때문에콜청산1") profithigh=-999 End if FUNC.order_BuySell1, "풋신규" FUNC.VIEW("풋신규") target_count=0 ENT_NUM=countAll powerH=func.highD("1","var1",countAll-ENT_NUM) powerL=func.LowD("1","var1",countAll-ENT_NUM) P=FUNC.position("POSITIOM") '현재포지션 End if End if End if if jdate > 16 then if counttoday > 0 And counttoday < 342 then P=FUNC.position("POSITION") '현재 포지션 if power > 0.05 And p <> 1 And Call_entry_count<>999 And tT<stopTime Then if P=-1 Then FUNC.order_Exit1, "콜때문에풋청산1" target_count=0 FUNC.VIEW("콜때문에풋청산1") profithigh=-999 End if FUNC.order_BuySell 0, "콜신규" FUNC.VIEW("콜신규") target_count=0 ENT_NUM=countAll powerH=func.highD("1","var1",countAll-ENT_NUM) powerL=func.LowD("1","var1",countAll-ENT_NUM) P=FUNC.position("POSITION") '현재포지션 End if if power > -0.05 And p <> -1 And Put_entry_count<>999 And tT<stopTime Then if P=1 Then FUNC.order_Exit1, "풋때문에콜청산1" target_count=0 FUNC.VIEW("풋때문에콜청산1") profithigh=-999 End if FUNC.order_BuySell 0, "풋신규" FUNC.VIEW("풋신규") target_count=0 ENT_NUM=countAll powerH=func.highD("1","var1",countAll-ENT_NUM) powerL=func.LowD("1","var1",countAll-ENT_NUM) P=FUNC.position("POSITION") '현재포지션 End if End if End if if P<>0 Then if mo < moh*0.2 and moh > 50000 and moh < 500000 Then FUNC.order_Exit 0, "청산" FUNC.VIEW("청산") CALL_entry_count=999 PUT_entry_count=999 END if if mo < moh*0.5 and moh > 500000 and moh < 1000000 then FUNC.order_Exit 0, "청산" FUNC.VIEW("청산") CALL_entry_count=999 PUT_entry_count=999 End if if mo < moh*0.7 and moh > 1000000 and moh < 1500000 then Func.order_Exit 0, "청산" FUNC.VIEW("청산") CALL_entry_count=999 PUT_entry_count=999 End if if mo < moh*0.85 and moh > 1500000 then FUNC.order_Exit 0, "청산" FUNC.VIEW("청산") CALL_entry_count=999 PUT_entry_count=999 End if
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2012-02-27 19:36:52

안녕하세요 예스스탁입니다. 죄송합니다. 해당 수식은 사용해본적이 없는 랭귀지라 변환이 가능하지 않습니다. 도움을 드리지 못해 죄송합니다. 즐거운 하루되세요 > 타고난스캘퍼 님이 쓴 글입니다. > 제목 : 시스템수식 작성좀 봐주세요. > 예스트레이더 사용하는데 다른프로그램으로 작성된거거든요. 이식을 예쓰랭귀지 식으로 작성해주시면 고맙겠습니다.;; 부탁드릴게요 20분걸쳐서 옮겨적은거라서ㅠ //Dim 는 변수선언같네요. Dim target_count '목표가 카운트선언 Dim Call_entry_count, Put_entry_count Dim Callentrystop, putentrystop Dim ENT_NUM Dim stopTime Dim Profithigh Dim moh,mol Dim aa Dim countToday sub Creat() P=FUNC.Position("POSITION") '현재포지션 countAll=FUNC.BongCountAll("1") '전체 봉갯수 countAll2=FUNC.BoungCountAll("2") '전체 봉갯수 countToday=FUNC.BongCountToday("1") '금일 봉갯수 jdate=func.option_date ("잔존일") edate=func.option_date ("경과일") 잔존일과 경과일 변수. if countToday=0 then if jdate=0 then stopTime=140000 Else stopTime=144000 End if profithigh=-999 Call_entry_count=0 Put_entry_count=0 callentrystop=False Putentrystop=False ENT_NUM=0 CountAll=0 End if 초기화과정 tD=FUNC.tDate("1",0) tT=FUNC.tTime("1",0) CO=FUNC.GET_Attack("Call","시차") CH=FUNC.GET_Attack("call","고차") CL=FUNC.GET_Attack("call","저차") PO=FUNC.GET_Attack("PUT","시차") PH=FUNC.GET_Attack("PUT","고차") PL=FUNC.GET_Attack("PUT","저차") 앞에서만든 변수를 콜과 풋으로 구분한 것. FUNC.SET_VAR "2", "var1", CO '콜시차 FUNC.SET_VAR "2", "var2", CH '콜고차 FUNC.SET_VAR "2", "var3", CL '콜저차 FUNC.SET_VAR "2", "var4", PO '풋시차 FUNC.SET_VAR "2", "var5", PH '풋고차 FUNC.SET_VAR "2", "var6", PL '풋저차 CA= FUNC.SET_Theplus("Call","시가합") CB= FUNC.SET_Theplus("Call","시가비차") CC= FUNC.SET_Theplus("Call","중심") CD= FUNC.SET_Theplus("Call","지지차") PA= FUNC.SET_Theplus("Put","시가합") PB= FUNC.SET_Theplus("Put","시가비차") PC= FUNC.SET_Theplus("Put","중심") PD= FUNC.SET_Theplus("Put","지지차") FUNC.SET_VAR "2", "var7", CA '콜시가합 FUNC.SET_VAR "2", "var8", CB '콜시가비차 FUNC.SET_VAR "2", "var9", CC '콜중심 FUNC.SET_VAR "2", "var10", CD '콜지지차 FUNC.SET_VAR "2", "var11", PA '풋시가합 FUNC.SET_VAR "2", "var12", PB '풋시가비차 FUNC.SET_VAR "2", "var13", PC '풋중심 FUNC.SET_VAR "2", "var14", PD '풋지지차 exitMessage=func.positionText("lastExitMessage") if InStr(exitMessage,"TS") of InStr(exitMessage,"손절") then target_count=0 profithigh=-999 Call_entry_count=0 Put_entry_count=0 End if moh=fumc.highD("1",var20",counttoday) mol=func.LowD("1","var20",counttoday) POWER=Round((((CO+CL+PH)*(CA+CB+CC+CD))-((PO+PL+CH)*(PA+PB+PC+PD)))*(counttoday+edate*10)/(360+(edate+jdate)*5),2) 단일변수를만들었다. FUNC.set_var "1", "var1",POWER If P <> 0 then DIm o,c '진입가,종가 Dim Profit '수익율 o=FUNC.position("OPEN") '현재포지션 c=FUNC.position("CLOSE") '현재포지션 profit=(c-o)/o*100 if profit>profithigh Then profithigh = profit Else profit=-998 End if If jdate < 16 then if counttoday > 0 And countToday <342 Then P=FUNC.position("POSITION") '현재 포지션 if power >= 0.15 And p <> 1 And Call_entry_count <> 999 And tT < stopTime Then if P=-1 Then FUNC.order_Exit 1, "콜때문에풋청산1" target_count=0 FUNC,VIEW("콜때문에풋청산 1") profithigh=-999 End if FUNC.order_BuySell 0, "콜신규" FUNC.VIEW("콜신규") target_count=0 ENT_NUM=countAll powerH=func.highD("1","var1",countAll-ENT_NUM) powerL=func.LowD("1","var1",countAll-ENT_NUM) P=FUNC.position("POSITION") '현재 포지션 End if if power <= -0.15 And p <> -1 And Put_entry_count <>999 And tT < stopTime then if P=1 Then FUNC.order_Exit 0, "풋때문에콜청산1" target_count=0 FUNC.VIEW ("풋때문에콜청산1") profithigh=-999 End if FUNC.order_BuySell1, "풋신규" FUNC.VIEW("풋신규") target_count=0 ENT_NUM=countAll powerH=func.highD("1","var1",countAll-ENT_NUM) powerL=func.LowD("1","var1",countAll-ENT_NUM) P=FUNC.position("POSITIOM") '현재포지션 End if End if End if if jdate > 16 then if counttoday > 0 And counttoday < 342 then P=FUNC.position("POSITION") '현재 포지션 if power > 0.05 And p <> 1 And Call_entry_count<>999 And tT<stopTime Then if P=-1 Then FUNC.order_Exit1, "콜때문에풋청산1" target_count=0 FUNC.VIEW("콜때문에풋청산1") profithigh=-999 End if FUNC.order_BuySell 0, "콜신규" FUNC.VIEW("콜신규") target_count=0 ENT_NUM=countAll powerH=func.highD("1","var1",countAll-ENT_NUM) powerL=func.LowD("1","var1",countAll-ENT_NUM) P=FUNC.position("POSITION") '현재포지션 End if if power > -0.05 And p <> -1 And Put_entry_count<>999 And tT<stopTime Then if P=1 Then FUNC.order_Exit1, "풋때문에콜청산1" target_count=0 FUNC.VIEW("풋때문에콜청산1") profithigh=-999 End if FUNC.order_BuySell 0, "풋신규" FUNC.VIEW("풋신규") target_count=0 ENT_NUM=countAll powerH=func.highD("1","var1",countAll-ENT_NUM) powerL=func.LowD("1","var1",countAll-ENT_NUM) P=FUNC.position("POSITION") '현재포지션 End if End if End if if P<>0 Then if mo < moh*0.2 and moh > 50000 and moh < 500000 Then FUNC.order_Exit 0, "청산" FUNC.VIEW("청산") CALL_entry_count=999 PUT_entry_count=999 END if if mo < moh*0.5 and moh > 500000 and moh < 1000000 then FUNC.order_Exit 0, "청산" FUNC.VIEW("청산") CALL_entry_count=999 PUT_entry_count=999 End if if mo < moh*0.7 and moh > 1000000 and moh < 1500000 then Func.order_Exit 0, "청산" FUNC.VIEW("청산") CALL_entry_count=999 PUT_entry_count=999 End if if mo < moh*0.85 and moh > 1500000 then FUNC.order_Exit 0, "청산" FUNC.VIEW("청산") CALL_entry_count=999 PUT_entry_count=999 End if