커뮤니티

답변주신 수식을 이해할수 없어 질문 올립니다...

프로필 이미지
sdfxwe
2011-05-16 20:30:01
588
글번호 38701
답변완료
함수로는 slowD만 있고 K가 없어 풀어 작성하셔야 합니다. Inputs: Intervals(5), Length(10); Variables: Factor(.5), BarCount(0), Counter(0); Arrays: FastDArray[2](0), SlowDArray[2](0); if _IsNewBar_1m(Intervals) then begin BarCount = BarCount + 1; for Counter = 2 downto 1 begin FastDArray[Counter] = FastDArray[Counter - 1]; SlowDArray[Counter] = SlowDArray[Counter - 1]; end; if BarCount <= 1 then begin FastDArray[0] = FastK(Length * Intervals); SlowDArray[0] = FastDArray[0]; end else begin FastDArray[0] = FastDArray[1] + (Factor * (FastK(Length * Intervals) - FastDArray[1])); SlowDArray[0] = ((SlowDArray[1] * 2) + (FastDArray[1] + (Factor * (FastK(Length * Intervals) - FastDArray[1])))) / 3; end; end; If Crossdown(FastDArray[0], SlowDArray[0]) Then sell(); If Crossup(FastDArray[0], SlowDArray[0]) Then buy(); 이렇게 올려 주셨는데 k가 없어 풀어사용하여야 한다는 말은 어떤 의미 이며 제일 밑의 if crossdown 이 부분을 Input : Period(5), Period1(3), Period2(3); value1 = StochasticsK(Period,Period1); value2 = StochasticsD(Period,Period1,Period2); # 매도 If Crossdown(value1, value2) Then { sell(); } # 매도청산 If Crossup(value1, value2) Then { buy(); } 여기에 바꿔서 넣어보니 선언되지 않은 것이 사용되었다면서 사용이 안되는데 어떻게 사용하여야 하는것인지요??
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2011-05-17 10:29:20

안녕하세요 예스스탁입니다. 사용자함수는 slowD값만 리턴하는 함수입니다. 2개선의 교차식으로 만들어야 하므로 slowK값이 있어야 하므로 slowD값의 함수식예 SlowK계산한느 내용이 있으므로 풀어서 작성해야 하므로 아래와 같이 풀어서 작성해 드린것입니다. Inputs: Intervals(5), Length(10); Variables: Factor(.5), BarCount(0), Counter(0); Arrays: FastDArray[2](0), SlowDArray[2](0); if _IsNewBar_1m(Intervals) then begin BarCount = BarCount + 1; for Counter = 2 downto 1 begin FastDArray[Counter] = FastDArray[Counter - 1]; SlowDArray[Counter] = SlowDArray[Counter - 1]; end; if BarCount <= 1 then begin FastDArray[0] = FastK(Length * Intervals); SlowDArray[0] = FastDArray[0]; end else begin FastDArray[0] = FastDArray[1] + (Factor * (FastK(Length * Intervals) - FastDArray[1])); SlowDArray[0] = ((SlowDArray[1] * 2) + (FastDArray[1] + (Factor * (FastK(Length * Intervals) - FastDArray[1])))) / 3; end; end; If Crossdown(FastDArray[0], SlowDArray[0]) Then sell(); If Crossup(FastDArray[0], SlowDArray[0]) Then buy(); 즐거운 하루되세요 > sdfxwe 님이 쓴 글입니다. > 제목 : 답변주신 수식을 이해할수 없어 질문 올립니다... > 함수로는 slowD만 있고 K가 없어 풀어 작성하셔야 합니다. Inputs: Intervals(5), Length(10); Variables: Factor(.5), BarCount(0), Counter(0); Arrays: FastDArray[2](0), SlowDArray[2](0); if _IsNewBar_1m(Intervals) then begin BarCount = BarCount + 1; for Counter = 2 downto 1 begin FastDArray[Counter] = FastDArray[Counter - 1]; SlowDArray[Counter] = SlowDArray[Counter - 1]; end; if BarCount <= 1 then begin FastDArray[0] = FastK(Length * Intervals); SlowDArray[0] = FastDArray[0]; end else begin FastDArray[0] = FastDArray[1] + (Factor * (FastK(Length * Intervals) - FastDArray[1])); SlowDArray[0] = ((SlowDArray[1] * 2) + (FastDArray[1] + (Factor * (FastK(Length * Intervals) - FastDArray[1])))) / 3; end; end; If Crossdown(FastDArray[0], SlowDArray[0]) Then sell(); If Crossup(FastDArray[0], SlowDArray[0]) Then buy(); 이렇게 올려 주셨는데 k가 없어 풀어사용하여야 한다는 말은 어떤 의미 이며 제일 밑의 if crossdown 이 부분을 Input : Period(5), Period1(3), Period2(3); value1 = StochasticsK(Period,Period1); value2 = StochasticsD(Period,Period1,Period2); # 매도 If Crossdown(value1, value2) Then { sell(); } # 매도청산 If Crossup(value1, value2) Then { buy(); } 여기에 바꿔서 넣어보니 선언되지 않은 것이 사용되었다면서 사용이 안되는데 어떻게 사용하여야 하는것인지요??