커뮤니티

차이점?

프로필 이미지
노블레스
2011-10-06 08:10:04
506
글번호 43397
답변완료
if date != date[1] Then{ Condition1 = false; Condition2 = Condition1[1]; } if Crossup(c,A) Then{ Condition1 = true; } if MarketPosition == 0 and count == 0 Then{ if Condition2 == true and crossdown(c,B) Then buy("A"); } ----------------------------------------------------------> 가 if date != date[1] Then{ Condition1 = false; Condition2 = Condition1[1]; if Crossup(c,A) Then Condition1 = true; } if MarketPosition == 0 and count == 0 Then{ if Condition2 == true and crossdown(c,B) Then buy("A"); } --------------------------------------------------> 나 if date != date[1] Then{ Condition1 = false; Condition2 = Condition1[1]; } if MarketPosition == 0 and count == 0 Then{ if Crossup(c,A) Then Condition1 = true; if Condition2 == true and crossdown(c,B) Then buy("A"); } ----------------------------------------------------> 다 가, 나,다 에서 "{ " 위치에 따라 수익결과가 틀려집니다. 간단하게 설명좀 해주세요
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2011-10-06 11:18:33

안녕하세요 예스스탁입니다. #C-A조건식 if Crossup(c,A) Then Condition1 = true; 위 #C-A조건식이 어디에 포함되는지를 판단하시면 됩니다. 가번식의 경우에는 if date != date[1] Then{ Condition1 = false; Condition2 = Condition1[1]; } if Crossup(c,A) Then{ Condition1 = true; } #C-A조건식이 다른 if문에 포함되지 않고 독립이 되어 있습니다. 이후에 어떤 봉이라도 종가가 A를 상향돌파하면 true가 됩니다. 나번식의 경우에는 if date != date[1] Then{ Condition1 = false; Condition2 = Condition1[1]; if Crossup(c,A) Then Condition1 = true; } #C-A조건식이 if date != date[1] Then{ ) 조건에 포함이 되어 있으므로 당일 첫봉에서만 동작이 됩니다. 즉 당일 첫봉에서 종가가 A를 상향돌파 해야만 true값을 가지게 됩니다. 이후에 봉에서 종가가 A를 돌파해도 true값을 가질수 없습니다. 다번식의 경우에는 #C-A조건식이 if MarketPosition == 0 and count == 0 Then{) 조건에 포함이 되어 있으므로 현재 무포지션이고 count가 0일때만 종가가 A를 상향돌파해야만 true값을 가지게 됩니다, 수식에서 {}는 영역을 나타내게 됩니다 {}안에 포함시키면 상위 if문도 같이 만족을 해야만 동작을 하게 되므로 {}는 작성의도에 맞게 사용하셔야 합니다. 즐거운 하루되세요 > 노블레스 님이 쓴 글입니다. > 제목 : 차이점? > if date != date[1] Then{ Condition1 = false; Condition2 = Condition1[1]; } if Crossup(c,A) Then{ Condition1 = true; } if MarketPosition == 0 and count == 0 Then{ if Condition2 == true and crossdown(c,B) Then buy("A"); } ----------------------------------------------------------> 가 if date != date[1] Then{ Condition1 = false; Condition2 = Condition1[1]; if Crossup(c,A) Then Condition1 = true; } if MarketPosition == 0 and count == 0 Then{ if Condition2 == true and crossdown(c,B) Then buy("A"); } --------------------------------------------------> 나 if date != date[1] Then{ Condition1 = false; Condition2 = Condition1[1]; } if MarketPosition == 0 and count == 0 Then{ if Crossup(c,A) Then Condition1 = true; if Condition2 == true and crossdown(c,B) Then buy("A"); } ----------------------------------------------------> 다 가, 나,다 에서 "{ " 위치에 따라 수익결과가 틀려집니다. 간단하게 설명좀 해주세요