커뮤니티

당일진입 횟수 관련 문의드립니다.

프로필 이미지
훨훨
2013-07-28 22:25:19
148
글번호 65834
답변완료
당일 <조건1> 만족하면 매수또는 매도진입(매수/매도 각 1회 한정) 하고 당일청산하구요.. <조건1> 만족으로 포지션 진입상태에서 <조건2>까지 만족하면 추가진입(매수/매도 각 1회 한정) 후 당일청산하는 시스템을 만들려고 하는데요... 피라미딩 모두허용 설정으로 하고 돌려보면 피라미딩 설정창의 수량/횟수 숫자가 커도 <조건1> 을 만족한 진입은 1회 횟수제한이 되는데요...<조건1>만족후 포지션 진입상태에서 <조건2>를 만족시에는 1회 횟수제한이 안되고 설정창에 있는 수량/횟수까지 계속 진입이 되는데요... <조건2>를 만족한 추가진입에서만 1회 진입횟수 제한이 안되는 이유가 뭔지 모르겠어요... Input : N(1) var : cnt(0),B1cnt(0),B2cnt(0),S1cnt(0),S2cnt(0); #이름별 진입횟수 카운트 B1cnt = 0; B2cnt = 0; S1cnt = 0; S2cnt = 0; for cnt = 0 to 20 { if sdate == EntryDate(cnt) and IsEntryName("매수",cnt) == true Then B1cnt = B1cnt+1; if sdate == ExitDate(cnt) and IsExitName("추가매수",cnt) == true Then B2cnt = B2cnt+1; if sdate == EntryDate(cnt) and IsEntryName("매도",cnt) == true Then S1cnt = S1cnt+1; if sdate == ExitDate(cnt) and IsExitName("추가매도",cnt) == true Then S2cnt = S2cnt+1; } # 진입 if stime>=90000 and stime<143000 and b1cnt<n then buy("매수", AtStop, var1); if stime>=90000 and stime<143000 and s1cnt<n then sell("매도", AtStop, var2); # 추가진입 if stime>=90000 and stime<143000 and MarketPosition==1 and B2cnt<N Then buy("추가매수",AtStop,Var3); if stime>=90000 and stime<143000 and MarketPosition==-1 and S2cnt<N Then sell("추가매도",AtStop,Var4);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2013-07-29 13:57:00

안녕하세요 예스스탁입니다. 포지션함수는 모두 첫진입(포지션시작)을 기준으로 합니다. 진입의 이름도 포지션을 시작하는 진입의 이름이 해당 거래(포지션시작-포지션끝)의 진입명입니다. 추가로 발생된 부분은 인지하지 않습니다. 식을 아래와 같이 수정하셔야 합니다. Input : N(1); var : cnt(0),B1cnt(0),B2cnt(0),S1cnt(0),S2cnt(0); #이름별 진입횟수 카운트 B1cnt = 0; S1cnt = 0; for cnt = 0 to 20 { if sdate == EntryDate(cnt) and IsEntryName("매수",cnt) == true Then B1cnt = B1cnt+1; if sdate == EntryDate(cnt) and IsEntryName("매도",cnt) == true Then S1cnt = S1cnt+1; } # 첫진입 if MarketPosition <= 0 and stime>=90000 and stime<143000 and b1cnt<n then buy("매수", AtStop, var1); if MarketPosition >= 0 and stime>=90000 and stime<143000 and s1cnt<n then sell("매도", AtStop, var2); # 추가진입 if stime>=90000 and stime<143000 and MarketPosition==1 and CurrentEntries == 1 Then buy("추가매수",AtStop,Var3); if stime>=90000 and stime<143000 and MarketPosition==-1 and CurrentEntries == 1 Then sell("추가매도",AtStop,Var4); 첫진입도 각 한번씩만 발생되도록 했습니다. CurrentEntries 는 누적진입횟수입니다. 매수나 매도로 첫진입이후에 한번씩만 추가매수 추가매도하게 수정했습니다. 즐거운 하루되세요 > 훨훨 님이 쓴 글입니다. > 제목 : 당일진입 횟수 관련 문의드립니다. > 당일 <조건1> 만족하면 매수또는 매도진입(매수/매도 각 1회 한정) 하고 당일청산하구요.. <조건1> 만족으로 포지션 진입상태에서 <조건2>까지 만족하면 추가진입(매수/매도 각 1회 한정) 후 당일청산하는 시스템을 만들려고 하는데요... 피라미딩 모두허용 설정으로 하고 돌려보면 피라미딩 설정창의 수량/횟수 숫자가 커도 <조건1> 을 만족한 진입은 1회 횟수제한이 되는데요...<조건1>만족후 포지션 진입상태에서 <조건2>를 만족시에는 1회 횟수제한이 안되고 설정창에 있는 수량/횟수까지 계속 진입이 되는데요... <조건2>를 만족한 추가진입에서만 1회 진입횟수 제한이 안되는 이유가 뭔지 모르겠어요... Input : N(1) var : cnt(0),B1cnt(0),B2cnt(0),S1cnt(0),S2cnt(0); #이름별 진입횟수 카운트 B1cnt = 0; B2cnt = 0; S1cnt = 0; S2cnt = 0; for cnt = 0 to 20 { if sdate == EntryDate(cnt) and IsEntryName("매수",cnt) == true Then B1cnt = B1cnt+1; if sdate == ExitDate(cnt) and IsExitName("추가매수",cnt) == true Then B2cnt = B2cnt+1; if sdate == EntryDate(cnt) and IsEntryName("매도",cnt) == true Then S1cnt = S1cnt+1; if sdate == ExitDate(cnt) and IsExitName("추가매도",cnt) == true Then S2cnt = S2cnt+1; } # 진입 if stime>=90000 and stime<143000 and b1cnt<n then buy("매수", AtStop, var1); if stime>=90000 and stime<143000 and s1cnt<n then sell("매도", AtStop, var2); # 추가진입 if stime>=90000 and stime<143000 and MarketPosition==1 and B2cnt<N Then buy("추가매수",AtStop,Var3); if stime>=90000 and stime<143000 and MarketPosition==-1 and S2cnt<N Then sell("추가매도",AtStop,Var4);