아래와 같이 코딩했을 때 오류 발생 문의 드립니다
===============================================================================
1 moving20= ma(c,20);
2 moving200= ma(c,200);
3
4 buycondition= c > moving20 and c > moving200 and MarketPosition==0 ;
5 sellcondition= c < moving20 and c < moving200 and marketposition==0 ;
=========================================================================
위 4,5줄에서
'연산자 앞뒤 두 데이터의 형태가 같아야 합니다'라는 오류가 나오는데 도움 부탁 드립니다
답변 1
예스스탁
예스스탁 답변
2021-04-26 10:54:39
안녕하세요
예스스탁입니다.
buycondition와 sellcondition은 조건식의 결과가 저장됩니다.
선언시 false로 선언하시면 됩니다.
var : moving20(0),moving200(0),buycondition(False),sellcondition(False);
moving20= ma(c,20);
moving200= ma(c,200);
buycondition= c > moving20 and c > moving200 and MarketPosition==0 ;
sellcondition= c < moving20 and c < moving200 and marketposition==0 ;
즐거운 하루되세요
> 기픈바다 님이 쓴 글입니다.
> 제목 : 코딩오류
> 아래와 같이 코딩했을 때 오류 발생 문의 드립니다
===============================================================================
1 moving20= ma(c,20);
2 moving200= ma(c,200);
3
4 buycondition= c > moving20 and c > moving200 and MarketPosition==0 ;
5 sellcondition= c < moving20 and c < moving200 and marketposition==0 ;
=========================================================================
위 4,5줄에서
'연산자 앞뒤 두 데이터의 형태가 같아야 합니다'라는 오류가 나오는데 도움 부탁 드립니다