커뮤니티
부탁드립니다.
2015-11-10 15:28:40
157
글번호 92263
아래식은 예스님이 작성해주신건데요.
시간 적용이 되질않네요.
다시 검토 부탁드립니다.
input : 시작시간(120000),끝시간(20000);
var : TimeCond(false),Sellcnt(0),Sxcnt(0);
if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then
TimeCond = true;
if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간) Then
TimeCond = false;
#매도 조건만족 횟수 카운트
Sellcnt = 0;
if SROCsig2 < SROCsig2[1] Then
Sellcnt = Sellcnt+1;
if SonarSig2 < SonarSig2[1] Then
Sellcnt = Sellcnt+1;
if TSI2 < TSI2[1] Then
Sellcnt = Sellcnt+1;
if TRIXsig < TRIXsig[1] Then
Sellcnt = Sellcnt+1;
if SMIS < SMIS[1] Then
Sellcnt = Sellcnt+1;
답변 1
예스스탁 예스스탁 답변
2015-11-10 16:48:45
안녕하세요
예스스탁입니다.
해당식 timeCond가 지정한 시간안의 봉이면
true아니면 false를 리턴합니다.
식 정상적으로 작성된 식입니다.
input : 시작시간(120000),끝시간(20000);
var : TimeCond(false),Sellcnt(0),Sxcnt(0);
if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then
TimeCond = true;
if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간) Then
TimeCond = false;
if TimeCond == true and C > O Then
buy();
if TimeCond == true and C < O Then
sell();
위 식 적용해 보시면 첨부된 그림과 같이
해당 시간안에만 신호가 발생하는것을 확인할수 있습니다.
진입조건문에 timecond==true로 조건을 추가하시면 됩니다.
if timeCond == true and 매수조건 then
buy();
if timeCond == true and 매도조건 then
sell();
즐거운 하루되세요
> vmfha 님이 쓴 글입니다.
> 제목 : 부탁드립니다.
> 아래식은 예스님이 작성해주신건데요.
시간 적용이 되질않네요.
다시 검토 부탁드립니다.
input : 시작시간(120000),끝시간(20000);
var : TimeCond(false),Sellcnt(0),Sxcnt(0);
if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then
TimeCond = true;
if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간) Then
TimeCond = false;
#매도 조건만족 횟수 카운트
Sellcnt = 0;
if SROCsig2 < SROCsig2[1] Then
Sellcnt = Sellcnt+1;
if SonarSig2 < SonarSig2[1] Then
Sellcnt = Sellcnt+1;
if TSI2 < TSI2[1] Then
Sellcnt = Sellcnt+1;
if TRIXsig < TRIXsig[1] Then
Sellcnt = Sellcnt+1;
if SMIS < SMIS[1] Then
Sellcnt = Sellcnt+1;