커뮤니티
수식 부탁드립니다.
2010-03-15 10:20:39
539
글번호 28654
아래 수식 변경 부탁드립니다.
*현재수식의 “매수부분”을 모두 삭제하고 아래 내용으로 바꿔 주십시오.
*매수 조건...
1. 당일 시가가, 전일 종가대비 -1% ~ +10%이고, 5일 이격도가 100이상이면 당일 시가에 즉시 매수
2. 당일 시가가, 전일 종가대비 -5% ~ -10%이면, 당일 시가에 즉시 매수
감사합니다.
----------------------------------------
input : 전일날짜(20100308);
var : 상한가(0), UpLimit(0);
var : aaa(0), bbb(0), ccc(0), ddd(0), eee(0),fff(0);
if date >= 19981207 then {
if date < 20050328 && CodeCategory() == 2 then
UpLimit = (BP[0] * 1.12);
Else
UpLimit = (BP[0] * 1.15);
if CodeCategory() == 2 then {
if date >= 20030721 then {
aaa = int(UpLimit/100+0.00001)*100;
bbb = int(UpLimit/100+0.00001)*100;
ccc = int(UpLimit/100+0.00001)*100;
ddd = int(UpLimit/50+0.00001)*50;
eee = int(UpLimit/10+0.00001)*10;
fff = int(UpLimit/5+0.00001)*5;
}
else {
aaa = int(UpLimit/1000+0.00001)*1000;
bbb = int(UpLimit/500+0.00001)*500;
ccc = int(UpLimit/100+0.00001)*100;
ddd = int(UpLimit/50+0.00001)*50;
eee = int(UpLimit/10+0.00001)*10;
fff = int(UpLimit/10+0.00001)*10;
}
}
Else {
aaa = int(UpLimit/1000+0.00001)*1000;
bbb = int(UpLimit/500+0.00001)*500;
ccc = int(UpLimit/100+0.00001)*100;
ddd = int(UpLimit/50+0.00001)*50;
eee = int(UpLimit/10+0.00001)*10;
fff = int(UpLimit/5+0.00001)*5;
}
if CodeCategory() == 1 || CodeCategory() == 2 then {
If BP >= 500000 Then
상한가 = aaa;
Else If BP >= 100000 Then
상한가 = iff(bbb>=500000, aaa, bbb);
Else If BP >= 50000 Then
상한가 = iff(ccc>=100000, bbb, ccc);
Else If BP >= 10000 Then
상한가 = iff(ddd>=50000, ccc, ddd);
Else If BP >= 5000 Then
상한가 = iff(eee>=10000, ddd, eee);
Else
상한가 = iff(fff>=5000, eee, fff);
}
else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF
상한가 = fff;
}
}
if stime == 150000 then{
if sDate == 전일날짜 and NextBarOpen >= C*1.015 and NextBarOpen <= C*1.05 Then
buy("b1",AtMarket);
if sDate == 전일날짜 and NextBarOpen <= C*0.96 and NextBarOpen >= C*0.91 Then
buy("b2",AtMarket);
}
if stime == 100000 and C > EntryPrice and H < 상한가 Then
exitlong();
if stime == 120000 and C > EntryPrice and H < 상한가 Then
exitlong();
if stime == 140000 and C > EntryPrice and H < 상한가 Then
exitlong();
if stime == 144800 and H < 상한가 Then
exitlong();
if MarketPosition == 1 and stime == 150000 Then
exitlong("bx",AtMarket);
답변 1
예스스탁 예스스탁 답변
2010-03-15 10:34:09
안녀하세요
예스스탁입니다.
input : 전일날짜(20100308),P(5);
var : 상한가(0), UpLimit(0);
var : aaa(0), bbb(0), ccc(0), ddd(0), eee(0),fff(0);
if date >= 19981207 then {
if date < 20050328 && CodeCategory() == 2 then
UpLimit = (BP[0] * 1.12);
Else
UpLimit = (BP[0] * 1.15);
if CodeCategory() == 2 then {
if date >= 20030721 then {
aaa = int(UpLimit/100+0.00001)*100;
bbb = int(UpLimit/100+0.00001)*100;
ccc = int(UpLimit/100+0.00001)*100;
ddd = int(UpLimit/50+0.00001)*50;
eee = int(UpLimit/10+0.00001)*10;
fff = int(UpLimit/5+0.00001)*5;
}
else {
aaa = int(UpLimit/1000+0.00001)*1000;
bbb = int(UpLimit/500+0.00001)*500;
ccc = int(UpLimit/100+0.00001)*100;
ddd = int(UpLimit/50+0.00001)*50;
eee = int(UpLimit/10+0.00001)*10;
fff = int(UpLimit/10+0.00001)*10;
}
}
Else {
aaa = int(UpLimit/1000+0.00001)*1000;
bbb = int(UpLimit/500+0.00001)*500;
ccc = int(UpLimit/100+0.00001)*100;
ddd = int(UpLimit/50+0.00001)*50;
eee = int(UpLimit/10+0.00001)*10;
fff = int(UpLimit/5+0.00001)*5;
}
if CodeCategory() == 1 || CodeCategory() == 2 then {
If BP >= 500000 Then
상한가 = aaa;
Else If BP >= 100000 Then
상한가 = iff(bbb>=500000, aaa, bbb);
Else If BP >= 50000 Then
상한가 = iff(ccc>=100000, bbb, ccc);
Else If BP >= 10000 Then
상한가 = iff(ddd>=50000, ccc, ddd);
Else If BP >= 5000 Then
상한가 = iff(eee>=10000, ddd, eee);
Else
상한가 = iff(fff>=5000, eee, fff);
}
else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF
상한가 = fff;
}
}
var2 = 0;
for var1 = 0 to P-1{
var2 = var2+DayClose(var1);
}
var3 = var2/P;
var4 = C/var3*100;
if stime == 150000 then{
if sDate == 전일날짜 and NextBarOpen >= C*0.99 and NextBarOpen <= C*1.1 and var4 >= 100 Then
buy("b1",AtMarket);
if sDate == 전일날짜 and NextBarOpen <= C*0.95 and NextBarOpen >= C*0.90 Then
buy("b2",AtMarket);
}
if stime == 100000 and C > EntryPrice and H < 상한가 Then
exitlong();
if stime == 120000 and C > EntryPrice and H < 상한가 Then
exitlong();
if stime == 140000 and C > EntryPrice and H < 상한가 Then
exitlong();
if stime == 144800 and H < 상한가 Then
exitlong();
if MarketPosition == 1 and stime == 150000 Then
exitlong("bx",AtMarket);
즐거운 하루되세요
> 쌀사비팔 님이 쓴 글입니다.
> 제목 : 수식 부탁드립니다.
> 아래 수식 변경 부탁드립니다.
*현재수식의 “매수부분”을 모두 삭제하고 아래 내용으로 바꿔 주십시오.
*매수 조건...
1. 당일 시가가, 전일 종가대비 -1% ~ +10%이고, 5일 이격도가 100이상이면 당일 시가에 즉시 매수
2. 당일 시가가, 전일 종가대비 -5% ~ -10%이면, 당일 시가에 즉시 매수
감사합니다.
----------------------------------------
input : 전일날짜(20100308);
var : 상한가(0), UpLimit(0);
var : aaa(0), bbb(0), ccc(0), ddd(0), eee(0),fff(0);
if date >= 19981207 then {
if date < 20050328 && CodeCategory() == 2 then
UpLimit = (BP[0] * 1.12);
Else
UpLimit = (BP[0] * 1.15);
if CodeCategory() == 2 then {
if date >= 20030721 then {
aaa = int(UpLimit/100+0.00001)*100;
bbb = int(UpLimit/100+0.00001)*100;
ccc = int(UpLimit/100+0.00001)*100;
ddd = int(UpLimit/50+0.00001)*50;
eee = int(UpLimit/10+0.00001)*10;
fff = int(UpLimit/5+0.00001)*5;
}
else {
aaa = int(UpLimit/1000+0.00001)*1000;
bbb = int(UpLimit/500+0.00001)*500;
ccc = int(UpLimit/100+0.00001)*100;
ddd = int(UpLimit/50+0.00001)*50;
eee = int(UpLimit/10+0.00001)*10;
fff = int(UpLimit/10+0.00001)*10;
}
}
Else {
aaa = int(UpLimit/1000+0.00001)*1000;
bbb = int(UpLimit/500+0.00001)*500;
ccc = int(UpLimit/100+0.00001)*100;
ddd = int(UpLimit/50+0.00001)*50;
eee = int(UpLimit/10+0.00001)*10;
fff = int(UpLimit/5+0.00001)*5;
}
if CodeCategory() == 1 || CodeCategory() == 2 then {
If BP >= 500000 Then
상한가 = aaa;
Else If BP >= 100000 Then
상한가 = iff(bbb>=500000, aaa, bbb);
Else If BP >= 50000 Then
상한가 = iff(ccc>=100000, bbb, ccc);
Else If BP >= 10000 Then
상한가 = iff(ddd>=50000, ccc, ddd);
Else If BP >= 5000 Then
상한가 = iff(eee>=10000, ddd, eee);
Else
상한가 = iff(fff>=5000, eee, fff);
}
else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF
상한가 = fff;
}
}
if stime == 150000 then{
if sDate == 전일날짜 and NextBarOpen >= C*1.015 and NextBarOpen <= C*1.05 Then
buy("b1",AtMarket);
if sDate == 전일날짜 and NextBarOpen <= C*0.96 and NextBarOpen >= C*0.91 Then
buy("b2",AtMarket);
}
if stime == 100000 and C > EntryPrice and H < 상한가 Then
exitlong();
if stime == 120000 and C > EntryPrice and H < 상한가 Then
exitlong();
if stime == 140000 and C > EntryPrice and H < 상한가 Then
exitlong();
if stime == 144800 and H < 상한가 Then
exitlong();
if MarketPosition == 1 and stime == 150000 Then
exitlong("bx",AtMarket);
다음글
이전글