커뮤니티

문의 드립니다.

프로필 이미지
줄리
2013-01-30 21:16:30
189
글번호 58904
답변완료
가령, Input : shortPeriod(5), longPeriod(10),shortPeriod1(20), longPeriod1(40),;; value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); value3 = ma(C, shortPeriod1); value4 = ma(C, longPeriod1); if 3 < 0 then --------------- If CrossUP(value1, value2) Then { Buy(); } If CrossDown(value1, value2) Then { Sell(); } if 3 > 0 then ---------------- If CrossUP(value3, value4) Then { Buy(); } If CrossDown(value3, value4) Then { Sell(); } (----------) 여기 잘못된거 같아요. 수정 해주세요. 감사합니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2013-01-31 10:28:33

안녕하세요 예스스탁입니다. 특정if문안에 여러개의 if문이 포함될때는 {}로 묶어주셔야 합니다. Input : shortPeriod(5), longPeriod(10),shortPeriod1(20), longPeriod1(40); value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); value3 = ma(C, shortPeriod1); value4 = ma(C, longPeriod1); if 3 < 0 then{ If CrossUP(value1, value2) Then { Buy(); } If CrossDown(value1, value2) Then { Sell(); } } if 3 > 0 then { If CrossUP(value3, value4) Then { Buy(); } If CrossDown(value3, value4) Then { Sell(); } } 즐거운 하루되세요 > 줄리 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 가령, Input : shortPeriod(5), longPeriod(10),shortPeriod1(20), longPeriod1(40),;; value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); value3 = ma(C, shortPeriod1); value4 = ma(C, longPeriod1); if 3 < 0 then --------------- If CrossUP(value1, value2) Then { Buy(); } If CrossDown(value1, value2) Then { Sell(); } if 3 > 0 then ---------------- If CrossUP(value3, value4) Then { Buy(); } If CrossDown(value3, value4) Then { Sell(); } (----------) 여기 잘못된거 같아요. 수정 해주세요. 감사합니다.