예스스탁
예스스탁 답변
2020-07-23 11:02:56
안녕하세요
예스스탁입니다.
틱봉에서 분봉은 정확히 계산이 불가능합니다.
최대한 근사값으로 작성해 드립니다.
input : ntime(10);
var : S1(0),D1(0),TM(0),TF(0),cnt(0);
var : OO(0),LL(0),HH(0),CC(0),idx(0);
Array : xOpen[10](0),xhigh[10](0),xlow[10](0),xClose[10](0);
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)%ntime;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime > 1 and TF < TF[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
{
OO = O;
HH = H;
LL = L;
xOpen[0] = O;
xhigh[0] = H;
xLow[0] = L;
for cnt = 1 to 9
{
xOpen[cnt] = xOpen[cnt-1][1];
xHigh[cnt] = xHigh[cnt-1][1];
xLow[cnt] = xLow[cnt-1][1];
xClose[cnt] = xClose[cnt-1][1];
}
idx = idx+1;
}
if H > HH Then
HH = H;
if L < LL Then
LL = L;
CC = C;
if idx == 1 then
{
xOpen[0] = OO;
xClose[0] = (OO+HH+LL+CC)/4;
xHigh[0] = MaxList(hh,xOpen[0],xClose[0]);
xLow[0] = MinList(LL,xOpen[0],xClose[0]);
}
else
{
xClose[0] = (OO+HH+LL+CC)/4;
xOpen[0] = (xOpen[1]+ xClose[1])/2 ;
xHigh[0] = MaxList(HH, xOpen[0], xClose[0]) ;
xLow [0] = MinList(LL, xOpen[0], xClose[0]) ;
}
plot1(xClose[0]);
plot2(xOpen[0]);
}
즐거운 하루되세요
> 브리아나금 님이 쓴 글입니다.
> 제목 : 수식 부탁드립니다
> 아래 지표로 10분 지표을 240틱봉에서 볼수있게 부탁드립니다
input : 소숫점자리(2);
var : xClose(0),xOpen(0),xHigh(0),xLow(0),t(0),cnt(0),h1(0),l1(0);
var : HH(0),HD(0),HT(0);
var : LL(0),LD(0),LT(0);
Array : TL[10](0),TX[10](0),TL1[10](0);
if index == 0 then
{
xOpen = open;
xClose = (O+H+L+C)/4;
xHigh = MaxList( high, xOpen, xClose);
xLow = MinList( low, xOpen,xClose);
}
else
{
xClose = (O+H+L+C)/4;
xOpen = (xOpen [1] + xClose [1])/2 ;
xHigh = MaxList(High, xOpen, xClose) ;
xLow = MinList(Low, xOpen, xClose) ;
}
plot1(xClose);
plot2(xOpen);