커뮤니티
안녕하세요
2014-08-19 08:39:41
139
글번호 77791
안녕하세요.반갑습니다
질문내용은요 2가지 분봉용입니다
1.Stochastics (5.5.5)과열 2배수와4배수 동시만족:매수
반대:매도
2.Stochastics(5.5.5) 과열 2배수동시만족:매수
반대:매도
감사합니다
답변 1
예스스탁 예스스탁 답변
2014-08-21 12:47:55
안녕하세요
예스스탁입니다.
1.
input : StoPeriod(10), StoPeriod1(6), StoPeriod2(6);
var : count1(0), highVal1(0), lowVal1(0), StoFastK1(0), StoK1(0), StoD1(0),Tf1(0);
var : Ep11(0), EP12(0), JISU1(0), DINDEX1(0), PreStoK1(0), PreStoD1(0),cnt1(0);
var : stok(0),stod(0);
Array : HH1[50](0),LL1[50](0);
var : count2(0), highVal2(0), lowVal2(0), StoFastK2(0), StoK2(0), StoD2(0),Tf2(0);
var : Ep21(0), EP22(0), JISU2(0), DINDEX2(0), PreStoK2(0), PreStoD2(0),cnt2(0);
Array : HH2[50](0),LL2[50](0);
Tf1 = TimeToMinutes(stime)%(BarInterval*2);
if dayindex == 0 or (Tf1 < Tf1[1] and stime > stime[1]) Then{
HH1[0] = H;
LL1[0] = L;
for cnt1 = 1 to 49{
HH1[cnt1] = HH1[cnt1-1][1];
LL1[cnt1] = LL1[cnt1-1][1];
}
}
if H > HH1[0] Then
HH1[0] = H;
if L < LL1[0] Then
LL1[0] = L;
highVal1 = HH1[0];
lowVal1 = LL1[0];
for count1 = 0 to StoPeriod-1 {
if HH1[count1] > highVal1 then
highVal1 = HH1[count1];
if LL1[count1] < lowVal1 then
lowVal1 = LL1[count1];
}
StoFastK1 = (C-lowVal1)/(highVal1-lowVal1)*100;
#### Slow StochasticsK ####
Ep11 = 2/(StoPeriod1+1);
if DINDEX1 >= StoPeriod and (date != date[1] or TF1 < TF1[1]) then {
DINDEX1 = DINDEX1 + 1;
PreStoK1 = StoK1[1];
}
if DINDEX1 <= 1 then
StoK1 = StoFastK1 ;
else
StoK1 = StoFastK1 * EP11 + PreStoK1 * (1-EP11);
#### Slow StochasticsD ####
Ep12 = 2/(StoPeriod2+1);
if (date != date[1] or TF1 < TF1[1]) then {
DINDEX1 = DINDEX1 + 1;
PreStoD1 = StoD1[1];
}
if DINDEX1 <= 1 then
StoD1 = StoK1 ;
else
StoD1 = StoK1 * EP12 + PreStoD1 * (1-EP12);
Tf2 = TimeToMinutes(stime)%(BarInterval*4);
if dayindex == 0 or (Tf2 < Tf2[1] and stime > stime[1]) Then{
HH2[0] = H;
LL2[0] = L;
for cnt2 = 1 to 49{
HH2[cnt2] = HH2[cnt2-1][1];
LL2[cnt2] = LL2[cnt2-1][1];
}
}
if H > HH2[0] Then
HH2[0] = H;
if L < LL2[0] Then
LL2[0] = L;
highVal2 = HH2[0];
lowVal2 = LL2[0];
for count2 = 0 to StoPeriod-1 {
if HH2[count2] > highVal2 then
highVal2 = HH2[count2];
if LL2[count2] < lowVal2 then
lowVal2 = LL2[count2];
}
StoFastK2 = (C-lowVal2)/(highVal2-lowVal2)*100;
#### Slow StochasticsK ####
Ep21 = 2/(StoPeriod2+1);
if DINDEX2 >= StoPeriod and (date != date[1] or TF2 < TF2[1]) then {
DINDEX2 = DINDEX2 + 1;
PreStoK2 = StoK2[1];
}
if DINDEX2 <= 1 then
StoK2 = StoFastK2 ;
else
StoK2 = StoFastK2 * EP21 + PreStoK2 * (1-EP21);
#### Slow StochasticsD ####
Ep22 = 2/(StoPeriod2+1);
if (date != date[1] or TF2 < TF2[1]) then {
DINDEX2 = DINDEX2 + 1;
PreStoD2 = StoD2[1];
}
if DINDEX2 <= 1 then
StoD2 = StoK2 ;
else
StoD2 = StoK2 * EP22 + PreStoD2 * (1-EP22);
if stok > 80 and stok1 > 80 and stok2 > 80 Then
buy();
if stok < 20 and stok1 < 20 and stok2 < 20 Then
sell();
2.
input : Atime1(15),StoPeriod(10), StoPeriod1(6), StoPeriod2(6);
var : count1(0), highVal1(0), lowVal1(0), StoFastK1(0), StoK1(0), StoD1(0),Tf1(0);
var : Ep11(0), EP12(0), JISU1(0), DINDEX1(0), PreStoK1(0), PreStoD1(0),cnt1(0);
var : stok(0),stod(0);
Array : HH1[50](0),LL1[50](0);
Tf1 = TimeToMinutes(stime)%(BarInterval*2);
if dayindex == 0 or (Tf1 < Tf1[1] and stime > stime[1]) Then{
HH1[0] = H;
LL1[0] = L;
for cnt1 = 1 to 49{
HH1[cnt1] = HH1[cnt1-1][1];
LL1[cnt1] = LL1[cnt1-1][1];
}
}
if H > HH1[0] Then
HH1[0] = H;
if L < LL1[0] Then
LL1[0] = L;
highVal1 = HH1[0];
lowVal1 = LL1[0];
for count1 = 0 to StoPeriod-1 {
if HH1[count1] > highVal1 then
highVal1 = HH1[count1];
if LL1[count1] < lowVal1 then
lowVal1 = LL1[count1];
}
StoFastK1 = (C-lowVal1)/(highVal1-lowVal1)*100;
#### Slow StochasticsK ####
Ep11 = 2/(StoPeriod1+1);
if DINDEX1 >= StoPeriod and (date != date[1] or TF1 < TF1[1]) then {
DINDEX1 = DINDEX1 + 1;
PreStoK1 = StoK1[1];
}
if DINDEX1 <= 1 then
StoK1 = StoFastK1 ;
else
StoK1 = StoFastK1 * EP11 + PreStoK1 * (1-EP11);
#### Slow StochasticsD ####
Ep12 = 2/(StoPeriod2+1);
if (date != date[1] or TF1 < TF1[1]) then {
DINDEX1 = DINDEX1 + 1;
PreStoD1 = StoD1[1];
}
if DINDEX1 <= 1 then
StoD1 = StoK1 ;
else
StoD1 = StoK1 * EP12 + PreStoD1 * (1-EP12);
stok =StochasticsK(StoPeriod,StoPeriod1);
stod = StochasticsD(StoPeriod,StoPeriod1,StoPeriod2);
if stok > 80 and stok1 > 80 Then
buy();
if stok < 20 and stok1 < 20 Then
sell();
즐거운 하루되세요
> jbouu123 님이 쓴 글입니다.
> 제목 : 안녕하세요
> 안녕하세요.반갑습니다
질문내용은요 2가지 분봉용입니다
1.Stochastics (5.5.5)과열 2배수와4배수 동시만족:매수
반대:매도
2.Stochastics(5.5.5) 과열 2배수동시만족:매수
반대:매도
감사합니다