커뮤니티
47730번 수식 변경 요청
2016-05-16 23:00:23
137
글번호 98116
말씀하신 대로 다른 진입신호로 설정을 했는데 다음과 같이 진입을 합니다.
진입일시 진입종류 진입명 진입가격(원) 수량 수익률(%) 최대수익(원)
청산일시 청산종류 청산명 청산가격(원) 수익(원) 누적수익(원) 최대손실(원)
2016-04-28 9:01 매수 b 13,750 245 -3.47 0
2016-04-28 9:02 매수청산 BL1 13,300 -116,877 -116,877 -110,250
2016-04-28 9:01 매수 b 13,750 490 -5.29 0
2016-04-28 9:11 매수청산 BL3 13,050 -356,132 -473,009 -343,000
2016-04-28 9:04 매수 bb 13,400 412 5.02 329,600
2016-04-28 12:51 매수청산 BP1 14,100 277,070 -195,939 -206,000
2016-04-28 9:04 매수 bb 13,400 334 9.86 484,300
2016-04-28 12:56 매수청산 BP2 14,750 441,497 245,558 -167,000
9:02에 1차 손절이 나왔으므로 9:04에는 진입이 안나오도록 하고 싶습니다.
1. 손절 발생 시 재매수 금지
2. 최초 거래 후 5% 이상 상승(1차 익절)한 후 하락하여 2차 매수 선까지 올 경우 2차 매수 금지.
이렇게 수식 변경 부탁드리겠습니다.
감사합니다.
답변 1
예스스탁 예스스탁 답변
2016-05-17 12:46:14
안녕하세요
예스스탁입니다.
식을 수정했습니다.
첫진입은 시초가에 한번만 들어가고
추가매수의 경우에는 첫진입후 일부 청산된 경우에는 신호발생하지 않게 수정했습니다.
input: 매수금액1(10000000),매수금액2(10000000),지정일(20160428);
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.95);
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;
}
즐거운 하루되세요
> 깜피 님이 쓴 글입니다.
> 제목 : 47730번 수식 변경 요청
> 말씀하신 대로 다른 진입신호로 설정을 했는데 다음과 같이 진입을 합니다.
진입일시 진입종류 진입명 진입가격(원) 수량 수익률(%) 최대수익(원)
청산일시 청산종류 청산명 청산가격(원) 수익(원) 누적수익(원) 최대손실(원)
2016-04-28 9:01 매수 b 13,750 245 -3.47 0
2016-04-28 9:02 매수청산 BL1 13,300 -116,877 -116,877 -110,250
2016-04-28 9:01 매수 b 13,750 490 -5.29 0
2016-04-28 9:11 매수청산 BL3 13,050 -356,132 -473,009 -343,000
2016-04-28 9:04 매수 bb 13,400 412 5.02 329,600
2016-04-28 12:51 매수청산 BP1 14,100 277,070 -195,939 -206,000
2016-04-28 9:04 매수 bb 13,400 334 9.86 484,300
2016-04-28 12:56 매수청산 BP2 14,750 441,497 245,558 -167,000
9:02에 1차 손절이 나왔으므로 9:04에는 진입이 안나오도록 하고 싶습니다.
1. 손절 발생 시 재매수 금지
2. 최초 거래 후 5% 이상 상승(1차 익절)한 후 하락하여 2차 매수 선까지 올 경우 2차 매수 금지.
이렇게 수식 변경 부탁드리겠습니다.
감사합니다.
다음글
이전글