커뮤니티
수식 문의합니다
2015-01-07 18:08:19
133
글번호 82012
매수, 매도는 분할로 진입합니다
5일선이 60일선 돌파시 20일선 -1틱,-7 매수진입
5일선이 60일선 돌파시 20일선 +1틱,+7 매도진입
청산도 분할 청산으로 할수있나요?
예를들어
10틱에 1차 청산, 20틱에 2차 청산....
일정 수익 발생후 본절가격까지 오면 자동청산 되게 할수 있나요?
예를들어
10틱 수익 발생 후 다시 진입 가격까지 오면 자동 청산....
부탁드려요~
답변 1
예스스탁 예스스탁 답변
2015-01-08 10:39:27
안녕하세요
예스스탁입니다.
피라미딩을 다른진입신호만 허용으로 설정하고 적용하시면 됩니다.
var : T1(0),P1(0),I1(0),L1(0),H1(0),HH(0);
var : T2(0),P2(0),I2(0),L2(0),H2(0),LL(0);
var1 = ma(c,5);
var2 = ma(c,20);
var3 = ma(c,60);
if crossup(var1,var3) Then{
T1 = 1;
P1 = var2;
I1 = index;
L1 = C;
buy("b1",Atlimit,P1-PriceScale*1,1);
buy("b2",Atlimit,P1-PriceScale*7,1);
}
if CrossDown(var1,var3) Then{
T1 = -1;
P1 = var2;
I1 = index;
H1 = C;
Sell("S1",Atlimit,P1+PriceScale*1,1);
Sell("S2",Atlimit,P1+PriceScale*7,1);
}
if T1 == 1 and index > I1 Then{
if L < L1 Then
L1 = L;
if L1 > P1-PriceScale*1 Then
buy("b11",Atlimit,P1-PriceScale*1,1);
if L1 > P1-PriceScale*7 Then
buy("b21",Atlimit,P1-PriceScale*7,1);
}
if T1 == -1 and index > I1 Then{
if H > H1 Then
H1 = H;
if H1 < P1+PriceScale*1 Then
Sell("s11",Atlimit,P1+PriceScale*1,1);
if H1 < P1+PriceScale*7 Then
Sell("s21",Atlimit,P1+PriceScale*7,1);
}
#평단가 대비 10틱 수익시 1계약 청산
#평단가 대비 20틱 수익시 1계약 청산
if MarketPosition == 1 Then{
if MaxContracts == CurrentContracts Then
ExitLong("bx1",AtLimit,AvgEntryPrice+PriceScale*10,"",1,1);
if MaxContracts == CurrentContracts Then
ExitLong("bx2",AtLimit,AvgEntryPrice+PriceScale*20,"",1,1);
}
if MarketPosition == -1 Then{
if MaxContracts == CurrentContracts Then
ExitShort("sx1",AtLimit,AvgEntryPrice-PriceScale*10,"",1,1);
if MaxContracts == CurrentContracts Then
ExitShort("sx2",AtLimit,AvgEntryPrice-PriceScale*20,"",1,1);
}
#10틱이상 수익발생후에 진입가까지 하락하면 매수포지션 청산
if MarketPosition == 1 Then{
if CurrentContracts > CurrentContracts[1] Then
HH = H;
if H > HH Then
HH = H;
if HH >= AvgEntryPrice+PriceScale*10 Then
ExitLong("bx",AtStop,EntryPrice);
}
#10틱이상 수익발생후에 진입가까지 상승하면 매도포지션 청산
if MarketPosition == 1 Then{
if CurrentContracts > CurrentContracts[1] Then
LL = L;
if L < LL Then
LL = L;
if LL <= AvgEntryPrice-PriceScale*10 Then
ExitShort("sx",AtStop,EntryPrice);
}
즐거운 하루되세요
> YG_cr***** 님이 쓴 글입니다.
> 제목 : 수식 문의합니다
>
매수, 매도는 분할로 진입합니다
5일선이 60일선 돌파시 20일선 -1틱,-7 매수진입
5일선이 60일선 돌파시 20일선 +1틱,+7 매도진입
청산도 분할 청산으로 할수있나요?
예를들어
10틱에 1차 청산, 20틱에 2차 청산....
일정 수익 발생후 본절가격까지 오면 자동청산 되게 할수 있나요?
예를들어
10틱 수익 발생 후 다시 진입 가격까지 오면 자동 청산....
부탁드려요~