커뮤니티
다시문의요
2013-04-02 13:26:30
207
글번호 61518
죄송요. 다시문의할께요.
일봉차트에서 5일선이 있잖아요 주가가 그5일선을 아래로 이탈시 장중 9시~14시30분까지
이탈하여도 매도 안하구요 2시30분넘어서도 주가가 5일선 밑에 있을경우 매도 하는식으로 해주세요 . 주가 상승시 5프로 이상일때 매도 하구 나머지는 음봉일때 매도로 되어있는데요 음봉일때 매도는 지우고요 5일선 이탈시 매도로 바구어주세요
최종적으로요 - 5프로상승시 절반 매도 절반은 5일선 이탈시 매도, 매수가 대비 -1프로 빠질경우 무조건 매도
하루에 한번 매수하는걸로 했는데요,2번까지 매수 가능하게 해주세요
[사용자함수:entriestoday]
Input : nDate(Numeric);
Var : Count(0);
Count = 0 ;
For Value1 = 0 To 10 {
If EntryDate(Value1) == nDate Then
Count = Count + 1;
}
EntriesToday = Count;
[시스템식]
input : 투입금액(1000000);
var : 상한가(0), UpLimit(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),entryVol(0),Xvol(0);
#kospi
if CodeCategory == 1 Then{
if BasePrice < 50000 Then #기준가 5만원 미만
entryVol = int(int(투입금액/C)/10)*10;
Else #5만원 이상
entryVol = int(투입금액/C);
}
#kosdoq
if CodeCategory == 2 Then
entryVol = int(투입금액/C);
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 {
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;
}
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;
}
}
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;
}
if CodeCategory() == 1 || CodeCategory() == 2 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
상한가 = iff(up6>=5000, up5, up6);
}
else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF
상한가 = up6;
}
}
if MarketPosition == 0 Then
buy("b",AtStop,상한가*0.99,entryVol);
if MarketPosition == 1 Then{
#청산수량 50% 계산
if CodeCategory == 1 Then{
if BasePrice < 50000 Then #기준가 5만원 미만
Xvol = int(int(MaxContracts*0.5)/10)*10;
Else #5만원 이상
Xvol = int(MaxContracts*0.5);
}
if CodeCategory == 2 Then
Xvol = int(MaxContracts*0.5);
if CurrentContracts == MaxContracts Then
exitlong("bx1",AtLimit,EntryPrice*1.06,"",Xvol,1);
if CurrentContracts < MaxContracts and stime == 150000 and C < DayOpen Then
exitlong("bx2");
}
SetStopLoss(1,PercentStop);
답변 1
예스스탁 예스스탁 답변
2013-04-02 14:00:52
안녕하세요
예스스탁입니다.
input : 투입금액(1000000),P(5);
var : 상한가(0), UpLimit(0),sum(0),cnt(0),daymav(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),entryVol(0),Xvol(0);
#kospi
if CodeCategory == 1 Then{
if BasePrice < 50000 Then #기준가 5만원 미만
entryVol = int(int(투입금액/C)/10)*10;
Else #5만원 이상
entryVol = int(투입금액/C);
}
#kosdoq
if CodeCategory == 2 Then
entryVol = int(투입금액/C);
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 {
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;
}
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;
}
}
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;
}
if CodeCategory() == 1 || CodeCategory() == 2 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
상한가 = iff(up6>=5000, up5, up6);
}
else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF
상한가 = up6;
}
}
sum = 0;
for cnt = 0 to P-1{
sum = sum+DayClose(cnt);
}
daymav = sum/P;
if MarketPosition == 0 Then
buy("b",AtStop,상한가*0.99,entryVol);
if MarketPosition == 1 Then{
#청산수량 50% 계산
if CodeCategory == 1 Then{
if BasePrice < 50000 Then #기준가 5만원 미만
Xvol = int(int(MaxContracts*0.5)/10)*10;
Else #5만원 이상
Xvol = int(MaxContracts*0.5);
}
if CodeCategory == 2 Then
Xvol = int(MaxContracts*0.5);
if CurrentContracts == MaxContracts Then
exitlong("bx1",AtLimit,EntryPrice*1.05,"",Xvol,1);
if CurrentContracts < MaxContracts and stime == 143000 and C < daymav Then
exitlong("bx2");
}
SetStopLoss(1,PercentStop);
즐거운 하루되세요
> HI_jht7469 님이 쓴 글입니다.
> 제목 : 다시문의요
> 죄송요. 다시문의할께요.
일봉차트에서 5일선이 있잖아요 주가가 그5일선을 아래로 이탈시 장중 9시~14시30분까지
이탈하여도 매도 안하구요 2시30분넘어서도 주가가 5일선 밑에 있을경우 매도 하는식으로 해주세요 . 주가 상승시 5프로 이상일때 매도 하구 나머지는 음봉일때 매도로 되어있는데요 음봉일때 매도는 지우고요 5일선 이탈시 매도로 바구어주세요
최종적으로요 - 5프로상승시 절반 매도 절반은 5일선 이탈시 매도, 매수가 대비 -1프로 빠질경우 무조건 매도
하루에 한번 매수하는걸로 했는데요,2번까지 매수 가능하게 해주세요
[사용자함수:entriestoday]
Input : nDate(Numeric);
Var : Count(0);
Count = 0 ;
For Value1 = 0 To 10 {
If EntryDate(Value1) == nDate Then
Count = Count + 1;
}
EntriesToday = Count;
[시스템식]
input : 투입금액(1000000);
var : 상한가(0), UpLimit(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),entryVol(0),Xvol(0);
#kospi
if CodeCategory == 1 Then{
if BasePrice < 50000 Then #기준가 5만원 미만
entryVol = int(int(투입금액/C)/10)*10;
Else #5만원 이상
entryVol = int(투입금액/C);
}
#kosdoq
if CodeCategory == 2 Then
entryVol = int(투입금액/C);
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 {
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;
}
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;
}
}
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;
}
if CodeCategory() == 1 || CodeCategory() == 2 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
상한가 = iff(up6>=5000, up5, up6);
}
else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF
상한가 = up6;
}
}
if MarketPosition == 0 Then
buy("b",AtStop,상한가*0.99,entryVol);
if MarketPosition == 1 Then{
#청산수량 50% 계산
if CodeCategory == 1 Then{
if BasePrice < 50000 Then #기준가 5만원 미만
Xvol = int(int(MaxContracts*0.5)/10)*10;
Else #5만원 이상
Xvol = int(MaxContracts*0.5);
}
if CodeCategory == 2 Then
Xvol = int(MaxContracts*0.5);
if CurrentContracts == MaxContracts Then
exitlong("bx1",AtLimit,EntryPrice*1.06,"",Xvol,1);
if CurrentContracts < MaxContracts and stime == 150000 and C < DayOpen Then
exitlong("bx2");
}
SetStopLoss(1,PercentStop);
다음글
이전글