커뮤니티

일일매매횟수 제한

프로필 이미지
조민철
2017-06-13 21:52:37
157
글번호 110385
답변완료
항상 감사드립니다... 아래의 시스템식은 장시작시 초기화 되어 전일매매와 상관없이 당일 새롭게 시작되는 식입니다. 그리고 하루매매횟수를 3회로 제한하는데 신호가 제어가 되질 않습니다 ++++++++++++++++++++++++++++++++++++++ 아래식을 다음과 같이 수정코저 합니다 1.전일마지막 신호와 연계해서 동일방향 재진입금지 2.당일 매매횟수를 3회로 제한 3.당일 첫번째 신호는 매수조건1,매도조건1 일때 신호발생 두번째 신호부터는 매수조건2,매도조건2 일때 신호발생(현재의 매수매도조건식) ### 동일방향 재진입금지/전일 마지막신호와 무관하게 진입 ### var : entrycnt(0),T1(0),count1(0); if stime == 170000 or (stime > 170000 and stime[1] < 170000) Then { Entrycnt = 0; T1 = 0; count1 = 0; } if MarketPosition != 0 and MarketPosition != MarketPosition[1] then Entrycnt = Entrycnt+1; ##################################################### if (stime >= 170000 or stime < 170000) Then{ #매수조건이면 T1는 1, 카운트 1증가 if T1 <= 0 and uparoon>dnaroon and uparoon>50 and macdosc>0 and c>var48 and c>var52[25] and adxv1>20 and dp2>dm2 and stok80>50 then { T1 = 1; count1 = count1+1; #카운트가 3보다 작거나 같을때 나머지 포지션 조건 만족할때 진입 if count1 <= 3 and ((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and MarketPosition(1) != 1) or (MarketPosition == -1)) Then #동일방향 재진입금지# BUY("B1_stok80"); } #매도조건이면 T1는 -1, 카운트 1증가 if T1 >= 0 and uparoon<dnaroon and dnaroon>50 and macdosc <0 and c<var48 and c<var52[25] and adxv1>20 and dp2<dm2 and stok80<50 Then{ T1 = -1; count1 = count1+1; #카운트가 3보다작거나 같을때 나머저 포지션 조건 만족할때 진입 if count1 <= 3 and ((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and MarketPosition(1) != -1) or (MarketPosition == 1)) then #동일방향 재진입금지# sell("S1_stok80"); } } if stime == 150000 or (stime > 150000 and stime[1] < 150000) Then{ exitlong("당일매수청산"); ExitShort("당일매도청산"); } 감사합니다
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2017-06-14 09:08:35

안녕하세요 예스스탁입니다. input : 시작시간(170000), 종료시간(150000),당일최대진입횟수(3); var : entrycnt(0),S1(0),T1(0),count1(0),Tcond(false); if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then { Tcond = true; S1 = TotalTrades; T1 = 0; count1 = 0; } if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then{ Tcond = false; ExitLong("당일매수청산"); ExitShort("당일매도청산"); } if MarketPosition != 0 Then Entrycnt = TotalTrades-T1; Else Entrycnt = TotalTrades-T1+1; ##################################################### if Tcond == true Then{ if entrycnt == 0 Then{ if 매수조건1 and MarketPosition == 0 and MarketPosition(1) != 1 Then buy("b1"); if 매도조건1 and MarketPosition == 0 and MarketPosition(1) != -1 Then sell("s1"); } #매수조건이면 T1는 1, 카운트 1증가 if T1 <= 0 and uparoon>dnaroon and uparoon>50 and macdosc>0 and c>var48 and c>var52[25] and adxv1>20 and dp2>dm2 and stok80>50 then { T1 = 1; count1 = count1+1; #카운트가 3보다 작거나 같을때 나머지 포지션 조건 만족할때 진입 if count1 <= 3 and entrycnt >= 1 and entrycnt < 당일최대진입횟수 and ((MarketPosition == 0 and MarketPosition(1) != 1) or MarketPosition == -1) Then #동일방향 재진입금지# BUY("B1_stok80"); } #매도조건이면 T1는 -1, 카운트 1증가 if T1 >= 0 and uparoon<dnaroon and dnaroon>50 and macdosc <0 and c<var48 and c<var52[25] and adxv1>20 and dp2<dm2 and stok80<50 Then{ T1 = -1; count1 = count1+1; #카운트가 3보다작거나 같을때 나머저 포지션 조건 만족할때 진입 if count1 <= 3 and entrycnt >= 1 and entrycnt < 당일최대진입횟수 and ((MarketPosition == 0 and MarketPosition(1) != -1) or MarketPosition == 1) then #동일방향 재진입금지# sell("S1_stok80"); } } 즐거운 하루되세요 > 조민철 님이 쓴 글입니다. > 제목 : 일일매매횟수 제한 > 항상 감사드립니다... 아래의 시스템식은 장시작시 초기화 되어 전일매매와 상관없이 당일 새롭게 시작되는 식입니다. 그리고 하루매매횟수를 3회로 제한하는데 신호가 제어가 되질 않습니다 ++++++++++++++++++++++++++++++++++++++ 아래식을 다음과 같이 수정코저 합니다 1.전일마지막 신호와 연계해서 동일방향 재진입금지 2.당일 매매횟수를 3회로 제한 3.당일 첫번째 신호는 매수조건1,매도조건1 일때 신호발생 두번째 신호부터는 매수조건2,매도조건2 일때 신호발생(현재의 매수매도조건식) ### 동일방향 재진입금지/전일 마지막신호와 무관하게 진입 ### var : entrycnt(0),T1(0),count1(0); if stime == 170000 or (stime > 170000 and stime[1] < 170000) Then { Entrycnt = 0; T1 = 0; count1 = 0; } if MarketPosition != 0 and MarketPosition != MarketPosition[1] then Entrycnt = Entrycnt+1; ##################################################### if (stime >= 170000 or stime < 170000) Then{ #매수조건이면 T1는 1, 카운트 1증가 if T1 <= 0 and uparoon>dnaroon and uparoon>50 and macdosc>0 and c>var48 and c>var52[25] and adxv1>20 and dp2>dm2 and stok80>50 then { T1 = 1; count1 = count1+1; #카운트가 3보다 작거나 같을때 나머지 포지션 조건 만족할때 진입 if count1 <= 3 and ((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and MarketPosition(1) != 1) or (MarketPosition == -1)) Then #동일방향 재진입금지# BUY("B1_stok80"); } #매도조건이면 T1는 -1, 카운트 1증가 if T1 >= 0 and uparoon<dnaroon and dnaroon>50 and macdosc <0 and c<var48 and c<var52[25] and adxv1>20 and dp2<dm2 and stok80<50 Then{ T1 = -1; count1 = count1+1; #카운트가 3보다작거나 같을때 나머저 포지션 조건 만족할때 진입 if count1 <= 3 and ((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and MarketPosition(1) != -1) or (MarketPosition == 1)) then #동일방향 재진입금지# sell("S1_stok80"); } } if stime == 150000 or (stime > 150000 and stime[1] < 150000) Then{ exitlong("당일매수청산"); ExitShort("당일매도청산"); } 감사합니다