커뮤니티

33922 추가질문

프로필 이미지
오라클
2013-12-16 18:06:25
133
글번호 70522
답변완료
input : P4(9), P5(15), P6(26); var : sumV(0), maV(0), count(0); if date != date[1] Then{ Condition1 = false; Condition2 = false; Condition3 = false; Condition4 = false; Condition5 = false; Condition6 = false; } sumV = 0; for count = 0 to P4-1 { sumV = sumV+DayClose(count); } maV = sumV / P4; if Condition1 == false and CrossDown(c,mav) Then{ buy("b1"); Condition1 = false; } sumV = 0; for count = 0 to P4-1 { sumV = sumV+DayClose(count); } maV = sumV / P4; if Condition2 == false and Crossup(c,mav) Then{ buy("b2"); Condition2 = false; } sumV = 0; for count = 0 to P5-1 { sumV = sumV+DayClose(count); } maV = sumV / P5; if Condition3 == false and CrossDown(c,mav) Then{ buy("b3"); Condition3 = false; } sumV = 0; for count = 0 to P5-1 { sumV = sumV+DayClose(count); } maV = sumV / P5; if Condition4 == false and Crossup(c,mav) Then{ buy("b4"); Condition4 = false; } sumV = 0; for count = 0 to P6-1 { sumV = sumV+DayClose(count); } maV = sumV / P6; if Condition5 == false and CrossDown(c,mav) Then{ buy("b5"); Condition5 = false; } sumV = 0; for count = 0 to P6-1 { sumV = sumV+DayClose(count); } maV = sumV / P6; if Condition6 == false and CrossUp(c,mav) Then{ buy("b6"); Condition6 = false; } if MarketPosition == 1 Then exitlong("bx",AtStop,EntryPrice*0.95); 제가 가지고 있는 기본 전략식에 모든 신호 허용해서 시뮬레이션해봤는데 1회씩이 아니라 매수조건이 되면 계속사집니다. 식에 어떠한 부분이 문제인가요? 또한 매도후 당일내에 진입금지 식을 넣고 싶은데요 식 보완 부탁드립니다. ------------------------------------------------------------------------------------ 또 다른 질문 있습니다. SetStopProfittarget(7,PercentStop); 이식을 사용하면 b1이라는 매수식이 7%가 되어 강제청산되는데 b2,b3도 매수식을 가지고 있다면 b1식과 함께 매도되게할수가 있을까요?
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2013-12-16 20:25:19

안녕하세요 예스스탁입니다. 1. 답변을 잘못드렸습니다. 날짜가 변경될대 모두 false로 하시고 진입이후에 true를 저장하시면 됩니다. 강제청산은 진입별로 발생을 합니다. 그러므로 일괄청산을 하기 위해서는 수식에서 풀어서 작성하셔야 합니다. 아래 청산식에 추가했습니다. 수정한 식입니다. input : P4(9), P5(15), P6(26); var : sumV(0), maV(0), count(0); if date != date[1] Then{ Condition1 = false; Condition2 = false; Condition3 = false; Condition4 = false; Condition5 = false; Condition6 = false; } sumV = 0; for count = 0 to P4-1 { sumV = sumV+DayClose(count); } maV = sumV / P4; if Condition1 == false and CrossDown(c,mav) Then{ buy("b1"); Condition1 = true; } sumV = 0; for count = 0 to P4-1 { sumV = sumV+DayClose(count); } maV = sumV / P4; if Condition2 == false and Crossup(c,mav) Then{ buy("b2"); Condition2 = true; } sumV = 0; for count = 0 to P5-1 { sumV = sumV+DayClose(count); } maV = sumV / P5; if Condition3 == false and CrossDown(c,mav) Then{ buy("b3"); Condition3 = true; } sumV = 0; for count = 0 to P5-1 { sumV = sumV+DayClose(count); } maV = sumV / P5; if Condition4 == false and Crossup(c,mav) Then{ buy("b4"); Condition4 = true; } sumV = 0; for count = 0 to P6-1 { sumV = sumV+DayClose(count); } maV = sumV / P6; if Condition5 == false and CrossDown(c,mav) Then{ buy("b5"); Condition5 = true; } sumV = 0; for count = 0 to P6-1 { sumV = sumV+DayClose(count); } maV = sumV / P6; if Condition6 == false and CrossUp(c,mav) Then{ buy("b6"); Condition6 = true; } if MarketPosition == 1 Then{ exitlong("loss",AtStop,EntryPrice*0.95); exitlong("Profit",AtLimit,EntryPrice*1.07); } 즐거운 하루되세요 > 오라클 님이 쓴 글입니다. > 제목 : 33922 추가질문 > input : P4(9), P5(15), P6(26); var : sumV(0), maV(0), count(0); if date != date[1] Then{ Condition1 = false; Condition2 = false; Condition3 = false; Condition4 = false; Condition5 = false; Condition6 = false; } sumV = 0; for count = 0 to P4-1 { sumV = sumV+DayClose(count); } maV = sumV / P4; if Condition1 == false and CrossDown(c,mav) Then{ buy("b1"); Condition1 = false; } sumV = 0; for count = 0 to P4-1 { sumV = sumV+DayClose(count); } maV = sumV / P4; if Condition2 == false and Crossup(c,mav) Then{ buy("b2"); Condition2 = false; } sumV = 0; for count = 0 to P5-1 { sumV = sumV+DayClose(count); } maV = sumV / P5; if Condition3 == false and CrossDown(c,mav) Then{ buy("b3"); Condition3 = false; } sumV = 0; for count = 0 to P5-1 { sumV = sumV+DayClose(count); } maV = sumV / P5; if Condition4 == false and Crossup(c,mav) Then{ buy("b4"); Condition4 = false; } sumV = 0; for count = 0 to P6-1 { sumV = sumV+DayClose(count); } maV = sumV / P6; if Condition5 == false and CrossDown(c,mav) Then{ buy("b5"); Condition5 = false; } sumV = 0; for count = 0 to P6-1 { sumV = sumV+DayClose(count); } maV = sumV / P6; if Condition6 == false and CrossUp(c,mav) Then{ buy("b6"); Condition6 = false; } if MarketPosition == 1 Then exitlong("bx",AtStop,EntryPrice*0.95); 제가 가지고 있는 기본 전략식에 모든 신호 허용해서 시뮬레이션해봤는데 1회씩이 아니라 매수조건이 되면 계속사집니다. 식에 어떠한 부분이 문제인가요? 또한 매도후 당일내에 진입금지 식을 넣고 싶은데요 식 보완 부탁드립니다. ------------------------------------------------------------------------------------ 또 다른 질문 있습니다. SetStopProfittarget(7,PercentStop); 이식을 사용하면 b1이라는 매수식이 7%가 되어 강제청산되는데 b2,b3도 매수식을 가지고 있다면 b1식과 함께 매도되게할수가 있을까요?