커뮤니티

no.15495 재질문요.

프로필 이미지
회원
2010-09-07 12:09:02
797
글번호 32217
답변완료

첨부 이미지

input:기간1(30),기간2(15); var: 기간값1(0),기간값2(0); 기간값1=((Accumn(h,기간1)/기간1)+(Accumn(l,기간1)/기간1))/2; #중기 평균1 기간값2=((Accumn(h,기간2)/기간2)+(Accumn(l,기간2)/기간2))/2; #단기 평균2 if c>ma(c,60)then buy("매수"); #상한가 이익 청산 if c>EntryPrice*1.01 then{ If 기간값2>기간값1 and c>기간값2 then{ if CrossDown(c,기간값2)then{ Condition1=true; if Condition1==true then{ if CrossDown(c,기간값1) then{ ExitLong("상한가"); } } } } } if 기간값1>기간값2 or c>기간값2 Then condition1=False; no.15495에서 답변 받은 것처럼 condition 수식 넣어서 해 봤는데 제대로 나오지 않습니다. 첨부그림 의 표시 자리에서 매도 가 나와야 하는데 나오지 않습니다. 식 수정 및 설명 바랍니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2010-09-07 13:44:05

안녕하세요 예스스탁입니다. if c>EntryPrice*1.01 then{#1 If 기간값2>기간값1 and c>기간값2 then{#2 if CrossDown(c,기간값2)then{#3 Condition1=true; if Condition1==true then{#4 if CrossDown(c,기간값1) then{ #5 ExitLong("상한가"); } } } } } 작성하신 청산식은 괄호쓰기에 의해 #1,#2,#3,#4,#5가 모두 한봉에 만족해야 청산이 나오는 식입니다. 서로 동시만족할 내용과 아닌내용을 구분하여 괄호치기를 하셔야 합니다. c>EntryPrice*1.01은 어느내용에 포함되는지 몰라 추가하지 않았습니다. 수정된 식입니다. if 기간값1 < 기간값2 Then{ if CrossDown(c,기간값2) Then Condition1 = true; if Condition1 == true and CrossDown(c,기간값1) Then exitlong(); } if 기간값1 > 기간값2 or C > 기간값2 Then Condition1 = false; 즐거운 하루되세요 > HI_coco 님이 쓴 글입니다. > 제목 : no.15495 재질문요. > input:기간1(30),기간2(15); var: 기간값1(0),기간값2(0); 기간값1=((Accumn(h,기간1)/기간1)+(Accumn(l,기간1)/기간1))/2; #중기 평균1 기간값2=((Accumn(h,기간2)/기간2)+(Accumn(l,기간2)/기간2))/2; #단기 평균2 if c>ma(c,60)then buy("매수"); #상한가 이익 청산 if c>EntryPrice*1.01 then{ If 기간값2>기간값1 and c>기간값2 then{ if CrossDown(c,기간값2)then{ Condition1=true; if Condition1==true then{ if CrossDown(c,기간값1) then{ ExitLong("상한가"); } } } } } if 기간값1>기간값2 or c>기간값2 Then condition1=False; no.15495에서 답변 받은 것처럼 condition 수식 넣어서 해 봤는데 제대로 나오지 않습니다. 첨부그림 의 표시 자리에서 매도 가 나와야 하는데 나오지 않습니다. 식 수정 및 설명 바랍니다.