커뮤니티

시스템 작성 배열이 맞나요?

프로필 이미지
노블레스
2011-10-04 16:36:17
525
글번호 43333
답변완료
var : Bcnt(0),Scnt(0),cnt(0),count(0); Bcnt = 0; Scnt = 0; count = 0; for cnt = 0 to 10{ if sdate == EntryDate(cnt) Then Count = count+1; if sdate == EntryDate(cnt) and MarketPosition(cnt) == 1 then Bcnt = Bcnt+1; if sdate == EntryDate(cnt) and MarketPosition(cnt) == -1 then Scnt = Scnt+1; } if date != date[1] Then{ Condition1 = false; Condition2 = Condition1[1]; if CrossDown(c,ma(c,20)) Then Condition1 = true; } if MarketPosition == 0 and count == 0 Then{ if Condition2 == true and crossup(c,ma(C,60)) Then sell("A"); } if MarketPosition != 0 and count > 0 Then{ if isentryname("A")and BarsSinceEntry>=9 and crossdown(c, 235) then ExitShort("B"); } SetStopEndofday(150000);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2011-10-05 10:02:02

안녕하세요 예스스탁입니다. 첫봉에서만 20이평 하향이탈을 감지하는 식이면 작성하신 식이 맞습니다. 만약 당일 20이평을 한번 하향돌파한 이후에 60이평을 하향이탈하면 매도하는 식이시면 아래와 같이 해당 부분을 변경하셔야 합니다. if date != date[1] Then{ Condition1 = false; Condition2 = Condition1[1]; } if CrossDown(c,ma(c,20)) Then{ Condition1 = true; } 즐거운 하루되세요 > 노블레스 님이 쓴 글입니다. > 제목 : 시스템 작성 배열이 맞나요? > var : Bcnt(0),Scnt(0),cnt(0),count(0); Bcnt = 0; Scnt = 0; count = 0; for cnt = 0 to 10{ if sdate == EntryDate(cnt) Then Count = count+1; if sdate == EntryDate(cnt) and MarketPosition(cnt) == 1 then Bcnt = Bcnt+1; if sdate == EntryDate(cnt) and MarketPosition(cnt) == -1 then Scnt = Scnt+1; } if date != date[1] Then{ Condition1 = false; Condition2 = Condition1[1]; if CrossDown(c,ma(c,20)) Then Condition1 = true; } if MarketPosition == 0 and count == 0 Then{ if Condition2 == true and crossup(c,ma(C,60)) Then sell("A"); } if MarketPosition != 0 and count > 0 Then{ if isentryname("A")and BarsSinceEntry>=9 and crossdown(c, 235) then ExitShort("B"); } SetStopEndofday(150000);