예스스탁
예스스탁 답변
2020-01-29 15:26:30
안녕하세요
예스스탁입니다.
security가 어떤 함수인지 모르겠습니다.
아마 다른주기의 값으로 계산해 주는 함수인것 같습니다.
예스랭귀지에는 별도로 다른주기 계산해 주는 함수는 없습니다.
아래와 같이 풀어서 작성하셔야 하며
분봉에서 다른분봉주기는 기본차트의 주기의 배수로만 가능합니다.
배수로 높은 주기가 아니면 계산할수 없습니다.
1 일봉
Input : length1(8),a1(0.7),T3FiboLine(false),Length12(5),a12(0.618);
var : S1(0),D1(0),TM(0),TF1(0),Ep1(0),Ep2(0),ii(0);
Var : e1(0), Pree1(0);
Var : e2(0), Pree2(0);
Var : e3(0), Pree3(0);
Var : e4(0), Pree4(0);
Var : e5(0), Pree5(0);
Var : e6(0), Pree6(0);
var : C1(0),C2(0),C3(0),C4(0),T3(0);
Var : e12(0), Pree12(0);
Var : e22(0), Pree22(0);
Var : e32(0), Pree32(0);
Var : e42(0), Pree42(0);
Var : e52(0), Pree52(0);
Var : e62(0), Pree62(0);
var : C12(0),C22(0),C32(0),C42(0),T32(0);
Ep1 = 2/(length1+1);
Ep2 = 2/(length12+1);
if bdate != bdate[1] then
{
ii = ii+1;
Pree1 = e1[1];
Pree2 = e2[1];
Pree3 = e3[1];
Pree4 = e4[1];
Pree5 = e5[1];
Pree6 = e6[1];
Pree12 = e12[1];
Pree22 = e22[1];
Pree32 = e32[1];
Pree42 = e42[1];
Pree52 = e52[1];
Pree62 = e62[1];
}
if ii <= 1 then
{
e1 = (high + low + 2*close)/4;
e2 = e1;
e3 = e2;
e4 = e3;
e5 = e4;
e6 = e5;
e12 = (high + low + 2*close)/4;
e22 = e12;
e32 = e22;
e42 = e32;
e52 = e42;
e62 = e52;
}
else
{
e1 = (high + low + 2*close)/4 * EP1 + Pree1 * (1-EP1);
e2 = e1 * EP1 + Pree2 * (1-EP1);
e3 = e2 * EP1 + Pree3 * (1-EP1);
e4 = e3 * EP1 + Pree4 * (1-EP1);
e5 = e4 * EP1 + Pree5 * (1-EP1);
e6 = e5 * EP1 + Pree6 * (1-EP1);
e12 = (high + low + 2*close)/4 * EP2 + Pree12 * (1-EP2);
e22 = e12 * EP2 + Pree22 * (1-EP2);
e32 = e22 * EP2 + Pree32 * (1-EP2);
e42 = e32 * EP2 + Pree42 * (1-EP2);
e52 = e42 * EP2 + Pree52 * (1-EP2);
e62 = e52 * EP2 + Pree62 * (1-EP2);
}
c1=-a1*a1*a1;
c2=3*a1*a1+3*a1*a1*a1;
c3=-6*a1*a1-3*a1-3*a1*a1*a1;
c4=1+3*a1+a1*a1*a1+3*a1*a1;
T3=c1*e6+c2*e5+c3*e4+c4*e3;
c12=-a12*a12*a12;
c22=3*a12*a12+3*a12*a12*a12;
c32=-6*a12*a12-3*a12-3*a12*a12*a12;
c42=1+3*a12+a12*a12*a12+3*a12*a12;
T32=c12*e62+c22*e52+c32*e42+c42*e32;
plot1(T3,"t3",red);
plot2(T32,"t32",blue);
2 다른분봉
Input : ntime(30),length1(8),a1(0.7),T3FiboLine(false),Length12(5),a12(0.618);
var : S1(0),D1(0),TM(0),TF1(0),Ep1(0),Ep2(0),ii(0);
Var : e1(0), Pree1(0);
Var : e2(0), Pree2(0);
Var : e3(0), Pree3(0);
Var : e4(0), Pree4(0);
Var : e5(0), Pree5(0);
Var : e6(0), Pree6(0);
var : C1(0),C2(0),C3(0),C4(0),T3(0);
Var : e12(0), Pree12(0);
Var : e22(0), Pree22(0);
Var : e32(0), Pree32(0);
Var : e42(0), Pree42(0);
Var : e52(0), Pree52(0);
Var : e62(0), Pree62(0);
var : C12(0),C22(0),C32(0),C42(0),T32(0);
Ep1 = 2/(length1+1);
Ep2 = 2/(length12+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;
TF1 = TM%ntime;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime > 1 and TF1 < TF1[1]) or
(Bdate == Bdate[1] and ntime > 1 and TM >= TM[1]+ntime)or
(Bdate == Bdate[1] and ntime == 1 and TM > TM[1]) Then
{
ii = ii+1;
Pree1 = e1[1];
Pree2 = e2[1];
Pree3 = e3[1];
Pree4 = e4[1];
Pree5 = e5[1];
Pree6 = e6[1];
Pree12 = e12[1];
Pree22 = e22[1];
Pree32 = e32[1];
Pree42 = e42[1];
Pree52 = e52[1];
Pree62 = e62[1];
}
if ii <= 1 then {
e1 = (high + low + 2*close)/4;
e2 = e1;
e3 = e2;
e4 = e3;
e5 = e4;
e6 = e5;
e12 = (high + low + 2*close)/4;
e22 = e12;
e32 = e22;
e42 = e32;
e52 = e42;
e62 = e52;
}
else{
e1 = (high + low + 2*close)/4 * EP1 + Pree1 * (1-EP1);
e2 = e1 * EP1 + Pree2 * (1-EP1);
e3 = e2 * EP1 + Pree3 * (1-EP1);
e4 = e3 * EP1 + Pree4 * (1-EP1);
e5 = e4 * EP1 + Pree5 * (1-EP1);
e6 = e5 * EP1 + Pree6 * (1-EP1);
e12 = (high + low + 2*close)/4 * EP2 + Pree12 * (1-EP2);
e22 = e12 * EP2 + Pree22 * (1-EP2);
e32 = e22 * EP2 + Pree32 * (1-EP2);
e42 = e32 * EP2 + Pree42 * (1-EP2);
e52 = e42 * EP2 + Pree52 * (1-EP2);
e62 = e52 * EP2 + Pree62 * (1-EP2);
}
c1=-a1*a1*a1;
c2=3*a1*a1+3*a1*a1*a1;
c3=-6*a1*a1-3*a1-3*a1*a1*a1;
c4=1+3*a1+a1*a1*a1+3*a1*a1;
T3=c1*e6+c2*e5+c3*e4+c4*e3;
c12=-a12*a12*a12;
c22=3*a12*a12+3*a12*a12*a12;
c32=-6*a12*a12-3*a12-3*a12*a12*a12;
c42=1+3*a12+a12*a12*a12+3*a12*a12;
T32=c12*e62+c22*e52+c32*e42+c42*e32;
plot1(T3,"t3",red);
plot2(T32,"t32",blue);
}
즐거운 하루되세요
> 로즈버드 님이 쓴 글입니다.
> 제목 : 예스트레이더 수식으로 전환 문의드립니다.
> study("T3 MTF", overlay=true)
res = input(title="Time Frame", type=resolution, defval="D")
T3FiboLine = input(false, title="Show T3 Fibonacci Ratio Line?")
length1 = input(8, "T3 Length")
a1 = input(0.7, "Volume Factor")
e1=ema((high + low + 2*close)/4, length1)
e2=ema(e1,length1)
e3=ema(e2,length1)
e4=ema(e3,length1)
e5=ema(e4,length1)
e6=ema(e5,length1)
c1=-a1*a1*a1
c2=3*a1*a1+3*a1*a1*a1
c3=-6*a1*a1-3*a1-3*a1*a1*a1
c4=1+3*a1+a1*a1*a1+3*a1*a1
T3=c1*e6+c2*e5+c3*e4+c4*e3
T3k = security(tickerid, res, T3)
plot(T3k, color=red, linewidth=3, title="T3")
length12 = input(5, "T3 Length fibo")
a12 = input(0.618, "Volume Factor fibo")
e12=ema((high + low + 2*close)/4, length12)
e22=ema(e12,length12)
e32=ema(e22,length12)
e42=ema(e32,length12)
e52=ema(e42,length12)
e62=ema(e52,length12)
c12=-a12*a12*a12
c22=3*a12*a12+3*a12*a12*a12
c32=-6*a12*a12-3*a12-3*a12*a12*a12
c42=1+3*a12+a12*a12*a12+3*a12*a12
T32=c12*e62+c22*e52+c32*e42+c42*e32
T32k = security(tickerid, res, T32)
plot(T3FiboLine and T32k ? T32k : na, color=blue, linewidth=2, title="T3fibo")
multi timeframe으로 가능할지 문의드립니다.
좋은 하루되세요
감사합니다.