커뮤니티
문의드립니다.
2017-04-11 01:52:14
116
글번호 108654
안녕하세요.
아래는 다계약 진입과 청산, 그리고 본청을 수식화 해 본 것입니다.
1) 2계약 매수진입, 1개는 15틱 수익청, 나머지는 20틱 수익청산.
2) 최대수익이 14틱까지만 도달하고 하락하면 진입가격 5틱 위에서 2계약 모두 청산,
최대수익이 19틱까지만 도달하고 하락하면 진입가격 10틱 위에서 1계약 청산.(1개는 15틱에 수익청산이 이미 되었기 때문)
검증부탁드리며 보다 간단하게 코딩할 수 있는 방법이 있으면 알려주시면 감사하겠습니다.
if dayindex == 0 then{
EP = C;
buy("b",onclose,def,2);}
if MarketPosition == 1 then{
if IsEntryName("b") == true Then
ExitLong("bx1",Atlimit,EP + Pricescale*15,"b",1,1);
ExitLong("bx2",Atlimit,EP + Pricescale*20,"b",1,1);
if IsEntryName("b") == true Then
if highest(H,BarsSinceEntry) >= EP + PriceScale*14
and highest(H,BarsSinceEntry) < EP + PriceScale*15 Then
ExitLong("b본청1",AtStop,EP + PriceScale*5,"b",2,1);
if highest(H,BarsSinceEntry) >= EP + PriceScale*19
and highest(H,BarsSinceEntry) < EP + PriceScale*20 Then
ExitLong("b본청2",AtStop,EP + PriceScale*10,"b",1,1);
}
답변 1
예스스탁 예스스탁 답변
2017-04-11 11:11:41
안녕하세요
예스스탁입니다.
if dayindex == 0 then{
buy("b",onclose,def,2);
}
if MarketPosition == 1 then{
ExitLong("bx1",Atlimit,EntryPrice + Pricescale*15,"",1,1);
ExitLong("bx2",Atlimit,EntryPrice + Pricescale*20,"",1,1);
var1 = highest(H,BarsSinceEntry);
if var1 >= EntryPrice + PriceScale*14 and var1 < EntryPrice + PriceScale*15 Then
ExitLong("b본청1",AtStop,EntryPrice + PriceScale*5,"",2,1);
if var1 >= EntryPrice + PriceScale*19 and var1 < EntryPrice + PriceScale*20 Then
ExitLong("b본청2",AtStop,EntryPrice + PriceScale*10,"",1,1);
}
즐거운 하루되세요
> 맘속의행복 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 안녕하세요.
아래는 다계약 진입과 청산, 그리고 본청을 수식화 해 본 것입니다.
1) 2계약 매수진입, 1개는 15틱 수익청, 나머지는 20틱 수익청산.
2) 최대수익이 14틱까지만 도달하고 하락하면 진입가격 5틱 위에서 2계약 모두 청산,
최대수익이 19틱까지만 도달하고 하락하면 진입가격 10틱 위에서 1계약 청산.(1개는 15틱에 수익청산이 이미 되었기 때문)
검증부탁드리며 보다 간단하게 코딩할 수 있는 방법이 있으면 알려주시면 감사하겠습니다.
if dayindex == 0 then{
EP = C;
buy("b",onclose,def,2);}
if MarketPosition == 1 then{
if IsEntryName("b") == true Then
ExitLong("bx1",Atlimit,EP + Pricescale*15,"b",1,1);
ExitLong("bx2",Atlimit,EP + Pricescale*20,"b",1,1);
if IsEntryName("b") == true Then
if highest(H,BarsSinceEntry) >= EP + PriceScale*14
and highest(H,BarsSinceEntry) < EP + PriceScale*15 Then
ExitLong("b본청1",AtStop,EP + PriceScale*5,"b",2,1);
if highest(H,BarsSinceEntry) >= EP + PriceScale*19
and highest(H,BarsSinceEntry) < EP + PriceScale*20 Then
ExitLong("b본청2",AtStop,EP + PriceScale*10,"b",1,1);
}
다음글