커뮤니티
시스템 추가 문의드립니다.
2016-04-26 07:45:59
102
글번호 97440
기존에 2회 분할 매수에 2회 분할 매도 수식을 작성해주셔서 잘 활용하고 있는데
식을 조금 수정하고 싶습니다.
1. 매도는 5%, 10%, 15% 3회 분할.
2. 1분봉에 적용해서 사용 중인데 봉을 몇 개 띄워 놓느냐에 따라서 진입 일자, 시간 등이 달라집니다. 따라서 특정일에 진입할 수 있는 로직 필요
(예, 현재 1분봉 적용 시 봉을 400개 띄워놓으면 어제 시초가에 진입, 50개 띄워 놓으면 오늘 진입 되는 형태임. 시뮬레이션으로는 좋으나 실제 사용 시 매수가 안된 상태임에도 불구하고 매도 사인이 나올 수도 있는 상황입니다)
3. 2회차 손절이 나오는 경우 당일 추가 매수 금지
항상 감사드립니다.
--------------------------------------------------------------------------------
input: 매수금액1(10000000),매수금액2(10000000);
var : Ev(0),Xv(0);
if MarketPosition == 0 and NextBarSdate > sdate Then
buy("b",AtMarket,def,Floor(매수금액1/C));
if MarketPosition == 1 Then{
if MaxEntries == 1 Then
buy("bb",Atlimit,EntryPrice*0.97,Floor(매수금액2/C));
if CurrentContracts > CurrentContracts[1] Then{
Ev = AvgEntryPrice;
if CurrentContracts == MaxContracts Then
Xv = Floor(MaxContracts*0.5);
Else
xv = CurrentContracts;
}
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BL1" Then
Condition1 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BL2" Then
Condition2 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BP1" Then
Condition3 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BP2" Then
Condition4 = true;
if MaxEntries == 2 Then{
if Condition1 == false Then
exitlong("BL1",AtStop,AvgEntryPrice*0.97,"",xv,1);
if Condition2 == false Then
exitlong("BL2",AtStop,AvgEntryPrice*0.94);
if Condition3 == false Then
exitlong("BP1",AtLimit,AvgEntryPrice*1.05,"",xv,1);
if Condition4 == false Then
exitlong("BP2",AtLimit,AvgEntryPrice*1.10);
}
if sdate > EntryDate and stime == 143000 Then
exitlong();
}
else{
Condition1 = false;
Condition2 = false;
Condition3 = false;
Condition4 = false;
}
답변 1
예스스탁 예스스탁 답변
2016-04-26 13:26:03
안녕하세요
예스스탁입니다.
input: 매수금액1(10000000),매수금액2(10000000),지정일(20160426);
var : Ev(0),Xv(0);
if MarketPosition == 0 and NextBarSdate > sdate and NextBarSdate == 지정일 Then
buy("b",AtMarket,def,Floor(매수금액1/C));
if MarketPosition == 1 Then{
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BL1" Then
Condition11 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BL2" Then
Condition12 = 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 CurrentContracts >= CurrentContracts[1] and Condition12 == false Then
buy("bb",Atlimit,EntryPrice*0.97,Floor(매수금액2/C));
if CurrentContracts > CurrentContracts[1] Then{
Ev = AvgEntryPrice;
Xv = Floor(MaxContracts*(1/3));
}
if MaxEntries == 2 Then{
if Condition11 == false Then
exitlong("BL1",AtStop,AvgEntryPrice*0.97,"",xv,1);
if Condition12 == false Then
exitlong("BL3",AtStop,AvgEntryPrice*0.94);
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.15);
}
if sdate > EntryDate and stime == 143000 Then
exitlong();
}
else{
Condition11 = false;
Condition12 = false;
Condition21 = false;
Condition22 = false;
Condition23 = false;
}
즐거운 하루되세요
> 깜피 님이 쓴 글입니다.
> 제목 : 시스템 추가 문의드립니다.
> 기존에 2회 분할 매수에 2회 분할 매도 수식을 작성해주셔서 잘 활용하고 있는데
식을 조금 수정하고 싶습니다.
1. 매도는 5%, 10%, 15% 3회 분할.
2. 1분봉에 적용해서 사용 중인데 봉을 몇 개 띄워 놓느냐에 따라서 진입 일자, 시간 등이 달라집니다. 따라서 특정일에 진입할 수 있는 로직 필요
(예, 현재 1분봉 적용 시 봉을 400개 띄워놓으면 어제 시초가에 진입, 50개 띄워 놓으면 오늘 진입 되는 형태임. 시뮬레이션으로는 좋으나 실제 사용 시 매수가 안된 상태임에도 불구하고 매도 사인이 나올 수도 있는 상황입니다)
3. 2회차 손절이 나오는 경우 당일 추가 매수 금지
항상 감사드립니다.
--------------------------------------------------------------------------------
input: 매수금액1(10000000),매수금액2(10000000);
var : Ev(0),Xv(0);
if MarketPosition == 0 and NextBarSdate > sdate Then
buy("b",AtMarket,def,Floor(매수금액1/C));
if MarketPosition == 1 Then{
if MaxEntries == 1 Then
buy("bb",Atlimit,EntryPrice*0.97,Floor(매수금액2/C));
if CurrentContracts > CurrentContracts[1] Then{
Ev = AvgEntryPrice;
if CurrentContracts == MaxContracts Then
Xv = Floor(MaxContracts*0.5);
Else
xv = CurrentContracts;
}
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BL1" Then
Condition1 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BL2" Then
Condition2 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BP1" Then
Condition3 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BP2" Then
Condition4 = true;
if MaxEntries == 2 Then{
if Condition1 == false Then
exitlong("BL1",AtStop,AvgEntryPrice*0.97,"",xv,1);
if Condition2 == false Then
exitlong("BL2",AtStop,AvgEntryPrice*0.94);
if Condition3 == false Then
exitlong("BP1",AtLimit,AvgEntryPrice*1.05,"",xv,1);
if Condition4 == false Then
exitlong("BP2",AtLimit,AvgEntryPrice*1.10);
}
if sdate > EntryDate and stime == 143000 Then
exitlong();
}
else{
Condition1 = false;
Condition2 = false;
Condition3 = false;
Condition4 = false;
}
다음글
이전글