커뮤니티

간단한 수식인데 이상해서

프로필 이미지
민리
2011-01-07 07:31:36
415
글번호 34755
답변완료
아주 기초적인 겁니다. 예를들어 1분봉에서 9시3분에 종가를 인식하고 그이후에 그보다 1.0보다 크면 매수, 1.0보다 작으면 매도로 진입하는 프로그램이 있다고 치고 그걸 작성하고 싶은데요 아래와 비슷하게 하는데 잘 안되는데 좀 봐주세요. -------------------- Inputs: strtbar(2),stptime(140000); Variables: stndprice(0); if date[1]<> date then{ stndprice=0; condition1=false; condition2=false; } if (DayIndex>strtbar condition1==false )then{ condition1=true; stndprice=close; } if ( date[1]== date and MarketPosition==0 and stndprice> 0 and condition1 )then { buy ("b_",AtStop,stndprice+1.0,DEF ); sell ("s_",atstop,stndprice-1.0,DEF ); } SetStopEndofday(stptime); ----------------- 좀 짜주세요.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2011-01-07 09:48:36

안녕하세ㅐ요 예스스탁입니다. Inputs: strtbar(2),stptime(140000); Variables: stndprice(0); if date[1]<> date then{ stndprice=0; condition1=false; condition2=false; } if (DayIndex>strtbar and condition1==false )then{ condition1=true; stndprice=close; } if ( date[1]== date and MarketPosition==0 and stndprice> 0 and condition1 and stime < 151500 )then { buy ("b_",AtStop,stndprice+1.0,DEF ); sell ("s_",atstop,stndprice-1.0,DEF ); } SetStopEndofday(stptime); Atstop/Atlimit은 현재봉에 if조건이 만족하면 다음봉에 신호가 발생하는 타입이므로 당일 마지막에 조건이 만족하면 다음날 시초가에 바로 신호가 나올수 있으므로 당일 마지막봉에 if조건이 맞지 않게 해주셔야 합니다. 즐거운 하루되세요 > 민리 님이 쓴 글입니다. > 제목 : 간단한 수식인데 이상해서 > 아주 기초적인 겁니다. 예를들어 1분봉에서 9시3분에 종가를 인식하고 그이후에 그보다 1.0보다 크면 매수, 1.0보다 작으면 매도로 진입하는 프로그램이 있다고 치고 그걸 작성하고 싶은데요 아래와 비슷하게 하는데 잘 안되는데 좀 봐주세요. -------------------- Inputs: strtbar(2),stptime(140000); Variables: stndprice(0); if date[1]<> date then{ stndprice=0; condition1=false; condition2=false; } if (DayIndex>strtbar condition1==false )then{ condition1=true; stndprice=close; } if ( date[1]== date and MarketPosition==0 and stndprice> 0 and condition1 )then { buy ("b_",AtStop,stndprice+1.0,DEF ); sell ("s_",atstop,stndprice-1.0,DEF ); } SetStopEndofday(stptime); ----------------- 좀 짜주세요.