코딩하는 방법? - 페이지 337

 
at120:
안녕 믈라덴!

테스트 및 일반(데이터 내보내기 또는 인디로 사용)에서 내 iCustom의 호출이 옳다고 생각합니다.

그것은 지금까지 잘 작동합니다. 문제는 값 이중/배열을 언급했듯이 문제라고 생각합니다.

내가 지금 사용할 때

더블맘1[];

엄마1 = iCustom(NULL,0,"myIndi",0,i);

그리고 a보다 -> mom(mom1,Bars,20,i);

-> "엄마" - 매개변수 대화가 허용되지 않음

이거 어떻게 쓰는게 맞나요?

감사합니다. AT

다음과 같이 시도하십시오.

mom(mom1,Bars,20,i);[/PHP]

Also, change the mom function to be like this :

[PHP]double Mom(double& series[], int period, int totcount, int index) { if (totcount<1 || period<1) return (EMPTY_VALUE); if (indextotcount-1) return (EMPTY_VALUE); return (series-series); }
 

안녕 믈라덴!

당신의 도움을 주셔서 감사합니다!

내 문제는 프로그램의 다른 부분이 필요하기 때문에 "const"가 필요하다는 것입니다...

"모든 것"을 새로 작성하는 것은 너무 많은 작업이므로 문제는 반대로 할 수 있습니까?

그래서 mom1이 하위 기능 과 함께 작동합니까?

감사합니다. AT

 
at120:
안녕 믈라덴!

당신의 도움을 주셔서 감사합니다!

내 문제는 프로그램의 다른 부분이 필요하기 때문에 "const"가 필요하다는 것입니다...

"모든 것"을 새로 작성하는 것은 너무 많은 작업이므로 문제는 반대로 할 수 있습니까?

mom1이 하위 기능과 함께 작동하도록?

감사합니다. AT

mom 기능 을 그대로 사용할 수 있습니다.

엄마 를 바꾸세요 ( mom1 , Bars , 20 , i ). 엄마에게 ( mom1 , Bars , 20 , i );

 

그런 다음 오류가 발생합니다.

-> "mom1" - 매개변수 대화가 허용되지 않음

이건 까다롭습니다... 다른 생각은 없나요?

감사합니다. AT

 
at120:
그런 다음 오류가 발생합니다.

-> "mom1" - 매개변수 대화가 허용되지 않음

이건 까다롭습니다... 다른 생각은 없나요?

감사합니다. AT

나는 그 오류가 발생하지 않습니다

예를 참조하십시오.

#property indicator_chart_window

double buffer[];

int init() { SetIndexBuffer(0,buffer); return(0); }

int deinit() { return(0); }

int start()

{

double mom = Mom(buffer,10,50,0);

return(0);

}

double Mom(const double& series[], int period, int totcount, int index)

{

if (totcount<1 || period<1) return (EMPTY_VALUE);

if (indextotcount-1) return (EMPTY_VALUE);

return (series-series);

}

오류가 전혀 없는 컴파일

 

안녕 믈라덴!

아마도 for {} 함수 때문일까요? (바를 얻기 위해?) 또는 때문에...

다른 요점은 다음과 같습니다. mom1은 사용자 지정 인디... mom1 = iCustom(NULL,0,"myIndi",0,i);

내가 여기에서 부르는 것: mom(mom1,Bars,20,i);

당신의 도움을 주셔서 감사합니다!!

안녕, AT

 
at120:
안녕 믈라덴!

for {} 함수 때문일까요? (바를 얻기 위해?) 또는 때문에...

다른 요점은 다음과 같습니다. mom1은 사용자 지정 인디... mom1 = iCustom(NULL,0,"myIndi",0,i);

내가 여기에서 부르는 것: mom(mom1,Bars,20,i);

당신의 도움을 주셔서 감사합니다!!

안녕, AT

아니 그게 원인이 될 수 없다.

다음 예를 참조하십시오.

#property indicator_chart_window

double buffer[];

int init() { SetIndexBuffer(0,buffer); return(0); }

int deinit() { return(0); }

int start()

{

int counted_bars=IndicatorCounted();

if(counted_bars<0) return(-1);

if(counted_bars>0) counted_bars--;

int limit = MathMin(Bars-counted_bars,Bars-1);

for(int i = limit; i>=0; i--)

{

buffer = iCustom(NULL,0,"custom name",0,i);

double mom = Mom(buffer,10,50,i);

}

return(0);

}

double Mom(const double& series[], int period, int totcount, int index)

{

if (totcount<1 || period<1) return (EMPTY_VALUE);

if (indextotcount-1) return (EMPTY_VALUE);

return (series-series);

}

또한 컴파일러 오류가 전혀 없습니다.

 

안녕 믈라덴!

아마도 내 코드가 이와 비슷하고 "오류"가 있기 때문일 수 있습니다... :-/

#property indicator_chart_window

double buffer[];

int init() { SetIndexBuffer(0,buffer); return(0); }

int deinit() { return(0); }

int start()

{

int counted_bars=IndicatorCounted();

if(counted_bars<0) return(-1);

if(counted_bars>0) counted_bars--;

int limit = MathMin(Bars-counted_bars,Bars-1);

for(int i = limit; i>=0; i--)

{

double mom1;

mom1 = iCustom(NULL,0,"custom name",0,i);

buffer = (

Mom(mom1,10,Bars,i);

);

}

return(0);

}

double Mom(const double& series[], int period, int totcount, int index)

{

if (totcount<1 || period<1) return (EMPTY_VALUE);

if (indextotcount-1) return (EMPTY_VALUE);

return (series-series);

}

);

감사합니다. AT

 
at120:
안녕 믈라덴!

아마도 내 코드가 이와 비슷하고 "오류"가 있기 때문일 수 있습니다... :-/

#property indicator_chart_window

double buffer[];

int init() { SetIndexBuffer(0,buffer); return(0); }

int deinit() { return(0); }

int start()

{

int counted_bars=IndicatorCounted();

if(counted_bars<0) return(-1);

if(counted_bars>0) counted_bars--;

int limit = MathMin(Bars-counted_bars,Bars-1);

for(int i = limit; i>=0; i--)

{

double mom1;

mom1 = iCustom(NULL,0,"custom name",0,i);

buffer = (

Mom(mom1,10,Bars,i);

);

}

return(0);

}

double Mom(const double& series[], int period, int totcount, int index)

{

if (totcount<1 || period<1) return (EMPTY_VALUE);

if (indextotcount-1) return (EMPTY_VALUE);

return (series-series);

}

);
감사합니다. AT

120시에

코드에서 mom1은 배열이나 버퍼가 아닌 이중(단순 이중 변수)으로 정의됩니다.

"버퍼"가 정의된 것과 같은 방식으로 정의하고 초기화 섹션에서 버퍼에 추가하면 문제가 해결됩니다( 버퍼 번호를 적절하게 조정해야 함).

 

안녕 말든!

지원해 주셔서 감사합니다! ;-)

당신이 나에게 말한 것처럼 코드를 작성할 때조차도 :

(그렇게 생각해요...)

#property indicator_chart_window

double buffer[];

double mom1[];

int init() { SetIndexBuffer(0,buffer); SetIndexBuffer(1,mom1);return(0); }

int deinit() { return(0); }

int start()

{

int counted_bars=IndicatorCounted();

if(counted_bars<0) return(-1);

if(counted_bars>0) counted_bars--;

int limit = MathMin(Bars-counted_bars,Bars-1);

for(int i = limit; i>=0; i--)

{

mom1 = iCustom(NULL,0,"custom name",0,i);

buffer = (

Mom(mom1,10,Bars,i);

//doesn't work - no value in indi

// Mom(mom1,10,Bars,i); //error: parameter conversation not allowed

// mom1 // this works

);

}

return(0);

}

double Mom(const double& series[], int period, int totcount, int index)

{

if (totcount<1 || period<1) return (EMPTY_VALUE);

if (indextotcount-1) return (EMPTY_VALUE);

return (series-series);

}

);

그래서 "First" 버전을 사용할 때 가치가 없습니다.

두 번째 버전을 사용하면 오류가 발생합니다... 흠.

mom1이 작동한다고 만 호출하십시오 ... 그러나 이것은 올바른 값이 아닙니다 ...

당신의 도움을 주셔서 감사합니다!

안녕, AT