예스스탁
예스스탁 답변
2016-04-18 11:14:44
안녕하세요
예스스탁입니다.
추가진입을 하므로
시스템 적용시 피라미딩탭에서 피라미딩을 다른진입신호만 허용으로
설정하고 적용하셔야 합니다.
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;
}
즐거운 하루되세요
> 깜피 님이 쓴 글입니다.
> 제목 : 수식 문의드리겠습니다.
> 장 시작 전에 종목을 수작업으로 뽑아놓고 그 종목에 수식을 걸어서 매매하려고 합니다.
예를 들어서 장 시작 시 시초가에 1000만원, 3% 하락 시 추가 1000만원 매수 하고,
평단가 대비 3% 하락시 절반 손절, 추가 3% 하락시 나머지 전체 손절.
평단가 대비 5% 상승시 절반 익절, 10% 상승시 나머지 전체 익절.
단, 5% 상승하여 절반 익절한 상황에서 주가 하락 시 트레일링스탑 4%
당일에 일부손절 일부 익절 등으로 잔고가 남아있다면
익일에도 동일한 기준(손절%, 익절%)를 적용해서 거래하고
그래도 거래가 없다면 종가에 모두 매도
봉이 완성되는 기준은 아니고 주가 기준으로 생각하고 있긴 한데
그렇게 될 수 없다면 분봉이 아니고 틱봉(1틱~10틱)으로 거래해야할 것 같습니다.
이런 수식을 부탁드리겠습니다.
항상 감사드립니다.^^