답변완료
문의
오류가 뜨네요. 정정부탁드립니다.
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 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 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;
}
}
if C >= 상한가 Then
PlotPaintBar1(H,"상한가1",RED);
if H >= 상한가 and C < 상한가 Then
plot2(H,"상한가2",MAGENTA);
2021-03-17
703
글번호 147188
강조
답변완료
문의
검증에러가 뜹니다. 수정부탁드려요
input: P5(20);
VAR : HC(0), HO(0), HH(0), HL(0), MH(0), ML(0), MMH(0), MML(0);
var : T(0);
var : BTL1(0),BTL2(0),BTL3(0),BTL4(0),BTL5(0),BTL6(0);
var : STL1(0),STL2(0),STL3(0),STL4(0),STL5(0),STL6(0);
HC= (C+H+O+L)/4;
HO= AMA(HC[1], 0.5);
HH= MAX(H, HC, HO);
HL= MIN(L, HC, HO);
MH=MA(HC, P5);
ML=MA(HO, P5);
MMH= MAX(MH, ML);
MML= MIN(MH, ML);
if MH > MH[1] Then
T = 1;
if MH < MH[1] Then
T = -1;
#이평상승중 가격이 하락해 이평+1틱 이하의 시세가 발생하면 즉시 매수진입
if T == 1 and MarketPosition <= 0 and L > MH+PriceScale*1 Then
buy("b",atlimit,MH+PriceScale*1,4);
#이평하락중 가격이 상승해 이평-1틱 이상의 시세가 발생하면 즉시 매도진입
if T == -1 and MarketPosition >= 0 and L > MH+PriceScale*1 Then
sell("s",atlimit,MH+PriceScale*1,4);
if MarketPosition == 1 Then{
ExitLong("BP1",Atlimit,EntryPrice+PriceScale*5,"",Floor(MaxContracts*(1/4)),1);
ExitLong("BP2",Atlimit,EntryPrice+PriceScale*10,"",Floor(MaxContracts*(1/4)),1);
ExitLong("BP3",Atlimit,EntryPrice+PriceScale*15,"",Floor(MaxContracts*(1/4)),1);
ExitLong("BP4",Atlimit,EntryPrice+PriceScale*20);
ExitLong("BL1",AtStop,EntryPrice-PriceScale*15,"",Floor(MaxContracts*0.5),1);
ExitLong("BL2",AtStop,EntryPrice-PriceScale*20);
TL_Delete(BTL1);
TL_Delete(BTL2);
TL_Delete(BTL3);
TL_Delete(BTL4);
TL_Delete(BTL5);
TL_Delete(BTL6);
BTL1 = TL_New(EntryDate,EntryTime,EntryPrice+PriceScale*5,sdate,stime,EntryPrice+PriceScale*5);
BTL2 = TL_New(EntryDate,EntryTime,EntryPrice+PriceScale*10,sdate,stime,EntryPrice+PriceScale*10);
BTL3 = TL_New(EntryDate,EntryTime,EntryPrice+PriceScale*15,sdate,stime,EntryPrice+PriceScale*15);
BTL4 = TL_New(EntryDate,EntryTime,EntryPrice+PriceScale*20,sdate,stime,EntryPrice+PriceScale*20);
BTL5 = TL_New(EntryDate,EntryTime,EntryPrice-PriceScale*15,sdate,stime,EntryPrice-PriceScale*15);
BTL6 = TL_New(EntryDate,EntryTime,EntryPrice-PriceScale*20,sdate,stime,EntryPrice-PriceScale*20);
TL_SetColor(BTL1,RED);
TL_SetColor(BTL2,RED);
TL_SetColor(BTL3,RED);
TL_SetColor(BTL4,RED);
TL_SetColor(BTL5,BLUE);
TL_SetColor(BTL6,BLUE);
}
if MarketPosition == -1 Then{
ExitShort("SP1",Atlimit,EntryPrice-PriceScale*5,"",Floor(MaxContracts*(1/4)),1);
ExitShort("SP2",Atlimit,EntryPrice-PriceScale*10,"",Floor(MaxContracts*(1/4)),1);
ExitShort("sP3",Atlimit,EntryPrice-PriceScale*15,"",Floor(MaxContracts*(1/4)),1);
ExitShort("SP4",Atlimit,EntryPrice-PriceScale*20);
ExitShort("sL1",AtStop,EntryPrice+PriceScale*15,"",Floor(MaxContracts*0.5),1);
ExitShort("SL2",AtStop,EntryPrice+PriceScale*20);
TL_Delete(STL1);
TL_Delete(STL2);
TL_Delete(STL3);
TL_Delete(STL4);
TL_Delete(STL5);
TL_Delete(STL6);
STL1 = TL_New(EntryDate,EntryTime,EntryPrice-PriceScale*5,sdate,stime,EntryPrice-PriceScale*5);
STL2 = TL_New(EntryDate,EntryTime,EntryPrice-PriceScale*10,sdate,stime,EntryPrice-PriceScale*10);
STL3 = TL_New(EntryDate,EntryTime,EntryPrice-PriceScale*15,sdate,stime,EntryPrice-PriceScale*15);
STL4 = TL_New(EntryDate,EntryTime,EntryPrice-PriceScale*20,sdate,stime,EntryPrice-PriceScale*20);
STL5 = TL_New(EntryDate,EntryTime,EntryPrice+PriceScale*15,sdate,stime,EntryPrice+PriceScale*15);
STL6 = TL_New(EntryDate,EntryTime,EntryPrice+PriceScale*20,sdate,stime,EntryPrice+PriceScale*20);
TL_SetColor(STL1,RED);
TL_SetColor(STL2,RED);
TL_SetColor(STL3,RED);
TL_SetColor(STL4,RED);
TL_SetColor(STL5,BLUE);
TL_SetColor(STL6,BLUE);
}
2021-03-17
907
글번호 147187
시스템