커뮤니티
부탁드립니다.
2012-06-07 22:28:05
243
글번호 51778
일봉에서 data2 참조없이 주봉용 지표를 사용하려고 합니다.
아래의 식을 일봉에서 주봉용으로 참조가능하게 부탁드립니다.
감사합니다.
===============================================
inputs: Length(5);
Vars: halvedLength(0), sqrRootLength(0);
if ((ceiling(length / 2) - (length / 2)) <= 0.5) then
halvedLength = ceiling(length / 2);
else
halvedLength = floor(length / 2);
if ((ceiling(SquareRoot(length)) - SquareRoot(length)) <= 0.5) then
sqrRootLength = ceiling(SquareRoot(length));
else
sqrRootLength = floor(SquareRoot(length));
Value1 = 2 * WMA(C, halvedLength);
Value2 = WMA(C, length);
Value3 = WMA((Value1 - Value2), sqrRootLength);
Value4 = EMA(Value3, Length);
if Crossup(Value3, Value4) then
Buy();
===============================================
답변 1
예스스탁 예스스탁 답변
2012-06-08 11:34:18
안녕하세요
예스스탁입니다.
inputs: Length(5);
Vars: halvedLength(0), sqrRootLength(0);
Var : Ep(0), JISU(0), DINDEX(0), PreJISU(0),cnt(0);
var : Sum1(0),Csum1(0),counter1(0),wma1(0);
var : Sum2(0),Csum2(0),counter2(0),wma2(0);
var : Sum3(0),Csum3(0),counter3(0),wma3(0);
Array : CC[100](0),Diff[100](0);
if ((ceiling(length / 2) - (length / 2)) <= 0.5) then
halvedLength = ceiling(length / 2);
else
halvedLength = floor(length / 2);
if ((ceiling(SquareRoot(length)) - SquareRoot(length)) <= 0.5) then
sqrRootLength = ceiling(SquareRoot(length));
else
sqrRootLength = floor(SquareRoot(length));
Ep = 2/(Length+1);
if dayofweek(date) < dayofweek(date[1]) then {
DINDEX = DINDEX + 1;
PreJISU = JISU[1];
for cnt = 1 to 99{
CC[cnt] = CC[cnt-1][1];
Diff[cnt] = Diff[cnt-1][1];
}
}
CC[0] = C;
Sum1 = 0;
CSum1 = 0;
if CC[halvedLength] > 0 then{
For counter1 = 0 To halvedLength - 1 Begin
Sum1 = Sum1 + CC[counter1] * (halvedLength - counter1);
CSum1 = CSum1 + halvedLength - counter1;
End;
If CSum1 > 0 Then
WMA1 = Sum1 / CSum1;
Else
WMA1 = 0;
}
Sum2 = 0;
CSum2 = 0;
if CC[Length] > 0 then{
For counter2 = 0 To Length - 1 Begin
Sum2 = Sum2 + CC[counter2] * (Length - counter2);
CSum2 = CSum2 + Length - counter2;
End;
If CSum2 > 0 Then
WMA2 = Sum2 / CSum2;
Else
WMA2 = 0;
}
Diff[0] = (2*WMA1-WMA2);
Sum3 = 0;
CSum3 = 0;
if Diff[sqrRootLength] > 0 then{
For counter3 = 0 To sqrRootLength - 1 Begin
Sum3 = Sum3 + Diff[counter3] * (sqrRootLength - counter3);
CSum3 = CSum3 + sqrRootLength - counter3;
End;
If CSum3 > 0 Then
WMA3 = Sum3 / CSum3;
Else
WMA3 = 0;
}
if DINDEX <= 1 then
JISU = C;
else
JISU = C * EP + PreJISU * (1-EP);
if WMA3 > 0 and Crossup(WMA3, JISU) then
Buy();
즐거운 하루되세요
> 엠제이 님이 쓴 글입니다.
> 제목 : 부탁드립니다.
> 일봉에서 data2 참조없이 주봉용 지표를 사용하려고 합니다.
아래의 식을 일봉에서 주봉용으로 참조가능하게 부탁드립니다.
감사합니다.
===============================================
inputs: Length(5);
Vars: halvedLength(0), sqrRootLength(0);
if ((ceiling(length / 2) - (length / 2)) <= 0.5) then
halvedLength = ceiling(length / 2);
else
halvedLength = floor(length / 2);
if ((ceiling(SquareRoot(length)) - SquareRoot(length)) <= 0.5) then
sqrRootLength = ceiling(SquareRoot(length));
else
sqrRootLength = floor(SquareRoot(length));
Value1 = 2 * WMA(C, halvedLength);
Value2 = WMA(C, length);
Value3 = WMA((Value1 - Value2), sqrRootLength);
Value4 = EMA(Value3, Length);
if Crossup(Value3, Value4) then
Buy();
===============================================
다음글
이전글