커뮤니티

시스템식질문입니다

프로필 이미지
파인애플
2013-10-01 14:35:15
119
글번호 68018
답변완료
진입조건과 시간대가 겹칠수도 다를수도 있어서 진입명으로 매매 횟수를 제한하고 싶습니다 그리고 진입명에 따라 일괄청산식도 만들고 싶습니다
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2013-10-02 09:00:16

안녕하세요 예스스탁입니다. input : N1(2),N2(2),N3(2),N4(2); var : Bcount1(0),Bcount2(0),Scount1(0),Scount2(0); if stime == 090000 or (stime > 090000 and stime[1] < 090000) then #초기화 시간 { Bcount1 = 0; Bcount2 = 0; Scount1 = 0; Scount2 = 0; } if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then { if IsExitName("B1") == true Then Bcount1 = Bcount1+1; if IsExitName("B2") == true Then Bcount2 = Bcount2+1; if IsExitName("S1") == true Then Scount1 = Scount1+1; if IsExitName("S2") == true Then Scount2 = Scount2+1; } if 매수조건1 and bcount1 < N1 Then buy("B1"); if 매수조건2 and bcount2 < N2 Then buy("B2"); if 매도조건1 and Scount1 < N3 Then sell("S1"); if 매도조건1 and Scount2 < N4 Then sell("S2"); if MarketPosition == 1 Then{ if IsEntryName("B1") == true and 매수청산조건1 Then ExitLong("Bx1"); if IsEntryName("B2") == true and 매수청산조건2 Then ExitLong("Bx2"); } if MarketPosition == -1 Then{ if IsEntryName("S1") == true and 매도청산조건1 Then ExitShort("Sx1"); if IsEntryName("S2") == true and 매도청산조건2 Then ExitShort("Sx2"); } 즐거운 하루되세요 > 파인애플 님이 쓴 글입니다. > 제목 : 시스템식질문입니다 > 진입조건과 시간대가 겹칠수도 다를수도 있어서 진입명으로 매매 횟수를 제한하고 싶습니다 그리고 진입명에 따라 일괄청산식도 만들고 싶습니다