예스스탁
예스스탁 답변
2022-03-07 09:08:14
안녕하세요
예스스탁입니다.
input : 분(5),Sto1(5),Sto2(3),Sto3(3);
var : S1(0),D1(0),TM(0),TF(0);
var : cnt(0), Hv(0), LV(0), FK(0), SK(0), SD(0);
var : Ep1(0), EP2(0), JISU(0), DINDEX(0), PreSK(0), PreSD(0);
var : stok(0),stod(0);
Array : HH[50](0),LL[50](0);
#기본차트 스토케스틱
stok = StochasticsK(sto1,sto2);
stod = StochasticsD(sto1,sto2,sto3);
#타분봉 스토케스틱
Ep1 = 2/(sto2+1);
Ep2 = 2/(sto3+1);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF = TimeToMinutes(stime)%분;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and 분 > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and 분 > 1 and TM >= TM[1]+분) or
(Bdate == Bdate[1] and 분 == 1 and TM > TM[1]) Then
{
HH[0] = H;
LL[0] = L;
for cnt = 1 to 49{
HH[cnt] = HH[cnt-1][1];
LL[cnt] = LL[cnt-1][1];
}
}
if H > HH[0] Then
HH[0] = H;
if L < LL[0] Then
LL[0] = L;
if HH[sto1-1] > 0 and LL[sto1-1] > 0 then
{
if bdate != bdate[1] or (Bdate == Bdate[1] and TF < TF[1]) or stime == 154500 Then{
DINDEX = DINDEX+1;
PreSK = SK[1];
PreSD = SD[1];
}
Hv = HH[0];
LV = LL[0];
for cnt = 0 to sto1-1
{
if HH[cnt] > Hv then
Hv = HH[cnt];
if LL[cnt] < LV then
LV = LL[cnt];
}
FK = (C-LV)/(HV-LV)*100;
if DINDEX <= 1 then
{
SK = FK;
SD = SK;
}
else
{
SK = FK * EP1 + PreSK * (1-EP1);
SD = SK * EP2 + PreSD * (1-EP2);
}
if CrossUp(stok,stod) and SK > SD Then
Buy();
}
}
즐거운 하루되세요
> tadd 님이 쓴 글입니다.
> 제목 : 수식 문의드립니다.
> 1분봉 스토캐(5,3,3) 골든크로스 및 5분봉 스토캐 K>D 일때 매수
1분봉차트에서 스토캐 및 5분봉 스토캐 값을 구해서 전략에 사용하려고 합니다.
항상 도움주셔서 감사합니다.