커뮤니티
수식 문의
2014-02-06 15:10:45
239
글번호 72233
.please check attaschment.
always thank you.
답변 1
예스스탁 예스스탁 답변
2014-02-06 13:09:51
안녕하세요
예스스탁입니다.
1. 지표
input : Period1(5),Period2(10),Period3(20),Period4(60),P1(5),P2(10),P3(20),P4(60);
Var : cnt(0),Nth(0);
var : tempmax1(0), tempindex1(0), X1(0),RCI1(0),ma1(0);
var : tempmax2(0), tempindex2(0), X2(0),RCI2(0),ma2(0);
var : tempmax3(0), tempindex3(0), X3(0),RCI3(0),ma3(0);
var : tempmax4(0), tempindex4(0), X4(0),RCI4(0),ma4(0);
Array : VALUE1[100](0),NTHVALUE1[100](0);
Array : VALUE2[100](0),NTHVALUE2[100](0);
Array : VALUE3[100](0),NTHVALUE3[100](0);
Array : VALUE4[100](0),NTHVALUE4[100](0);
var1 = MACD(12,26);
for cnt = 0 to 99{
VALUE1[cnt] = var1[cnt];
VALUE2[cnt] = var1[cnt];
VALUE3[cnt] = var1[cnt];
VALUE4[cnt] = var1[cnt];
}
For Nth = 0 to Period1-1 {
tempmax1 = -99999999;
For cnt = 0 to Period1-1{
if VALUE1[cnt] > tempmax1 then{
tempmax1 = VALUE1[cnt];
tempIndex1 = cnt;
NTHVALUE1[cnt] = Nth+1;
}
}
VALUE1[tempIndex1] = -99999999;
}
X1 = 0;
for cnt = 0 to period1-1{
X1 = X1+abs((cnt+1)-NTHVALUE1[cnt])^2;
}
RCI1 = (1-(6*X1)/(period1*(period1^2-1)))*100;
For Nth = 0 to Period2-1 {
tempmax2 = -99999999;
For cnt = 0 to Period2-1{
if VALUE2[cnt] > tempmax2 then{
tempmax2 = VALUE2[cnt];
tempIndex2 = cnt;
NTHVALUE2[cnt] = Nth+1;
}
}
VALUE2[tempIndex2] = -99999999;
}
X2 = 0;
for cnt = 0 to period2-1{
X2 = X2+abs((cnt+1)-NTHVALUE2[cnt])^2;
}
RCI2 = (1-(6*X2)/(period2*(period2^2-1)))*100;
For Nth = 0 to Period3-1 {
tempmax3 = -99999999;
For cnt = 0 to Period3-1{
if VALUE3[cnt] > tempmax3 then{
tempmax3 = VALUE3[cnt];
tempIndex3 = cnt;
NTHVALUE3[cnt] = Nth+1;
}
}
VALUE3[tempIndex3] = -99999999;
}
X3 = 0;
for cnt = 0 to period3-1{
X3 = X3+abs((cnt+1)-NTHVALUE3[cnt])^2;
}
RCI3 = (1-(6*X3)/(period3*(period3^2-1)))*100;
For Nth = 0 to Period4-1 {
tempmax4 = -99999999;
For cnt = 0 to Period4-1{
if VALUE4[cnt] > tempmax4 then{
tempmax4 = VALUE4[cnt];
tempIndex4 = cnt;
NTHVALUE4[cnt] = Nth+1;
}
}
VALUE4[tempIndex4] = -99999999;
}
X4 = 0;
for cnt = 0 to period4-1{
X4 = X4+abs((cnt+1)-NTHVALUE4[cnt])^2;
}
RCI4 = (1-(6*X4)/(period4*(period4^2-1)))*100;
ma1 = ma(RCI1,P1);
ma2 = ma(RCI2,P2);
ma3 = ma(RCI3,P3);
ma4 = ma(RCI4,P4);
plot1(RCI1);
plot2(RCI2);
plot3(RCI3);
plot4(RCI4);
plot5(ma1);
plot6(ma2);
plot7(ma3);
plot8(ma4);
2.
input : Period1(5),Period2(10),Period3(20),Period4(60),P1(5),P2(10),P3(20),P4(60),n(0);
Var : cnt(0),Nth(0),MACDv(0),MACDS(0);
var : tempmax1(0), tempindex1(0), X1(0),RCI1(0),ma1(0);
var : tempmax2(0), tempindex2(0), X2(0),RCI2(0),ma2(0);
var : tempmax3(0), tempindex3(0), X3(0),RCI3(0),ma3(0);
var : tempmax4(0), tempindex4(0), X4(0),RCI4(0),ma4(0);
Array : VALUE1[100](0),NTHVALUE1[100](0);
Array : VALUE2[100](0),NTHVALUE2[100](0);
Array : VALUE3[100](0),NTHVALUE3[100](0);
Array : VALUE4[100](0),NTHVALUE4[100](0);
var1 = c;
for cnt = 0 to 99{
VALUE1[cnt] = var1[cnt];
VALUE2[cnt] = var1[cnt];
VALUE3[cnt] = var1[cnt];
VALUE4[cnt] = var1[cnt];
}
For Nth = 0 to Period1-1 {
tempmax1 = -99999999;
For cnt = 0 to Period1-1{
if VALUE1[cnt] > tempmax1 then{
tempmax1 = VALUE1[cnt];
tempIndex1 = cnt;
NTHVALUE1[cnt] = Nth+1;
}
}
VALUE1[tempIndex1] = -99999999;
}
X1 = 0;
for cnt = 0 to period1-1{
X1 = X1+abs((cnt+1)-NTHVALUE1[cnt])^2;
}
RCI1 = (1-(6*X1)/(period1*(period1^2-1)))*100;
For Nth = 0 to Period2-1 {
tempmax2 = -99999999;
For cnt = 0 to Period2-1{
if VALUE2[cnt] > tempmax2 then{
tempmax2 = VALUE2[cnt];
tempIndex2 = cnt;
NTHVALUE2[cnt] = Nth+1;
}
}
VALUE2[tempIndex2] = -99999999;
}
X2 = 0;
for cnt = 0 to period2-1{
X2 = X2+abs((cnt+1)-NTHVALUE2[cnt])^2;
}
RCI2 = (1-(6*X2)/(period2*(period2^2-1)))*100;
For Nth = 0 to Period3-1 {
tempmax3 = -99999999;
For cnt = 0 to Period3-1{
if VALUE3[cnt] > tempmax3 then{
tempmax3 = VALUE3[cnt];
tempIndex3 = cnt;
NTHVALUE3[cnt] = Nth+1;
}
}
VALUE3[tempIndex3] = -99999999;
}
X3 = 0;
for cnt = 0 to period3-1{
X3 = X3+abs((cnt+1)-NTHVALUE3[cnt])^2;
}
RCI3 = (1-(6*X3)/(period3*(period3^2-1)))*100;
For Nth = 0 to Period4-1 {
tempmax4 = -99999999;
For cnt = 0 to Period4-1{
if VALUE4[cnt] > tempmax4 then{
tempmax4 = VALUE4[cnt];
tempIndex4 = cnt;
NTHVALUE4[cnt] = Nth+1;
}
}
VALUE4[tempIndex4] = -99999999;
}
X4 = 0;
for cnt = 0 to period4-1{
X4 = X4+abs((cnt+1)-NTHVALUE4[cnt])^2;
}
RCI4 = (1-(6*X4)/(period4*(period4^2-1)))*100;
ma1 = ma(RCI1,P1);
ma2 = ma(RCI2,P2);
ma3 = ma(RCI3,P3);
ma4 = ma(RCI4,P4);
MACDv = MACD(12,26);
MACDs = ema(MACDV,0);
Condition1 = RCi1 > RCI2 and RCI2 > RCI3;
Condition2 = RCi1 < RCI2 and RCI2 < RCI3;
if Condition1 == true and Condition1[1] == false and RCI4 < n and !(MACDv < 0 and MACDv < MACDS) Then
buy();
if Condition2 == true and Condition2[1] == false and RCI4 > n and !(MACDv > 0 and MACDv > MACDS) Then
sell();
3.
input : Period1(5),Period2(10),Period3(20),Period4(60),P1(5),P2(10),P3(20),P4(60),n(0),n2(0),n3(0);
Var : cnt(0),Nth(0),MACDv(0),MACDS(0);
var : tempmax1(0), tempindex1(0), X1(0),RCI1(0),ma1(0);
var : tempmax2(0), tempindex2(0), X2(0),RCI2(0),ma2(0);
var : tempmax3(0), tempindex3(0), X3(0),RCI3(0),ma3(0);
var : tempmax4(0), tempindex4(0), X4(0),RCI4(0),ma4(0);
Array : VALUE1[100](0),NTHVALUE1[100](0);
Array : VALUE2[100](0),NTHVALUE2[100](0);
Array : VALUE3[100](0),NTHVALUE3[100](0);
Array : VALUE4[100](0),NTHVALUE4[100](0);
var1 = c;
for cnt = 0 to 99{
VALUE1[cnt] = var1[cnt];
VALUE2[cnt] = var1[cnt];
VALUE3[cnt] = var1[cnt];
VALUE4[cnt] = var1[cnt];
}
For Nth = 0 to Period1-1 {
tempmax1 = -99999999;
For cnt = 0 to Period1-1{
if VALUE1[cnt] > tempmax1 then{
tempmax1 = VALUE1[cnt];
tempIndex1 = cnt;
NTHVALUE1[cnt] = Nth+1;
}
}
VALUE1[tempIndex1] = -99999999;
}
X1 = 0;
for cnt = 0 to period1-1{
X1 = X1+abs((cnt+1)-NTHVALUE1[cnt])^2;
}
RCI1 = (1-(6*X1)/(period1*(period1^2-1)))*100;
For Nth = 0 to Period2-1 {
tempmax2 = -99999999;
For cnt = 0 to Period2-1{
if VALUE2[cnt] > tempmax2 then{
tempmax2 = VALUE2[cnt];
tempIndex2 = cnt;
NTHVALUE2[cnt] = Nth+1;
}
}
VALUE2[tempIndex2] = -99999999;
}
X2 = 0;
for cnt = 0 to period2-1{
X2 = X2+abs((cnt+1)-NTHVALUE2[cnt])^2;
}
RCI2 = (1-(6*X2)/(period2*(period2^2-1)))*100;
For Nth = 0 to Period3-1 {
tempmax3 = -99999999;
For cnt = 0 to Period3-1{
if VALUE3[cnt] > tempmax3 then{
tempmax3 = VALUE3[cnt];
tempIndex3 = cnt;
NTHVALUE3[cnt] = Nth+1;
}
}
VALUE3[tempIndex3] = -99999999;
}
X3 = 0;
for cnt = 0 to period3-1{
X3 = X3+abs((cnt+1)-NTHVALUE3[cnt])^2;
}
RCI3 = (1-(6*X3)/(period3*(period3^2-1)))*100;
For Nth = 0 to Period4-1 {
tempmax4 = -99999999;
For cnt = 0 to Period4-1{
if VALUE4[cnt] > tempmax4 then{
tempmax4 = VALUE4[cnt];
tempIndex4 = cnt;
NTHVALUE4[cnt] = Nth+1;
}
}
VALUE4[tempIndex4] = -99999999;
}
X4 = 0;
for cnt = 0 to period4-1{
X4 = X4+abs((cnt+1)-NTHVALUE4[cnt])^2;
}
RCI4 = (1-(6*X4)/(period4*(period4^2-1)))*100;
ma1 = ma(RCI1,P1);
ma2 = ma(RCI2,P2);
ma3 = ma(RCI3,P3);
ma4 = ma(RCI4,P4);
MACDv = MACD(12,26);
MACDs = ema(MACDV,0);
Condition1 = RCi1 > RCI2 and RCI2 > RCI3;
Condition2 = RCi1 < RCI2 and RCI2 < RCI3;
if RCI2 > RCI3 and RCI3 > ma3 and RCI4 < n and RCI1 > RCI1[1] and RCI1[1] < RCI1[2] and
!(MACDv < 0 and MACDv < MACDS) Then
buy();
if RCI2 > RCI3 and RCI3 > ma3 and RCI4 < n and RCI1 == RCI1[1] and RCI1[1] < RCI1[2] and
RCI1 < n2 and !(MACDv < 0 and MACDv < MACDS) Then
buy();
if RCI2 < RCI3 and RCI3 < ma3 and RCI4 > n and RCI1 < RCI1[1] and RCI1[1] > RCI1[2] and
!(MACDv > 0 and MACDv < MACDS) Then
sell();
if RCI2 < RCI3 and RCI3 < ma3 and RCI4 > n and RCI1 == RCI1[1] and RCI1[1] > RCI1[2] and
RCI1 > n3 and !(MACDv > 0 and MACDv < MACDS) Then
sell();
즐거운 하루되세요
> 흑수돌 님이 쓴 글입니다.
> 제목 : 수식 문의
> .please check attaschment.
always thank you.
다음글
이전글