예스스탁
예스스탁 답변
2025-03-11 17:15:15
안녕하세요
예스스탁입니다.
input : 타주기분(15),long(60),sig(9),P(9);
var : S1(0),D1(0),TM(0),TF(0),cnt(0),ii(0),ep(0);
var : hsum(0),lsum(0),hma(0),lma(0),hi(0),lo(0),hi1(0),lo1(0);
var : Ema1(0),Ema2(0),Ema11(0),Ema21(0),mi(0),sum(0),sb(0),sh(0),mdc(0);
Array : HH[100](0),LL[100](0),CC[100](0),src[100](0),md[100](Nan);
ep = 2/(long+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 = TM%타주기분;
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
{
ii = ii+1;
For cnt = 99 DownTo 1
{
hh[cnt] = hh[cnt-1];
ll[cnt] = ll[cnt-1];
src[cnt] = src[cnt-1];
md[cnt] = md[cnt-1];
}
hh[0] = h;
ll[0] = l;
hi1 = hi[1];
lo1 = lo[1];
Ema11 = Ema1[1];
Ema21 = Ema2[1];
}
cc[0] = c;
if hh[0] > 0 and h > hh[0] Then
hh[0] = h;
if ll[0] > 0 and l < ll[0] Then
ll[0] = l;
src[0] = (hh[0]+ll[0]+cc[0])/3;
if src[long-1] > 0 Then
{
if src[long] == 0 Then
{
hsum = 0;
lsum = 0;
For cnt = 0 to long-1
{
hsum = hsum + hh[cnt];
lsum = lsum + ll[cnt];
}
hi = (hsum/long)/long;
lo = (lsum/long)/long;
}
Else
{
hi = (hi1*(long-1)+hh[0])/long;
lo = (lo1*(long-1)+ll[0])/long;
}
}
if ii <= 1 Then
{
ema1 = src[0];
ema2 = ema1;
}
Else
{
ema1 = src[0] * EP + Ema11 * (1-EP);
ema2 = ema1 * EP + Ema21 * (1-EP);
}
mi = ema1+(ema1-ema2);
md[0] = iff((mi>hi), (mi-hi) , iff((mi<lo) , (mi - lo) , 0));
if md[sig-1] > 0 Then
{
sum = 0;
For cnt = 0 to sig-1
{
sum = sum + md[cnt];
}
sb = sum/sig;
sh = md[0]-sb;
}
mdc = iff(src[0]>mi,lime,Green);
var1 = p;
Var2 = -p;
plot1(md[0],"MAD",mdc);
plot2(sb,"Sig");
plot3(sh,"His");
plot10(0,"0");
plot20(var1,"+");
plot30(Var2,"-");
}
즐거운 하루되세요
> 뎅이요 님이 쓴 글입니다.
> 제목 : 수식 부탁 드립니다
> 아래지표를 15분봉의 지표를 3분봉에서 사용하고싶습니다.
Input : long(60),sig(9),P(9);
var : src(0),hi(0),lo(0),Ema1(0),Ema2(0),mi(0);
var : md(0),sb(0),sh(0),mdc(0);
src = (h+l+c)/3;
hi = iff(IsNan(hi[1]) == true, ma(high,long), hi[1]*(long-1)+high)/long;
lo = iff(IsNan(lo[1]) == true, ma(low,long), lo[1]*(long-1)+low)/long;
ema1 = ema(src, long);
ema2 = ema(ema1, long);
mi = ema1+(ema1-ema2);
md = iff((mi>hi), (mi-hi) , iff((mi<lo) , (mi - lo) , 0));
sb = ma(md, sig);
sh = md-sb;
mdc = iff(src>mi,lime,Green);
var1 = p;
Var2 = -p;
plot1(md,"MAD",mdD);
plot2(sb,"Sig");
plot3(sh,"His");
plot10(0,"0");
plot20(var1,"+");
plot30(Var2,"-");