커뮤니티
시스템
2009-04-20 09:46:31
1049
글번호 21787
아래 별표부분 배열이 이해가 되지 않습니다.]
초보자라 생각하시고 자세한 설명 부탁드려요
Input: FastMA(9),SlowMA(26),MacdMA(4), NCOs(4), NBars(50), Trailbar(6);
Vars: MVal(0), MAvg(0), MDif(0), Counter(0), TotalBars(0), HighestHi(0), LowestLo(0);
Array: cov[2,50](0);
MVal = MACD(FastMA,SlowMA);
MAvg = ema(MACD(FastMA,SlowMA),MacdMA);
MDif = MVal - MAvg;
//{ Store the MACD Cross information in the cov array }
if crossup(MDif, 0) OR CrossDown(MDIF, 0) Then Begin
*******For counter = 0 to 49 Begin
cov[ 0 , 50 - counter ] = cov[ 0 , 49 - counter ];
cov[ 1 , 50 - counter ] = cov[ 1 , 49 - counter ];
cov[ 2 , 50 - counter ] = cov[ 2 , 49 - counter ];
End;
cov[ 0, 0] = CurrentBar;
cov[ 1, 0] = High;
cov[ 2, 0] = Low;
End; ********
답변 1
예스스탁 예스스탁 답변
2009-04-20 15:38:29
안녕하세요
예스스탁입니다.
해당식은 2차원 배열문입니다.
MDif(MACD 오실레이터)값이 0선을 상향돌파하거나 하향돌파를 할때
그 시점의 currentbar와 고가 저가를 저장하고
다시 상향돌파나 하향돌파가 일어나면
현재시점의 값을 저장한 후 전 상향돌파나 하향돌파 값을
바로 다음배열방으로 옮겨 저장하는 식입니다.
즉 간단히 현재 돌파시점의 값을 0번방에 저장하고
다시 돌파가 일어나면 0번값을 현재값으로 변경하고
원래 0번방의 값을 뒷방(1번방)으로 옮기고
원래 1번방의 값은 2번방으로 옮기는 작업을 순차적으로 하는 식입니다.
Input: FastMA(9),SlowMA(26),MacdMA(4), NCOs(4), NBars(50), Trailbar(6);
Vars: MVal(0), MAvg(0), MDif(0), Counter(0), TotalBars(0), HighestHi(0), LowestLo(0);
Array: cov[2,50](0);
MVal = MACD(FastMA,SlowMA);
MAvg = ema(MACD(FastMA,SlowMA),MacdMA);
MDif = MVal - MAvg;
//{ Store the MACD Cross information in the cov array }
if crossup(MDif, 0) OR CrossDown(MDIF, 0) Then Begin
For counter = 0 to 49 Begin
cov[ 0 , 50 - counter ] = cov[ 0 , 49 - counter ];
cov[ 1 , 50 - counter ] = cov[ 1 , 49 - counter ];
cov[ 2 , 50 - counter ] = cov[ 2 , 49 - counter ];
End;
cov[ 0, 0] = CurrentBar;
cov[ 1, 0] = High;
cov[ 2, 0] = Low;
End;
이용에 참고하시기 바랍니다.
즐거운 하루되세요
> 하늘땅 님이 쓴 글입니다.
> 제목 : 시스템
> 아래 별표부분 배열이 이해가 되지 않습니다.]
초보자라 생각하시고 자세한 설명 부탁드려요
Input: FastMA(9),SlowMA(26),MacdMA(4), NCOs(4), NBars(50), Trailbar(6);
Vars: MVal(0), MAvg(0), MDif(0), Counter(0), TotalBars(0), HighestHi(0), LowestLo(0);
Array: cov[2,50](0);
MVal = MACD(FastMA,SlowMA);
MAvg = ema(MACD(FastMA,SlowMA),MacdMA);
MDif = MVal - MAvg;
//{ Store the MACD Cross information in the cov array }
if crossup(MDif, 0) OR CrossDown(MDIF, 0) Then Begin
*******For counter = 0 to 49 Begin
cov[ 0 , 50 - counter ] = cov[ 0 , 49 - counter ];
cov[ 1 , 50 - counter ] = cov[ 1 , 49 - counter ];
cov[ 2 , 50 - counter ] = cov[ 2 , 49 - counter ];
End;
cov[ 0, 0] = CurrentBar;
cov[ 1, 0] = High;
cov[ 2, 0] = Low;
End; ********
다음글
이전글