커뮤니티
진입, 청산식 문의 드립니다.
2011-09-18 21:33:25
574
글번호 42753
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
input : E1(80),X3(20);
Var : PosHigh(0), PosLow(0);
if crossup(H,highest(H,E1)[1]) Then
buy();
if CrossDown(L,Lowest(L,E1)[1]) Then
Sell();
if MarketPosition == 1 Then{
ExitLong("exitlong",AtStop,lowest(L,X3));
exitlong("B_stop",Atstop,EntryPrice-ATR(20)*3);
if MarketPosition == -1 Then{
ExitShort("exitshort",AtStop,Highest(H,X3));
exitshort("S_stop",Atstop,EntryPrice+ATR(20)*3);
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
1. 위 전략을 역 마틴게일 방식으로 진입하게 하려면 어떻게 해야 하나요?
2. 위 전략을 통해 벌어들인 net profit의 20%만큼 다음 진입 수량을 늘리려면 어떻게 해야 하나요?
예를 들어, 처음에 1계약으로 수익 100pt가 났다면,
다음 진입 시 손절매 크기인 ATR(20)*3 크기는
수익 100pt의 20%인 20pt가 동일해야 하는데,
이에 맞는 계약 숫자로 진입하길 원합니다.
3. 현재 이 전략은 ATR(20)*3 만큼의 진입 risk를 부담하고 있는데
수익이 risk의 2배인 ATR(20)*6 만큼이 되면 청산하는 수식이 궁금합니다.
답변 1
예스스탁 예스스탁 답변
2011-09-19 13:49:26
안녕하세요
예스스탁입니다.
1.
input : E1(80),X3(20),maxcont(10);
vars: ncontr(0),XCommission(0),XSlippage(0);
XCommission = c*(ExitCommission/100); #%설정
XSlippage = ExitSlippage; #Pt설정
if crossup(H,highest(H,E1)[1]) then {
if MarketPosition == -1 then {
exitshort();
if (PositionProfit-(XCommission+XSlippage)*CurrentContracts) > 0 then
ncontr = ncontr+1;
else
ncontr = 1;
}
if MarketPosition != 1 then {
Buy("B", onclose,def,iff(max(1,ncontr)<10,max(1,ncontr),10));
}
}
if CrossDown(L,Lowest(L,E1)[1]) then {
if MarketPosition == 1 then {
exitlong();
if (PositionProfit-(XCommission+XSlippage)*CurrentContracts) > 0 then
ncontr = ncontr+1;
else
ncontr = 1;
}
if MarketPosition != -1 then {
Sell("S", onclose,def,iff(max(1,ncontr)<10,max(1,ncontr),10));
}
}
if MarketPosition == 1 Then{
ExitLong("exitlong",AtStop,lowest(L,X3));
exitlong("B_stop",Atstop,EntryPrice-ATR(20)*3);
}
if MarketPosition == -1 Then{
ExitShort("exitshort",AtStop,Highest(H,X3));
exitshort("S_stop",Atstop,EntryPrice+ATR(20)*3);
}
2번의 내용은 정확히 이해하지 못했습니다.
좀더 상세하게 내용을 올려주셔야 식으로 가능한지
판단해 볼 수 있을것 같습니다.
3.
if MarketPosition == 1 Then{
ExitLong("exitlong",AtStop,lowest(L,X3));
exitlong("B_stop",Atstop,EntryPrice-ATR(20)*3);
exitlong("bx",AtLimit,EntryPrice+ATR(20)*6);
}
if MarketPosition == -1 Then{
ExitShort("exitshort",AtStop,Highest(H,X3));
ExitShort("S_stop",Atstop,EntryPrice+ATR(20)*3);
ExitShort("sx",AtLimit,EntryPrice-ATR(20)*6);
}
즐거운 하루되세요
> feiz 님이 쓴 글입니다.
> 제목 : 진입, 청산식 문의 드립니다.
> ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
input : E1(80),X3(20);
Var : PosHigh(0), PosLow(0);
if crossup(H,highest(H,E1)[1]) Then
buy();
if CrossDown(L,Lowest(L,E1)[1]) Then
Sell();
if MarketPosition == 1 Then{
ExitLong("exitlong",AtStop,lowest(L,X3));
exitlong("B_stop",Atstop,EntryPrice-ATR(20)*3);
if MarketPosition == -1 Then{
ExitShort("exitshort",AtStop,Highest(H,X3));
exitshort("S_stop",Atstop,EntryPrice+ATR(20)*3);
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
1. 위 전략을 역 마틴게일 방식으로 진입하게 하려면 어떻게 해야 하나요?
2. 위 전략을 통해 벌어들인 net profit의 20%만큼 다음 진입 수량을 늘리려면 어떻게 해야 하나요?
예를 들어, 처음에 1계약으로 수익 100pt가 났다면,
다음 진입 시 손절매 크기인 ATR(20)*3 크기는
수익 100pt의 20%인 20pt가 동일해야 하는데,
이에 맞는 계약 숫자로 진입하길 원합니다.
3. 현재 이 전략은 ATR(20)*3 만큼의 진입 risk를 부담하고 있는데
수익이 risk의 2배인 ATR(20)*6 만큼이 되면 청산하는 수식이 궁금합니다.
다음글
이전글