커뮤니티
오류수정 요청드립니다
2019-06-28 20:37:39
161
글번호 129864
<1>아래와 같이 시스템식 입력하면 에서 연산자 앞 뒤 두데이터의 형태가 같아야 합니다.라고 오류가 뜨네요.. 수정부탁드립니다.
input:shortP(12),longP(26),midP(9);
var:macdVal(0),macdSig(0),disp(0);
macdVal=MACD(shortP,longP);
macdSig=ema(macdVal,midP);
disp=ma(C,5)/ma(C,60)*100>102;//③
if CrossUP(macdVal,macdSig)and disp then
Buy();
if CrossDown(macdVal,macdSig)then
ExitLong();
<2>아래 시스템식에서는 오류가 2군데 나와서 수식 수정부탁드립니다.
input:P1(20),P2(12),P3(10),P4(6),P5(5),P6(3),BaseLine(50);
var:Sto1(0),Sto2(0),Sto3(0);
Sto1=StochasticsK(P1,P2);
Sto2=StochasticsK(P3,P4);
Sto3=StochasticsK(P5,P6);
if Sto1>BaseLine and Sto1[2]<Sto1[1] and Sto1[1]<Sto1 and
Sto2>BaseLine and Sto2[2]<Sto2[1 and Sto2[1]<Sto2 and
Sto3[2]>Sto3[1] and Sto3[1]<Sto3 then
Buy();
if Sto1<BaseLine and Sto1[2]>Sto1[1] and Sto1[1]>Sto1 and
Sto2<BaseLine and Sto2[2]>Sto2[1] and Sto2[1]>Sto2 and
Sto3[2]<Sto3[1] and Sto3[1]>Sto3 then
Sell();
답변 1
예스스탁 예스스탁 답변
2019-07-01 10:34:12
안녕하세요
예스스탁입니다.
1
변수에 숫자가 저장되면 0, 조건문이 저장되면 false로
변수의 선언을 지정해 주셔야 합니다.
해당 수식은 모두 0으롬만 설정이 되어 있습니다.
input:shortP(12),longP(26),midP(9);
var:macdVal(0),macdSig(0),disp(false);
macdVal=MACD(shortP,longP);
macdSig=ema(macdVal,midP);
disp=ma(C,5)/ma(C,60)*100>102;//③
if CrossUP(macdVal,macdSig)and disp then
Buy();
if CrossDown(macdVal,macdSig)then
ExitLong();
2
수식 중간에 [ ] 사용에 오류가 있었습니다.
input:P1(20),P2(12),P3(10),P4(6),P5(5),P6(3),BaseLine(50);
var:Sto1(0),Sto2(0),Sto3(0);
Sto1=StochasticsK(P1,P2);
Sto2=StochasticsK(P3,P4);
Sto3=StochasticsK(P5,P6);
if Sto1>BaseLine and Sto1[2]<Sto1[1] and Sto1[1]<Sto1 and
Sto2>BaseLine and Sto2[2]<Sto2[1] and Sto2[1]<Sto2 and
Sto3[2]>Sto3[1] and Sto3[1]<Sto3 then
Buy();
if Sto1<BaseLine and Sto1[2]>Sto1[1] and Sto1[1]>Sto1 and
Sto2<BaseLine and Sto2[2]>Sto2[1] and Sto2[1]>Sto2 and
Sto3[2]<Sto3[1] and Sto3[1]>Sto3 then
Sell();
즐거운 하루되세요
> 이대표 님이 쓴 글입니다.
> 제목 : 오류수정 요청드립니다
> <1>아래와 같이 시스템식 입력하면 에서 연산자 앞 뒤 두데이터의 형태가 같아야 합니다.라고 오류가 뜨네요.. 수정부탁드립니다.
input:shortP(12),longP(26),midP(9);
var:macdVal(0),macdSig(0),disp(0);
macdVal=MACD(shortP,longP);
macdSig=ema(macdVal,midP);
disp=ma(C,5)/ma(C,60)*100>102;//③
if CrossUP(macdVal,macdSig)and disp then
Buy();
if CrossDown(macdVal,macdSig)then
ExitLong();
<2>아래 시스템식에서는 오류가 2군데 나와서 수식 수정부탁드립니다.
input:P1(20),P2(12),P3(10),P4(6),P5(5),P6(3),BaseLine(50);
var:Sto1(0),Sto2(0),Sto3(0);
Sto1=StochasticsK(P1,P2);
Sto2=StochasticsK(P3,P4);
Sto3=StochasticsK(P5,P6);
if Sto1>BaseLine and Sto1[2]<Sto1[1] and Sto1[1]<Sto1 and
Sto2>BaseLine and Sto2[2]<Sto2[1 and Sto2[1]<Sto2 and
Sto3[2]>Sto3[1] and Sto3[1]<Sto3 then
Buy();
if Sto1<BaseLine and Sto1[2]>Sto1[1] and Sto1[1]>Sto1 and
Sto2<BaseLine and Sto2[2]>Sto2[1] and Sto2[1]>Sto2 and
Sto3[2]<Sto3[1] and Sto3[1]>Sto3 then
Sell();
다음글
이전글