커뮤니티
식 좀 검토해 주세요..
2010-02-01 15:31:52
689
글번호 27790
아래는 답변 주신 내용입니다.
*수식이 작동 안됩니다.
*적용가능한 차트에 몇개 적용해 봤는데, 매수. 청산 하나도 뜨지 않네요.
검토 좀 부탁드립니다.
감사합니다.
-----------------------------------------------
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 date != date[1] Then{
var1 = var1+1;
Condition1 = false;
Condition2 = Condition1[1];
Condition3 = Condition2[1];
Condition4 = Condition3[1];
Condition5 = Condition4[1];
Condition6 = Condition5[1];
}
if H >= 상한가 Then
Condition1 = true;
if var1 > 5 and
stime < 150000 and
Condition2 == true and
Condition3 == false and
Condition4 == false and
Condition5 == false and
Condition6 == false and
dayopen <= DayClose(1)*0.98 and DayOpen >= DayClose(1)*1.08 Then
buy("b",atlimit,dayopen*0.96);
SetStopProfittarget(15);
SetStopLoss(7);
즐거운 하루되세요
> <현물, 분봉에서 매매>
*매수조건
-전일, 첫 상한가이고(전일 상한가 이전 5일동안 상한가가 없어야 함)
-당일 시가가, 전일 종가대비 -2% ~ +8% 이고
-당일 시가 대비 4%가 하락하면, 매수
*매수청산 조건
-매수가 대비 15% 수익시 매수청산
-매수가 대비 7% 손실시 청산
답변 1
예스스탁 예스스탁 답변
2010-02-02 10:37:33
안녕하세요
예스스탁입니다.
죄송합니다. 부등호의 방향을 잘못 작성했습니다.
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 date != date[1] Then{
var1 = var1+1;
Condition1 = false;
Condition2 = Condition1[1];
Condition3 = Condition2[1];
Condition4 = Condition3[1];
Condition5 = Condition4[1];
Condition6 = Condition5[1];
}
if H >= 상한가 Then
Condition1 = true;
if var1 > 5 and
stime < 150000 and
Condition2 == true and
Condition3 == false and
Condition4 == false and
Condition5 == false and
Condition6 == false and
dayopen >= DayClose(1)*0.98 and DayOpen <= DayClose(1)*1.08 Then
buy("b",atlimit,dayopen*0.96);
SetStopProfittarget(15);
SetStopLoss(7);
즐거운 하루되세요
> 쌀사비팔 님이 쓴 글입니다.
> 제목 : 식 좀 검토해 주세요..
> 아래는 답변 주신 내용입니다.
*수식이 작동 안됩니다.
*적용가능한 차트에 몇개 적용해 봤는데, 매수. 청산 하나도 뜨지 않네요.
검토 좀 부탁드립니다.
감사합니다.
-----------------------------------------------
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 date != date[1] Then{
var1 = var1+1;
Condition1 = false;
Condition2 = Condition1[1];
Condition3 = Condition2[1];
Condition4 = Condition3[1];
Condition5 = Condition4[1];
Condition6 = Condition5[1];
}
if H >= 상한가 Then
Condition1 = true;
if var1 > 5 and
stime < 150000 and
Condition2 == true and
Condition3 == false and
Condition4 == false and
Condition5 == false and
Condition6 == false and
dayopen <= DayClose(1)*0.98 and DayOpen >= DayClose(1)*1.08 Then
buy("b",atlimit,dayopen*0.96);
SetStopProfittarget(15);
SetStopLoss(7);
즐거운 하루되세요
> <현물, 분봉에서 매매>
*매수조건
-전일, 첫 상한가이고(전일 상한가 이전 5일동안 상한가가 없어야 함)
-당일 시가가, 전일 종가대비 -2% ~ +8% 이고
-당일 시가 대비 4%가 하락하면, 매수
*매수청산 조건
-매수가 대비 15% 수익시 매수청산
-매수가 대비 7% 손실시 청산
다음글
이전글