예스스탁
예스스탁 답변
2016-03-29 10:42:07
안녕하세요
예스스탁입니다.
input : 금액1(1000000),금액2(1000000),금액3(1000000);
var : ,Xcond(false);
var : Vol1(0),vol2(0),vol3(0);
if CodeCategoryEx == 11 and BasePrice < 50000 Then{
vol1 = int(int(금액1/C)/10)*10;
vol2 = int(int(금액2/C)/10)*10;
vol3 = int(int(금액3/C)/10)*10;
}
Else{
vol1 = int(금액1/C);
vol2 = int(금액2/C);
vol3 = int(금액3/C);
}
if bdate != bdate[1] Then
Xcond = false;
if MarketPosition == 1 and CurrentContracts < CurrentContracts[1] Then
Xcond = true;
if Xcond == false and MarketPosition == 0 and A조건 Then
buy("b1",OnClose,def,vol1);
if Xcond == false and MarketPosition == 1 and MaxEntries == 1 Then
buy("b2",AtLimit,LatestEntryPrice(0)*0.99,vol2);
if Xcond == false and MarketPosition == 1 and MaxEntries == 2 Then
buy("b3",AtLimit,LatestEntryPrice(0)*0.99,vol3);
if MarketPosition == 1 Then{
if CurrentContracts == MaxContracts Then
ExitLong("bx1",Atlimit,AvgEntryPrice*1.03,"",Floor(MaxContracts*0.4),1);
if CurrentContracts < MaxContracts Then
ExitLong("bx2",Atlimit,AvgEntryPrice*1.05);
}
즐거운 하루되세요
> 만들레영토 님이 쓴 글입니다.
> 제목 : 질문 드립니다.
> 안녕하세요?
당일 한번이라도 매수청산(=분할청산 포함)이 일어났다면 더이상의 매수는 되지 않도록
보완부탁드립니다.
ex1) 1차 매수후에 청산이 이루어지면 재매수하지 않습니다.
ex2) 1차, 2차 매수후에 청산이 이루어지면 재매수하지 않습니다.
ex3) 1차, 2차, 3차 매수후에 청산이 이루어지면 재매수하지 않습니다.
input : 금액1(1000000),금액2(1000000),금액3(1000000);
var : Xvol(0);
var : Vol1(0),vol2(0),vol3(0);
if CodeCategoryEx == 11 and BasePrice < 50000 Then{
vol1 = int(int(금액1/C)/10)*10;
vol2 = int(int(금액2/C)/10)*10;
vol3 = int(int(금액3/C)/10)*10;
}
Else{
vol1 = int(금액1/C);
vol2 = int(금액2/C);
vol3 = int(금액3/C);
}
"매매식 : A라고 가정"
1차 매수조건식 : A조건에 의해 매수 (금액1 투입)
2차 매수조건식 : 매수단가대비 -1% 하락시 2차매수(금액2 투입)
3차 매수조건식 : 매수단가대비 -2% 하락시 3차매수 (금액3 투입)
분할 매도식
청산식1 :매수단가대비 3% 이상이면 투입금액의 40% 매도
청산식2 :매수단가대비 5% 이상이면 전량 청산
앞서 말했듯이
ex) 1차매수 후 청산(청산식1 또는 청산식2)에 의해 매도했다면 2차,3차 매수 없습니다.
ex) 1차,2차매수 후 청산(청산식1 또는 청산식2)에 의해 매도했다면 3차 매수 없습니다.
감사합니다.