커뮤니티

이거 미치겠네요

프로필 이미지
초심자의행운
2022-03-04 05:23:59
1190
글번호 156923
답변완료
Condition99= (sTime >= 90000 and sTime <= 110000) ; if Condition99==true and (Condition3 or Condition4) or( Var4[1]>Var4 and Var4[2]<Var4[1]) and condition14 Then {Sell("short");} 인데 정해놓은 시간 외에도 매도신호가 발생하는 이유가 뭔가요?... and 와 or 를 잘못 사용하고 있는건가요? 설명좀부탁드립니다 ㅜㅠ
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2022-03-04 11:52:01

안녕하세요 예스스탁입니다. if문에 and와 or가 복수이면 ()로 조건을 묶어 우선순위를 지정하셔야 합니다. 작성하신 식은 Condition99==true가 (Condition3 or Condition4)에만 해당됩니다. 즉 2개조건만족시 매도입니다. 1. Condition99==true and (Condition3 or Condition4) 2. ( Var4[1]>Var4 and Var4[2]<Var4[1]) and condition14 Condition99==true가 모든 조건에 해당되도록 아래와 같이 ()로 묶어 주시면 됩니다. Condition99==true and((Condition3 or Condition4) or( Var4[1]>Var4 and Var4[2]<Var4[1]) and condition14) 즐거운 하루되세요 > 초심자의행운 님이 쓴 글입니다. > 제목 : 이거 미치겠네요 > Condition99= (sTime >= 90000 and sTime <= 110000) ; if Condition99==true and (Condition3 or Condition4) or( Var4[1]>Var4 and Var4[2]<Var4[1]) and condition14 Then {Sell("short");} 인데 정해놓은 시간 외에도 매도신호가 발생하는 이유가 뭔가요?... and 와 or 를 잘못 사용하고 있는건가요? 설명좀부탁드립니다 ㅜㅠ