커뮤니티

순차적 crossup 질문드립니다.

프로필 이미지
캣피쉬
2021-03-05 11:26:55
628
글번호 146809
답변완료
if crossup(c,0) and crossdown(c2,0) then sell (); if crossdown(c,0) and crossup(c2,0) then buy (); 개략적인 취지는 이런데,, 문제는 시간 term 때문에,,,, 제 생각은, crossup(c,0) 이 일어나면 condition1 상태로 지정 이후 crossdown(c,0) 이 일어나면 condition1상태를 해제하고 condition2 상태로 지정 다시 crossup(c,0) 이 일어나면 condition2 상태를 해제하고 condition1 상태로 지정 이후, condition1 ==true and crossdown(c2,0) then sell(); condition2 ==true and crossup(c2,0) then buy(); 요렇게 구현해보고 싶습니다. 가능하다면 부탁드립니다. 감사합니다!!!!
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-03-05 14:51:02

안녕하세요 예스스탁입니다. var : T(0); if crossup(c,0) Then T = 1; if CrossDown(c,0) Then T = -1; if T == 1 and crossdown(c2,0) then sell (); if T == -1 and crossup(c2,0) then buy (); 즐거운 하루되세요 > 캣피쉬 님이 쓴 글입니다. > 제목 : 순차적 crossup 질문드립니다. > if crossup(c,0) and crossdown(c2,0) then sell (); if crossdown(c,0) and crossup(c2,0) then buy (); 개략적인 취지는 이런데,, 문제는 시간 term 때문에,,,, 제 생각은, crossup(c,0) 이 일어나면 condition1 상태로 지정 이후 crossdown(c,0) 이 일어나면 condition1상태를 해제하고 condition2 상태로 지정 다시 crossup(c,0) 이 일어나면 condition2 상태를 해제하고 condition1 상태로 지정 이후, condition1 ==true and crossdown(c2,0) then sell(); condition2 ==true and crossup(c2,0) then buy(); 요렇게 구현해보고 싶습니다. 가능하다면 부탁드립니다. 감사합니다!!!!