커뮤니티

오류 수정 부탁합니다.

프로필 이미지
홀리
2011-07-19 23:18:20
576
글번호 41106
답변완료
일봉에서 5일이평이 20일이평위에 있고, 전일음봉시 시초가 매수 5일이평이 20일이평아래에 있고, 전일양봉시 시초가 매도 하려합니다. 에러가 나는데 어디가 잘못된 것인지요? input : LP1(5),LP2(20); var : sumV1(0),maV1(0),count(0),sumV2(0), maV2(0); sumV1 = 0; sumV2 = 0; for count = 0 to LP2 { if count < LP1 Then sumV1 = sumV1+DayClose(count); if count < LP2 Then sumV2 = sumV2+DayClose(count); } maV1 = sumV1 / LP1; maV2 = sumV2 / LP2; Condition1 = mav1 > mav2; IF ENTRIESTODAY()<1 THEN {if DayClose < DayOpen and Condition1 = true and stime == 151500 Then buy("B",AtMarket); if DayClose > DayOpen and Condition1 = false and stime == 151500 Then sell("s",AtMarket); } SetStopEndofday(150000);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2011-07-20 10:21:10

안녕하세요 예스스탁입니다. 변수에 값의 할당은 = 값이 같다라는 표현은 == 입니다. if 문에 condition1 = true를 condition1 == true로 변경하시면 됩니다. input : LP1(5),LP2(20); var : sumV1(0),maV1(0),count(0),sumV2(0), maV2(0); sumV1 = 0; sumV2 = 0; for count = 0 to LP2 { if count < LP1 Then sumV1 = sumV1+DayClose(count); if count < LP2 Then sumV2 = sumV2+DayClose(count); } maV1 = sumV1 / LP1; maV2 = sumV2 / LP2; Condition1 = mav1 > mav2; IF ENTRIESTODAY()<1 THEN { if DayClose < DayOpen and Condition1 == true and stime == 151500 Then buy("B",AtMarket); if DayClose > DayOpen and Condition1 == false and stime == 151500 Then sell("s",AtMarket); } SetStopEndofday(150000); 즐거운 하루되세요 > 홀리 님이 쓴 글입니다. > 제목 : 오류 수정 부탁합니다. > 일봉에서 5일이평이 20일이평위에 있고, 전일음봉시 시초가 매수 5일이평이 20일이평아래에 있고, 전일양봉시 시초가 매도 하려합니다. 에러가 나는데 어디가 잘못된 것인지요? input : LP1(5),LP2(20); var : sumV1(0),maV1(0),count(0),sumV2(0), maV2(0); sumV1 = 0; sumV2 = 0; for count = 0 to LP2 { if count < LP1 Then sumV1 = sumV1+DayClose(count); if count < LP2 Then sumV2 = sumV2+DayClose(count); } maV1 = sumV1 / LP1; maV2 = sumV2 / LP2; Condition1 = mav1 > mav2; IF ENTRIESTODAY()<1 THEN {if DayClose < DayOpen and Condition1 = true and stime == 151500 Then buy("B",AtMarket); if DayClose > DayOpen and Condition1 = false and stime == 151500 Then sell("s",AtMarket); } SetStopEndofday(150000);