커뮤니티
청산식
2012-12-26 12:51:30
229
글번호 57569
모멘텀으로 매수진입
Inputs: Length(10), Pval(0.05);
Variables: Mom(0);
Mom = C- C[Length];
If Mom > 0 AND Mom >= Mom[1] AND MarketPosition() <> 1 Then
Buy ("Mom", AtStop, High + Pval);
매수청산 *
매수가의 0.1포인트 상승하면 한계약식 매도
그러다가 최고가 보다 0.3포인트 하락하면 전량 매수청산
또는 남은 계약은 매도식이 오면 매수청산
스탑로스 매수가의 1포인트
모멘텀으로 매도 진입
nputs: Length(10), Pval(0.05);
Variables: Mom(0);
Mom = C-C[Length];
If Mom < 0 AND Mom <= Mom[1] AND MarketPosition() <> -1 Then
Sell ("Mom", AtStop, Low - Pval);
매도 청산
매도가의0.1포인트 하락시 마다 한계약씩 매도
그러다가 최저가보다 0.3포인트 이상 상승하면 매도 청산
또는 매수식이 오면 매도 청산
스탑로스 매도가의 1포인트
감사합니다
주식에서는
매수청산식
매수가의 1% 상승시 마다 주식 총금액의 5% 매도
그러다가 최고점 보다 3% 이상 하락하면 매수청산
스탑로스 5%
항상 감사 합니다
답변 1
예스스탁 예스스탁 답변
2012-12-26 17:13:11
안녕하세요
예스스탁입니다.
분할청산식은 진입하고는 다르게
경우의 수별로 모두 작성되어야 합니다.
1번과 같은 경우 진입이 10계약이고 1계약씩 분할로 청산하므로
청산함수가 10개씩 필요합니다.
2번과 같은 경우 5%씩 분할청산되므로 20개의 청산함수가 필요합니다.
이용에 참고하시기 바랍니다.
1.
Inputs: Length(10), Pval(0.05),진입수량(10);
Variables: Mom(0);
Mom = C- C[Length];
If Mom > 0 AND Mom >= Mom[1] AND MarketPosition() <> 1 Then
Buy ("BMom", AtStop, High + Pval,진입수량);
If Mom < 0 AND Mom <= Mom[1] AND MarketPosition() <> -1 Then
Sell ("SMom", AtStop, Low - Pval,진입수량);
if MarketPosition == 1 Then{
ExitLong("Bx1",AtLimit,EntryPrice+0.1,"",1,1);
ExitLong("Bx2",AtLimit,EntryPrice+0.2,"",1,1);
ExitLong("Bx3",AtLimit,EntryPrice+0.3,"",1,1);
ExitLong("Bx4",AtLimit,EntryPrice+0.4,"",1,1);
ExitLong("Bx5",AtLimit,EntryPrice+0.5,"",1,1);
ExitLong("Bx6",AtLimit,EntryPrice+0.6,"",1,1);
ExitLong("Bx7",AtLimit,EntryPrice+0.7,"",1,1);
ExitLong("Bx8",AtLimit,EntryPrice+0.8,"",1,1);
ExitLong("Bx9",AtLimit,EntryPrice+0.9,"",1,1);
ExitLong("Bx10",AtLimit,EntryPrice+1.0,"",1,1);
ExitLong("bx",AtStop,highest(H,BarsSinceEntry)-0.3);
ExitLong("bloss",AtStop,EntryPrice-1);
}
if MarketPosition == -1 Then{
ExitShort("Sx1",AtLimit,EntryPrice-0.1,"",1,1);
ExitShort("Sx2",AtLimit,EntryPrice-0.2,"",1,1);
ExitShort("Sx3",AtLimit,EntryPrice-0.3,"",1,1);
ExitShort("Sx4",AtLimit,EntryPrice-0.4,"",1,1);
ExitShort("Sx5",AtLimit,EntryPrice-0.5,"",1,1);
ExitShort("Sx6",AtLimit,EntryPrice-0.6,"",1,1);
ExitShort("Sx7",AtLimit,EntryPrice-0.7,"",1,1);
ExitShort("Sx8",AtLimit,EntryPrice-0.8,"",1,1);
ExitShort("Sx9",AtLimit,EntryPrice-0.9,"",1,1);
ExitShort("Sx10",AtLimit,EntryPrice-1.0,"",1,1);
ExitShort("sx",AtStop,lowest(L,BarsSinceEntry)+0.3);
ExitShort("Sloss",AtStop,EntryPrice+1);
}
2.
Inputs: Length(10), Pval(0.05);
Variables: Mom(0);
Mom = C- C[Length];
If Mom > 0 AND Mom >= Mom[1] AND MarketPosition() <> 1 Then
Buy ("Mom", AtStop, High + Pval);
if MarketPosition == 1 Then{
if CodeCategory == 1 Then{
if BasePrice < 50000 Then
Var1 = int(int((MaxContracts*0.05)/10)*10);
Else
Var1 = int(MaxContracts*0.05);
}
if CodeCategory == 2 or CodeCategory == 8 Then
Var1 = int(MaxContracts*0.05);
ExitLong("bx1",AtStop,EntryPrice*1.01,"",var1,1);
ExitLong("bx2",AtStop,EntryPrice*1.02,"",var1,1);
ExitLong("bx3",AtStop,EntryPrice*1.03,"",var1,1);
ExitLong("b4x",AtStop,EntryPrice*1.04,"",var1,1);
ExitLong("bx5",AtStop,EntryPrice*1.05,"",var1,1);
ExitLong("bx6",AtStop,EntryPrice*1.06,"",var1,1);
ExitLong("bx7",AtStop,EntryPrice*1.07,"",var1,1);
ExitLong("bx8",AtStop,EntryPrice*1.08,"",var1,1);
ExitLong("bx9",AtStop,EntryPrice*1.09,"",var1,1);
ExitLong("bx10",AtStop,EntryPrice*1.10,"",var1,1);
ExitLong("bx11",AtStop,EntryPrice*1.11,"",var1,1);
ExitLong("bx12",AtStop,EntryPrice*1.12,"",var1,1);
ExitLong("bx13",AtStop,EntryPrice*1.13,"",var1,1);
ExitLong("bx14",AtStop,EntryPrice*1.14,"",var1,1);
ExitLong("bx15",AtStop,EntryPrice*1.15,"",var1,1);
ExitLong("bx16",AtStop,EntryPrice*1.16,"",var1,1);
ExitLong("bx17",AtStop,EntryPrice*1.17,"",var1,1);
ExitLong("bx18",AtStop,EntryPrice*1.18,"",var1,1);
ExitLong("bx19",AtStop,EntryPrice*1.19,"",var1,1);
ExitLong("bx20",AtStop,EntryPrice*1.20);
ExitLong("bx",AtStop,highest(H,BarsSinceEntry)*0.97);
ExitLong("bloss",AtStop,EntryPrice*0.95);
}
즐거운 하루되세요
> 구다이전설 님이 쓴 글입니다.
> 제목 : 청산식
> 모멘텀으로 매수진입
Inputs: Length(10), Pval(0.05);
Variables: Mom(0);
Mom = C- C[Length];
If Mom > 0 AND Mom >= Mom[1] AND MarketPosition() <> 1 Then
Buy ("Mom", AtStop, High + Pval);
매수청산 *
매수가의 0.1포인트 상승하면 한계약식 매도
그러다가 최고가 보다 0.3포인트 하락하면 전량 매수청산
또는 남은 계약은 매도식이 오면 매수청산
스탑로스 매수가의 1포인트
모멘텀으로 매도 진입
nputs: Length(10), Pval(0.05);
Variables: Mom(0);
Mom = C-C[Length];
If Mom < 0 AND Mom <= Mom[1] AND MarketPosition() <> -1 Then
Sell ("Mom", AtStop, Low - Pval);
매도 청산
매도가의0.1포인트 하락시 마다 한계약씩 매도
그러다가 최저가보다 0.3포인트 이상 상승하면 매도 청산
또는 매수식이 오면 매도 청산
스탑로스 매도가의 1포인트
감사합니다
주식에서는
매수청산식
매수가의 1% 상승시 마다 주식 총금액의 5% 매도
그러다가 최고점 보다 3% 이상 하락하면 매수청산
스탑로스 5%
항상 감사 합니다