커뮤니티
시스템식 수정 요청입니다.
2016-05-27 22:45:01
168
글번호 98574
두올산업을 5.25자로 시뮬레이션(1분봉) 해본 결과 다음과 같이 결과 값이 나왔습니다.
처음 봉의 시가가 5,180이고 종가가 5,060인데 진입을 5,180에 했습니다.
설정 상 진입을 시장가로 하거나 현재가 대비 몇 호가 위로 넣어도 동일하고,
분봉이 아닌 10틱 봉 등으로 시뮬을 해도 동일한 결과가 나옵니다.
시초가가 아닌 첫 봉 생성 이후에 진입을 하려고 하면 어떻게 해야하는지 수정 부탁드립니다.
감사합니다.
진입일시 진입종류 진입명 진입가격(원) 수량 수익률(%) 최대수익(원) 진입효율 봉 개수
청산일시 청산종류 청산명 청산가격(원) 수익(원) 누적수익(원) 최대손실(원) 청산효율 총효율
2016-05-25 9:01 매수 b 5,180 1,321 -4.25 0 0 60
2016-05-25 10:01 매수청산 BL1 4,970 -290,818 -290,818 -277,410 0 -100
2016-05-25 9:01 매수 b 5,180 683 -5.21 0 0 114
2016-05-25 11:00 매수청산(손절매) StopLoss 4,920 -184,478 -475,296 -177,580 0 -100
2016-05-25 9:05 매수 bb 5,070 1,960 -1.87 352,800 52.94 296
2016-05-25 14:33 매수청산(최대수익대비하락) StopTrailing 4,985 -186,307 -661,604 -313,600 22.06 -25
input: 매수금액1(10000000),매수금액2(10000000),지정일(20160525);
var : Ev(0),Xv(0),Xcond(false),Nday(0);
if bdate != bdate[1] Then{
Nday = Nday+1;
Xcond = false;
}
if TotalTrades > TotalTrades[1] and (LatestExitName(1) == "BL1" or LatestExitName(1) == "BL2") Then
Xcond = true;
if MarketPosition == 0 and NextBarSdate > sdate and NextBarSdate == 지정일 and Xcond == false and
NextBarOpen < C*1.05 Then
buy("b",AtMarket,def,Floor(매수금액1/C));
if MarketPosition == 1 Then{
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BL1" Then{
Condition11 = true;
Xcond = true;
}
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BL2" Then{
Condition12 = true;
Xcond = true;
}
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BP1" Then
Condition21 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BP2" Then
Condition22 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BP3" Then
Condition23 = true;
if MaxEntries == 1 and
highest(H,BarsSinceEntry) < EntryPrice*1.05 and
MaxContracts == CurrentContracts Then
buy("bb",Atlimit,EntryPrice*0.98,Floor(매수금액2/C));
if CurrentContracts > CurrentContracts[1] Then{
Ev = AvgEntryPrice;
Xv = Floor(MaxContracts*(1/3));
}
if MaxEntries >=1 Then{
if Condition11 == false Then
exitlong("BL1",AtStop,AvgEntryPrice*0.97,"",xv,1);
if Condition12 == false Then
exitlong("BL3",AtStop,AvgEntryPrice*0.96);
if Condition21 == false Then
exitlong("BP1",AtLimit,AvgEntryPrice*1.05,"",xv,1);
if Condition22 == false Then
exitlong("BP2",AtLimit,AvgEntryPrice*1.10,"",xv,1);
if Condition23 == false Then
exitlong("BP3",AtLimit,AvgEntryPrice*1.20);
if MaxEntries == 1 and
highest(H,BarsSinceEntry) >= EntryPrice*1.05 Then
ExitLong("btr",AtStop,highest(H,BarsSinceEntry)*0.95);
}
if sdate > Nday[BarsSinceEntry]+1 and stime == 144500 Then
exitlong("bx");
}
else{
Condition11 = false;
Condition12 = false;
Condition21 = false;
Condition22 = false;
Condition23 = false;
}
답변 1
예스스탁 예스스탁 답변
2016-05-30 13:52:10
안녕하세요
예스스탁입니다.
신호 타입중 atmarket은
봉완성시 if조건을 만족하면 다음봉 시가에 신호가 나오는 타입니다.
마지막봉에서는 if조건이 충족하지 못하게 조건을 수정했습니다.
input: 매수금액1(10000000),매수금액2(10000000),지정일(20160525);
var : Ev(0),Xv(0),Xcond(false),Nday(0);
if bdate != bdate[1] Then{
Nday = Nday+1;
Xcond = false;
}
if TotalTrades > TotalTrades[1] and (LatestExitName(1) == "BL1" or LatestExitName(1) == "BL2") Then
Xcond = true;
if MarketPosition == 0 and NextBarSdate > sdate and NextBarSdate == 지정일 and Xcond == false and
NextBarOpen < C*1.05 and
NextBarSdate == sdate Then
buy("b",AtMarket,def,Floor(매수금액1/C));
if MarketPosition == 1 Then{
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BL1" Then{
Condition11 = true;
Xcond = true;
}
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BL2" Then{
Condition12 = true;
Xcond = true;
}
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BP1" Then
Condition21 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BP2" Then
Condition22 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BP3" Then
Condition23 = true;
if MaxEntries == 1 and
highest(H,BarsSinceEntry) < EntryPrice*1.05 and
MaxContracts == CurrentContracts Then
buy("bb",Atlimit,EntryPrice*0.98,Floor(매수금액2/C));
if CurrentContracts > CurrentContracts[1] Then{
Ev = AvgEntryPrice;
Xv = Floor(MaxContracts*(1/3));
}
if MaxEntries >=1 Then{
if Condition11 == false Then
exitlong("BL1",AtStop,AvgEntryPrice*0.97,"",xv,1);
if Condition12 == false Then
exitlong("BL3",AtStop,AvgEntryPrice*0.96);
if Condition21 == false Then
exitlong("BP1",AtLimit,AvgEntryPrice*1.05,"",xv,1);
if Condition22 == false Then
exitlong("BP2",AtLimit,AvgEntryPrice*1.10,"",xv,1);
if Condition23 == false Then
exitlong("BP3",AtLimit,AvgEntryPrice*1.20);
if MaxEntries == 1 and
highest(H,BarsSinceEntry) >= EntryPrice*1.05 Then
ExitLong("btr",AtStop,highest(H,BarsSinceEntry)*0.95);
}
if sdate > Nday[BarsSinceEntry]+1 and stime == 144500 Then
exitlong("bx");
}
else{
Condition11 = false;
Condition12 = false;
Condition21 = false;
Condition22 = false;
Condition23 = false;
}
즐거운 하루되세요
> 깜피 님이 쓴 글입니다.
> 제목 : 시스템식 수정 요청입니다.
> 두올산업을 5.25자로 시뮬레이션(1분봉) 해본 결과 다음과 같이 결과 값이 나왔습니다.
처음 봉의 시가가 5,180이고 종가가 5,060인데 진입을 5,180에 했습니다.
설정 상 진입을 시장가로 하거나 현재가 대비 몇 호가 위로 넣어도 동일하고,
분봉이 아닌 10틱 봉 등으로 시뮬을 해도 동일한 결과가 나옵니다.
시초가가 아닌 첫 봉 생성 이후에 진입을 하려고 하면 어떻게 해야하는지 수정 부탁드립니다.
감사합니다.
진입일시 진입종류 진입명 진입가격(원) 수량 수익률(%) 최대수익(원) 진입효율 봉 개수
청산일시 청산종류 청산명 청산가격(원) 수익(원) 누적수익(원) 최대손실(원) 청산효율 총효율
2016-05-25 9:01 매수 b 5,180 1,321 -4.25 0 0 60
2016-05-25 10:01 매수청산 BL1 4,970 -290,818 -290,818 -277,410 0 -100
2016-05-25 9:01 매수 b 5,180 683 -5.21 0 0 114
2016-05-25 11:00 매수청산(손절매) StopLoss 4,920 -184,478 -475,296 -177,580 0 -100
2016-05-25 9:05 매수 bb 5,070 1,960 -1.87 352,800 52.94 296
2016-05-25 14:33 매수청산(최대수익대비하락) StopTrailing 4,985 -186,307 -661,604 -313,600 22.06 -25
input: 매수금액1(10000000),매수금액2(10000000),지정일(20160525);
var : Ev(0),Xv(0),Xcond(false),Nday(0);
if bdate != bdate[1] Then{
Nday = Nday+1;
Xcond = false;
}
if TotalTrades > TotalTrades[1] and (LatestExitName(1) == "BL1" or LatestExitName(1) == "BL2") Then
Xcond = true;
if MarketPosition == 0 and NextBarSdate > sdate and NextBarSdate == 지정일 and Xcond == false and
NextBarOpen < C*1.05 Then
buy("b",AtMarket,def,Floor(매수금액1/C));
if MarketPosition == 1 Then{
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BL1" Then{
Condition11 = true;
Xcond = true;
}
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BL2" Then{
Condition12 = true;
Xcond = true;
}
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BP1" Then
Condition21 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BP2" Then
Condition22 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BP3" Then
Condition23 = true;
if MaxEntries == 1 and
highest(H,BarsSinceEntry) < EntryPrice*1.05 and
MaxContracts == CurrentContracts Then
buy("bb",Atlimit,EntryPrice*0.98,Floor(매수금액2/C));
if CurrentContracts > CurrentContracts[1] Then{
Ev = AvgEntryPrice;
Xv = Floor(MaxContracts*(1/3));
}
if MaxEntries >=1 Then{
if Condition11 == false Then
exitlong("BL1",AtStop,AvgEntryPrice*0.97,"",xv,1);
if Condition12 == false Then
exitlong("BL3",AtStop,AvgEntryPrice*0.96);
if Condition21 == false Then
exitlong("BP1",AtLimit,AvgEntryPrice*1.05,"",xv,1);
if Condition22 == false Then
exitlong("BP2",AtLimit,AvgEntryPrice*1.10,"",xv,1);
if Condition23 == false Then
exitlong("BP3",AtLimit,AvgEntryPrice*1.20);
if MaxEntries == 1 and
highest(H,BarsSinceEntry) >= EntryPrice*1.05 Then
ExitLong("btr",AtStop,highest(H,BarsSinceEntry)*0.95);
}
if sdate > Nday[BarsSinceEntry]+1 and stime == 144500 Then
exitlong("bx");
}
else{
Condition11 = false;
Condition12 = false;
Condition21 = false;
Condition22 = false;
Condition23 = false;
}
다음글
이전글