예스스탁
예스스탁 답변
2025-03-31 11:28:57
안녕하세요
예스스탁입니다.
input : n(20);
var : idx(0),TF(0),box(0);
var : HH(0),LL(0),TL1(0),TL2(0),TX1(0),str("");
var : DD(0),TT(0),half(0),diff(0),TL3(0),TL4(0);
if Bdate != Bdate[1] Then
idx = 0;
Else
idx = idx+1;
TF = idx%n;
if Bdate != Bdate[1] or (Bdate == Bdate[1] and TF < TF[1]) Then
{
HH = H;
LL = L;
DD = sDate;
TT = sTime;
Box = Box_New(DD,TT,HH,NextBarSdate,NextBarStime,LL);
Box_SetColor(box,Rgb(150,150,150));
Box_SetFill(box,true);
half = Ceiling(TF/2);
diff = HH-LL;
TL1 = TL_New(sDate[half],sTime[half],HH,sdate[half],Stime[half],LL);
TL2 = TL_New(DD,TT,LL+diff*0.75,NextBarSdate,NextBarStime,LL+diff*0.75);
TL3 = TL_New(DD,TT,LL+diff*0.50,NextBarSdate,NextBarStime,LL+diff*0.50);
TL4 = TL_New(DD,TT,LL+diff*0.25,NextBarSdate,NextBarStime,LL+diff*0.25);
TL_SetColor(TL1,Rgb(255,0,255));
TL_SetColor(TL2,Rgb(255,0,255));
TL_SetColor(TL3,Rgb(255,0,255));
TL_SetColor(TL4,Rgb(255,0,255));
TL_SetSize(TL1,1);
TL_SetSize(TL2,1);
TL_SetSize(TL3,1);
TL_SetSize(TL4,1);
}
Else
{
if HH > 0 and H > HH Then
{
HH = H;
}
if LL > 0 and L < LL Then
{
LL = L;
}
half = Ceiling(TF/2);
diff = HH-LL;
Box_SetBegin(box,dd,tt,HH);
Box_SetEnd(box,sDate,sTime,LL);
TL_SetBegin(TL1,sDate[half],sTime[half],HH);
TL_SetEnd(TL1,sDate[half],sTime[half],LL);
TL_SetBegin(TL2,DD,TT,LL+diff*0.75);
TL_SetEnd(TL2,sDate,sTime,LL+diff*0.75);
TL_SetBegin(TL3,DD,TT,LL+diff*0.50);
TL_SetEnd(TL3,sDate,sTime,LL+diff*0.50);
TL_SetBegin(TL4,DD,TT,LL+diff*0.25);
TL_SetEnd(TL4,sDate,sTime,LL+diff*0.25);
str = "최고가:"+NumToStr(HH,2)+"(+"+NumToStr((HH-C)/PriceScale,0)+"틱)"+
NewLine+"최저가:"+NumToStr(LL,2)+"(-"+NumToStr((C-LL)/PriceScale,0)+"틱)"+
NewLine+"현재가:"+NumToStr(C,2);
Text_SetString(TX1,str);
Text_SetLocation(TX1,sDate[half],sTime[half],diff*0.50);
}
즐거운 하루되세요
> 요타 님이 쓴 글입니다.
> 제목 : 수식좀 요청 드립니다.
>
항상 많은 도움에 고맙습니다.
아래 수식에서 고점 저점 중간선 2등분인데
이것을 4등분선 으로 수정 좀 요청 드림니다. (그림1)
(저가 , 25% 50% 75% 고가)
## 아래 수식
input : n(20);
var : idx(0),TF(0),box(0);
var : HH(0),LL(0),TL1(0),TL2(0),TX1(0),str("");
var : DD(0),TT(0),half(0),mav(0),halfval(0);
if Bdate != Bdate[1] Then
idx = 0;
Else
idx = idx+1;
TF = idx%n;
if Bdate != Bdate[1] or (Bdate == Bdate[1] and TF < TF[1]) Then
{
HH = H;
LL = L;
DD = sDate;
TT = sTime;
Box = Box_New(DD,TT,HH,NextBarSdate,NextBarStime,LL);
Box_SetColor(box,Rgb(150,150,150));
Box_SetFill(box,true);
half = Ceiling(TF/2);
halfval = (HH+LL)/2;
TL1 = TL_New(sDate[half],sTime[half],HH,sdate[half],Stime[half],LL);
TL2 = TL_New(DD,TT,mav,NextBarSdate,NextBarStime,mav);
TL_SetColor(TL1,Rgb(255,0,255));
TL_SetColor(TL2,Rgb(255,0,255));
TL_SetSize(TL1,1);
TL_SetSize(TL2,1);
}
Else
{
if HH > 0 and H > HH Then
{
HH = H;
}
if LL > 0 and L < LL Then
{
LL = L;
}
half = Ceiling(TF/2);
halfval = (HH+LL)/2;
Box_SetBegin(box,dd,tt,HH);
Box_SetEnd(box,sDate,sTime,LL);
TL_SetBegin(TL1,sDate[half],sTime[half],HH);
TL_SetEnd(TL1,sDate[half],sTime[half],LL);
TL_SetBegin(TL2,DD,TT,halfval);
TL_SetEnd(TL2,sDate,sTime,halfval);
str = "최고가:"+NumToStr(HH,2)+"(+"+NumToStr((HH-C)/PriceScale,0)+"틱)"+
NewLine+"최저가:"+NumToStr(LL,2)+"(-"+NumToStr((C-LL)/PriceScale,0)+"틱)"+
NewLine+"현재가:"+NumToStr(C,2);
Text_SetString(TX1,str);
Text_SetLocation(TX1,sDate[half],sTime[half],halfval);
}
고맙습니다 수고 하십시요.