커뮤니티
수식 수정부탁합니다
2013-03-11 02:47:54
201
글번호 60518
1.하루에 한번 발생하게해주세요 (하루에 매도후에는 매수금지 ,매수후 매도는 가능)
2.매수는 9시분 이후에 작동하고, 매도는 아무때나 가능하게해주세요
3.매도식 확인좀 부탁할께요 3프수익시 절반매도 나머지는 고점대비-1프로 매도
마이너스에는 매도 안함.
input : 투입금액(300000),P1(90);
var : count(0),cnt(0),cnt1(0),sumV(0), maV(0);
sumV = 0;
for cnt1 = 0 to P1-1 {
sumV = sumV+DayClose(cnt1);
}
maV = sumV / P1;
if CodeCategory == 1 Then{ #코스피
if BasePrice < 50000 Then
Var1 = int(int(투입금액/C)/10)*10;
Else
Var1 = int(투입금액/C);
}
if CodeCategory == 2 Then#코스닥
Var1 = int(투입금액/C);
if CodeCategory == 6 Then#옵션
Var1 = int(투입금액/(C*BigPointValue));
value1 = Upvol/DownVol*50;
count = 0;
for cnt = 0 to 10{
if sdate == EntryDate(cnt) Then
count = count+1;
}
If V >60000 and Upvol/DownVol*100 >=120 and count < 1 and C > mav
and C < dayopen*1.02 Then
buy("매수",onclose,def,var1);
if MarketPosition == 1 Then{
if CodeCategory == 1 and BasePrice < 50000 Then
Var2 = int(int(MaxContracts*0.5)/10)*10;
Else
Var2 = int(MaxContracts*0.5);
if CurrentContracts == MaxContracts Then{
var3 = AvgEntryPrice*1.05;
ExitLong("매도",AtLimit,AvgEntryPrice*1.05,"",var2,1);
}
if CurrentContracts < MaxContracts Then{
ExitLong("매도1",AtStop,highest(H,BarsSinceEntry)*0.97);
ExitLong("매도2",AtStop,var3);
}
}
답변 1
예스스탁 예스스탁 답변
2013-03-11 14:41:06
안녕하세요
예스스탁입니다.
input : 투입금액(300000),P1(90);
var : count(0),cnt(0),cnt1(0),sumV(0), maV(0);
sumV = 0;
for cnt1 = 0 to P1-1 {
sumV = sumV+DayClose(cnt1);
}
maV = sumV / P1;
if CodeCategory == 1 Then{ #코스피
if BasePrice < 50000 Then
Var1 = int(int(투입금액/C)/10)*10;
Else
Var1 = int(투입금액/C);
}
if CodeCategory == 2 Then#코스닥
Var1 = int(투입금액/C);
if CodeCategory == 6 Then#옵션
Var1 = int(투입금액/(C*BigPointValue));
value1 = Upvol/DownVol*50;
count = 0;
for cnt = 0 to 10{
if sdate == EntryDate(cnt) Then
count = count+1;
}
If MarketPosition == 0 and
V > 60000
and Upvol/DownVol*100 >=120
and count < 1
and C > mav
and C < dayopen*1.02 Then
buy("매수",onclose,def,var1);
if MarketPosition == 1 Then{
if CodeCategory == 1 and BasePrice < 50000 Then
Var2 = int(int(MaxContracts*0.5)/10)*10;
Else
Var2 = int(MaxContracts*0.5);
if CurrentContracts == MaxContracts Then{
ExitLong("매도",AtLimit,AvgEntryPrice*1.03,"",var2,1);
}
if CurrentContracts < MaxContracts Then{
ExitLong("매도1",AtStop,highest(H,BarsSinceEntry)*0.98);
ExitLong("매도2",AtStop,var3);
}
}
즐거운 하루되세요
> HI_jht7469 님이 쓴 글입니다.
> 제목 : 수식 수정부탁합니다
> 1.하루에 한번 발생하게해주세요 (하루에 매도후에는 매수금지 ,매수후 매도는 가능)
2.매수는 9시분 이후에 작동하고, 매도는 아무때나 가능하게해주세요
3.매도식 확인좀 부탁할께요 3프수익시 절반매도 나머지는 고점대비-1프로 매도
마이너스에는 매도 안함.
input : 투입금액(300000),P1(90);
var : count(0),cnt(0),cnt1(0),sumV(0), maV(0);
sumV = 0;
for cnt1 = 0 to P1-1 {
sumV = sumV+DayClose(cnt1);
}
maV = sumV / P1;
if CodeCategory == 1 Then{ #코스피
if BasePrice < 50000 Then
Var1 = int(int(투입금액/C)/10)*10;
Else
Var1 = int(투입금액/C);
}
if CodeCategory == 2 Then#코스닥
Var1 = int(투입금액/C);
if CodeCategory == 6 Then#옵션
Var1 = int(투입금액/(C*BigPointValue));
value1 = Upvol/DownVol*50;
count = 0;
for cnt = 0 to 10{
if sdate == EntryDate(cnt) Then
count = count+1;
}
If V >60000 and Upvol/DownVol*100 >=120 and count < 1 and C > mav
and C < dayopen*1.02 Then
buy("매수",onclose,def,var1);
if MarketPosition == 1 Then{
if CodeCategory == 1 and BasePrice < 50000 Then
Var2 = int(int(MaxContracts*0.5)/10)*10;
Else
Var2 = int(MaxContracts*0.5);
if CurrentContracts == MaxContracts Then{
var3 = AvgEntryPrice*1.05;
ExitLong("매도",AtLimit,AvgEntryPrice*1.05,"",var2,1);
}
if CurrentContracts < MaxContracts Then{
ExitLong("매도1",AtStop,highest(H,BarsSinceEntry)*0.97);
ExitLong("매도2",AtStop,var3);
}
}
다음글