커뮤니티
상한가질문입니다
2018-06-23 22:40:28
197
글번호 119989
질문1.
상한가 수식 관련된 것에보면 bp라는 거이 보이는데
이게 정확히 먼지궁금합니다.
질문2.
답변에 보면 대부분 상한가 관련되어서는 아래의 수식을 답변을 주시는데요
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[N] >= 상한가[N] Then
find(1);
수식에서 궁금한게
이해를 하자면 n봉전에 상한가를 갔는지 확인하는 수식인것은 알겠는데요
bp[0]라는 말은 현재 봉을 기준으로 bp라는 값을 얻어오는데
N값은 현재봉이아니라 그이전의 봉의 상한가를 찾는것인데
bp를 그때 기준으로 옮기지 않고도 상한가가 찾아지는게 신기합니다
제가 잘못이해한것인지
아님 bp에도 bp[n] 이런식으로 고쳐야하는지궁금합니다.
bp가 무엇이길래 bp는 현재봉기준으로 값을 얻어도 예전 상한가를 도달한지 알수잇는지궁금합니다
답변 1
예스스탁 예스스탁 답변
2018-06-25 13:33:19
안녕하세요
예스스탁입니다.
1
bp는 기준가격(BasePrice)입니다.
거래소에서 제공하는 종목의 기준가격입니다.
상하한가의 기준이 되는 가격으로 일반적으로 전일종가이지만
권리락등 이벤트 발생시에는 전일종가와 다르게 됩니다.
2
수식은 매봉계산을 하고 그 값을 저장하고 있습니다.
그러므로 해당수식에서 매봉값을 계산해 "상한가"라는 변수에 저장하고
있으며 상한가[n]으로 n봉전에 값을 가져와 사용한 내용입니다.
즐거운 하루되세요
> 여유로운투자 님이 쓴 글입니다.
> 제목 : 상한가질문입니다
> 질문1.
상한가 수식 관련된 것에보면 bp라는 거이 보이는데
이게 정확히 먼지궁금합니다.
질문2.
답변에 보면 대부분 상한가 관련되어서는 아래의 수식을 답변을 주시는데요
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[N] >= 상한가[N] Then
find(1);
수식에서 궁금한게
이해를 하자면 n봉전에 상한가를 갔는지 확인하는 수식인것은 알겠는데요
bp[0]라는 말은 현재 봉을 기준으로 bp라는 값을 얻어오는데
N값은 현재봉이아니라 그이전의 봉의 상한가를 찾는것인데
bp를 그때 기준으로 옮기지 않고도 상한가가 찾아지는게 신기합니다
제가 잘못이해한것인지
아님 bp에도 bp[n] 이런식으로 고쳐야하는지궁금합니다.
bp가 무엇이길래 bp는 현재봉기준으로 값을 얻어도 예전 상한가를 도달한지 알수잇는지궁금합니다