답변완료
수식 질문합니다.
안녕하세요.
아래 수식 검증 부탁드립니다.
관련 없는 종목들이 많이 떠서요.
감사합니다.
그리고 85196 추가질문 답변 부탁드립니다.
--------------------------------------------------------------------
input: nbar(10);
var : 상한가(0), UpLimit(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(0);
if date >= 19981207 then
{
if date < 20050328 && CodeCategory() == 2 then
UpLimit = (BP[0] * 1.12);
Else if date >= 20050328 and date < 20150615 Then
UpLimit = (BP[0] * 1.15);
Else
UpLimit = (BP[0] * 1.30);
if date >= 20230125 Then
{
up1 = int(UpLimit/1000+0.00001)*1000;
up2 = int(UpLimit/500+0.00001)*500;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/5+0.00001)*5;
up7 = int(UpLimit/1+0.00001)*1;
}
Else
{
if CodeCategory() == 2 then
{
if date >= 20030721 then
{
up1 = int(UpLimit/100+0.00001)*100;
up2 = int(UpLimit/100+0.00001)*100;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/5+0.00001)*5;
up7 = int(UpLimit/1+0.00001)*1;
}
else
{
up1 = int(UpLimit/1000+0.00001)*1000;
up2 = int(UpLimit/500+0.00001)*500;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/10+0.00001)*10;
up7 = int(UpLimit/1+0.00001)*1;
}
}
Else
{
up1 = int(UpLimit/1000+0.00001)*1000;
up2 = int(UpLimit/500+0.00001)*500;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/5+0.00001)*5;
up7 = int(UpLimit/1+0.00001)*1;
}
}
if CodeCategory() == 1 || CodeCategory() == 2 then
{
if date >= 20230125 Then
{
If BP >= 500000 Then
상한가 = up1;
Else If BP >= 200000 Then
상한가 = iff(up2>=500000, up1, up2);
Else If BP >= 50000 Then
상한가 = iff(up3>=200000, up2, up3);
Else If BP >= 20000 Then
상한가 = iff(up4>=50000, up3, up4);
Else If BP >= 5000 Then
상한가 = iff(up5>=20000, up4, up5);
Else If BP >= 2000 Then
상한가 = iff(up5>=5000, up5, up6);
Else
상한가 = iff(up6>=2000, up6, up7);
}
Else
{
if sdate < 20101004 Then
{
If BP >= 500000 Then
상한가 = up1;
Else If BP >= 100000 Then
상한가 = iff(up2>=500000, up1, up2);
Else If BP >= 50000 Then
상한가 = iff(up3>=100000, up2, up3);
Else If BP >= 10000 Then
상한가 = iff(up4>=50000, up3, up4);
Else If BP >= 5000 Then
상한가 = iff(up5>=10000, up4, up5);
Else If BP >= 1000 Then
상한가 = iff(up5>=5000, up5, up6);
Else
상한가 = iff(up6>=1000, up6, up6);
}
Else
{
If BP >= 500000 Then
상한가 = up1;
Else If BP >= 100000 Then
상한가 = iff(up2>=500000, up1, up2);
Else If BP >= 50000 Then
상한가 = iff(up3>=100000, up2, up3);
Else If BP >= 10000 Then
상한가 = iff(up4>=50000, up3, up4);
Else If BP >= 5000 Then
상한가 = iff(up5>=10000, up4, up5);
Else If BP >= 1000 Then
상한가 = iff(up5>=5000, up5, up6);
Else
상한가 = iff(up6>=1000, up6, up7);
}
}
}
else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF
상한가 = up6;
}
}
var : S(0),ii(0);
if H >= 상한가 Then
{
S = (C+C[1])/2;
ii = Index;
}
if ii > 0 and Index <= ii+nbar and CrossDown(C,S) Then
Find(1);
2024-01-05
798
글번호 175456
종목검색
답변완료
data2 인식 시간
input : N(50),N1(5),per(10);
var : TX1(0),TX2(0),cnt(0),box(0),box1(0);
var : TL1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL6(0),TL7(0),TL8(0);
Plot1(Data2(c));
For cnt = 0 to 49
{
TL_Delete(TL1[cnt]);
TL_Delete(TL2[cnt]);
TL_Delete(TL3[cnt]);
TL_Delete(TL4[cnt]);
TL_Delete(TL5[cnt]);
TL_Delete(TL6[cnt]);
TL_Delete(TL7[cnt]);
TL_Delete(TL8[cnt]);
Text_Delete(TX1[cnt]);
Text_Delete(TX2[cnt]);
TL_Delete(Box[cnt]);
TL_Delete(Box1[cnt]);
}
if Data2(sTime >= 85000) Then
{
TL1 = TL_New_Self(sDate,sTime,data2(highest(H,N)),NextBarSdate,NextBarStime,data2(highest(H,N)));
TL2 = TL_New_Self(sDate,sTime,data2(lowest(L,N)),NextBarSdate,NextBarStime,data2(lowest(L,N)));
TL_SetColor(TL1,Red);
TL_SetColor(TL2,Blue);
TL_SetSize(TL1,1);
TL_SetSize(TL2,1);
TL_SetExtLeft(TL1,true);
TL_SetExtLeft(TL2,true);
TL3 = TL_New_Self(Data2(sDate[NthHighestBar(1,H,N)]),Data2(stime[NthhighestBar(1,H,N)]),-9999,Data2(sDate[NthHighestBar(1,H,N)]),Data2(stime[NthhighestBar(1,H,N)]),9999);
TL4 = TL_New_Self(Data2(sDate[NthlowestBar(1,L,N)]),Data2(stime[NthlowestBar(1,L,N)]),-9999,Data2(sDate[NthlowestBar(1,L,N)]),Data2(stime[NthlowestBar(1,L,N)]),9999);
TL_SetColor(TL3,Pink);
TL_SetColor(TL4,Gold);
TL_SetSize(TL3,5);
TL_SetSize(TL4,2);
TL5 = TL_New(Data2(sDate[NthHighestBar(1,H,N)]),Data2(stime[NthhighestBar(1,H,N)]),-9999,Data2(sDate[NthHighestBar(1,H,N)]),Data2(stime[NthhighestBar(1,H,N)]),9999);
TL6 = TL_New(Data2(sDate[NthlowestBar(1,L,N)]),Data2(stime[NthlowestBar(1,L,N)]),-9999,Data2(sDate[NthlowestBar(1,L,N)]),Data2(stime[NthlowestBar(1,L,N)]),9999);
TL_SetColor(TL5,Pink);
TL_SetColor(TL6,Gold);
TL_SetSize(TL5,5);
TL_SetSize(TL6,2);
TL7 = TL_New_Self(sDate,sTime,data2(lowest(L*1.1,N)),NextBarSdate,NextBarStime,data2(lowest(L*1.1,N)));
TL_SetColor(TL7,Orange);
TL_SetSize(TL7,1);
TL_SetExtLeft(TL7,true);
TL8 = TL_New_Self(sDate,sTime,data2(lowest(L*1.2,N)),NextBarSdate,NextBarStime,data2(lowest(L*1.2,N)));
TL_SetColor(TL8,Green);
TL_SetSize(TL8,1);
TL_SetExtLeft(TL8,true);
TX1 = Text_New_Self(Data2(sDate[NthHighestBar(1,H,N)]),Data2(stime[NthhighestBar(1,H,N)]),Data2(highest(H+PriceScale*1,N)),"■");
TX2 = Text_New_Self(Data2(sDate[NthLowestBar(1,L,N)]),Data2(stime[NthLowestBar(1,L,N)]),Data2(Lowest(L-PriceScale*1,N)),"■");
Text_SetStyle(TX1,2,1);
Text_SetStyle(TX2,2,0);
Text_SetColor(TX1,Blue);
Text_SetColor(TX2,Magenta);
Text_SetSize(tx1,40);
Text_SetSize(tx2,40);
box1 = Box_New(Data2(sDate[NthlowestBar(1,L,N)+N1]),Data2(stime[NthlowestBar(1,L,N)+N1]),9999,
Data2(sDate[NthlowestBar(1,L,N)]),Data2(stime[NthlowestBar(1,L,N)]),-9999);
Box_SetColor(box1,Blue);
Box_SetFill(box1,true,30);
box = Box_New_Self(Data2(sDate[NthlowestBar(1,L,N)+N1]),Data2(stime[NthlowestBar(1,L,N)+N1]),9999,
Data2(sDate[NthlowestBar(1,L,N)]),Data2(stime[NthlowestBar(1,L,N)]),-9999);
Box_SetColor(box,Blue);
Box_SetFill(box,true,25);
var : box3(0),cond(False),H2(0),L2(0);
if data2(CrossUp(L,Lowest(L,N)*(1+per/100))) Then
{
Box_Delete(box3);
cond = true;
H2 = Data2(H);
L2 = Data2(lowest(L,N)*(1+per/100));
box3 = Box_New_Self(sDate[100],sTime[100],L2,Sdate,Stime,H2);
Box_SetColor(box3,Lime);
Box_SetFill(box3,true,60);
}
Else
{
if cond == true Then
{
if data2(H) > H2 Then
H2 =Data2(H);
Box_SetEnd(box3,sDate,sTime,H2);
if Data2(l < lowest(L,N)*(1+per/100)) Then
Box_Delete(box3);
}
}
}
85239 재문의
10시에 10시 5분을 시작 시간으로 설정하고 기다리면 10시 5분에 표시는 되는데, 50봉 중의 최저점 조건 때문에 이전 50봉까지 체크해서 이전 저점을 표시해줍니다. 직전 50봉 이내에 저점이 있더라도, 시작은 무조건 설정한 10시 5분봉을 최저점으로 시작하고 싶습니다.
설정한 시간 이전봉을 모두 무시할 수 있게 수정 부탁드립니다.
2024-01-04
823
글번호 175447
지표