커뮤니티

수정식 부탁 드립니다.

프로필 이미지
몸통공격
2012-04-28 10:15:49
419
글번호 50592
답변완료
안녕하세요? 1) 매수조건,매수청산조건, 매도조건, 매도청산 조건이 다르고 2) 매수와 매도를 손절이나, 익절을 하면서 당일 청산시까지 계속 매매하려고 합니다. 3) 밑에 첨부한 서식대로 했더니 첫신호가 매도진입이 나와 익절 될 경우는 두번째 신호가 매수신호조건이면 매수로 진입이 되는데, 첫신호가 매수진입이 나와 익절 될 경우는 두번째 신호가 매도신호가 발생되지 않고 종결이 되어 버립니다. 이것을 해결해 주시고 4) 매수신호==매도청산신호!가 아니고, 매도신호==매수청산신호!가 아닙니다. 매도청산조건, 매수청산조건을 어디에 어떻게 넣어야 겠는지 해결 부탁드립니다. -------------------------------------------------------------------------------- ((윗쪽 입력 내용들은 생략 했습니다.)) . . #당일 발생한 청산 중 최근청산이 손절이나 목표수익이면 true 아니면 false Condition1 = ExitDate(1) == sdate and (IsExitName("StopLoss",1) == true or IsExitName("StopProfittarget",1) == true); if count == 0 or (MarketPosition == 0 and Condition1 == false and BarsSinceExit(1) > 0) or MarketPosition != 0 then { If "매수조건" then buy("b1"); If "매도조건" Then Sell("s1"); } if (MarketPosition == 0 and Condition1 == true and BarsSinceExit(1) > 0) or MarketPosition != 0 then{ if MarketPosition(1) == -1 and "매수조건" then { buy("b2"); if MarketPosition(1) == 1 and "매도조건" Then Sell("s2"); } } SetStopLoss(0.8,PointStop); SetStopProfittarget(1.0,PointStop); SetStopEndofday(150430);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2012-04-30 10:22:57

안녕하세요 예스스탁입니다. var : cnt(0),count(0); count = 0; for cnt = 0 to 10{ if sdate == EntryDate(1) Then count = count+1; } Condition1 = count >= 1 and ExitDate(1) == sdate and (IsExitName("StopLoss",1) == true or IsExitName("StopProfittarget",1) == true); if count == 0 or MarketPosition != 0 or (MarketPosition == 0 and Condition1 == false and BarsSinceExit(1) > 0) or (MarketPosition == 0 and Condition1 == true and BarsSinceExit(1) > 0) then { If 매수진입조건 then buy("b1"); If 매도진입조건 Then Sell("s1"); } if MarketPosition == 1 and 매수청산조건 Then exitlong("bx"); if MarketPosition == 1 and 매도청산조건 Then ExitShort("sx"); SetStopLoss(0.8,PointStop); SetStopProfittarget(1.0,PointStop); SetStopEndofday(150430); 즐거운 하루되세요 > 몸통공격 님이 쓴 글입니다. > 제목 : 수정식 부탁 드립니다. > 안녕하세요? 1) 매수조건,매수청산조건, 매도조건, 매도청산 조건이 다르고 2) 매수와 매도를 손절이나, 익절을 하면서 당일 청산시까지 계속 매매하려고 합니다. 3) 밑에 첨부한 서식대로 했더니 첫신호가 매도진입이 나와 익절 될 경우는 두번째 신호가 매수신호조건이면 매수로 진입이 되는데, 첫신호가 매수진입이 나와 익절 될 경우는 두번째 신호가 매도신호가 발생되지 않고 종결이 되어 버립니다. 이것을 해결해 주시고 4) 매수신호==매도청산신호!가 아니고, 매도신호==매수청산신호!가 아닙니다. 매도청산조건, 매수청산조건을 어디에 어떻게 넣어야 겠는지 해결 부탁드립니다. -------------------------------------------------------------------------------- ((윗쪽 입력 내용들은 생략 했습니다.)) . . #당일 발생한 청산 중 최근청산이 손절이나 목표수익이면 true 아니면 false Condition1 = ExitDate(1) == sdate and (IsExitName("StopLoss",1) == true or IsExitName("StopProfittarget",1) == true); if count == 0 or (MarketPosition == 0 and Condition1 == false and BarsSinceExit(1) > 0) or MarketPosition != 0 then { If "매수조건" then buy("b1"); If "매도조건" Then Sell("s1"); } if (MarketPosition == 0 and Condition1 == true and BarsSinceExit(1) > 0) or MarketPosition != 0 then{ if MarketPosition(1) == -1 and "매수조건" then { buy("b2"); if MarketPosition(1) == 1 and "매도조건" Then Sell("s2"); } } SetStopLoss(0.8,PointStop); SetStopProfittarget(1.0,PointStop); SetStopEndofday(150430);