커뮤니티
문의 드립니다
2018-02-22 15:28:18
150
글번호 116827
아래의 수식중 4차청산에 400틱 수익실현이 아닌 3차 청산 이후에 최고점을 찍고서 50틱 하락시,3차 청산 이후에 최저점을 찍고서 50틱 상승시로 청산 시점을 바꿔 주십시요
이 부분이요>>
ExitLong("4",atlimit,EntryPrice+PriceScale*400,"",1,1);
ExitShort("④",atlimit,EntryPrice-PriceScale*400,"",1,1);
Input : P1(1),P2(2);
var1 = ma(C,P1);
var2 = ma(C,P2);
if crossup(var1,var2) Then
buy("b",OnClose,def,4);
if CrossDown(var1,var2) Then
sell("s",OnClose,def,4);
if MarketPosition == 1 Then
{
ExitLong("1",atlimit,EntryPrice+PriceScale*100,"",1,1);
ExitLong("2",atlimit,EntryPrice+PriceScale*200,"",1,1);
ExitLong("3",atlimit,EntryPrice+PriceScale*300,"",1,1);
ExitLong("4",atlimit,EntryPrice+PriceScale*400,"",1,1);
}
if MarketPosition == -1 Then
{
ExitShort("①",atlimit,EntryPrice-PriceScale*100,"",1,1);
ExitShort("②",atlimit,EntryPrice-PriceScale*200,"",1,1);
ExitShort("③",atlimit,EntryPrice-PriceScale*300,"",1,1);
ExitShort("④",atlimit,EntryPrice-PriceScale*400,"",1,1);
}
답변 1
예스스탁 예스스탁 답변
2018-02-22 16:44:57
안녕하세요
예스스탁입니다.
Input : P1(1),P2(2);
var1 = ma(C,P1);
var2 = ma(C,P2);
if crossup(var1,var2) Then
buy("b",OnClose,def,4);
if CrossDown(var1,var2) Then
sell("s",OnClose,def,4);
if MarketPosition == 1 Then
{
ExitLong("1",atlimit,EntryPrice+PriceScale*100,"",1,1);
ExitLong("2",atlimit,EntryPrice+PriceScale*200,"",1,1);
ExitLong("3",atlimit,EntryPrice+PriceScale*300,"",1,1);
if CurrentContracts == 1 and
highest(H,BarsSinceEntry) > EntryPrice+PriceScale*300 then
ExitLong("4",AtStop,highest(H,BarsSinceEntry)-PriceScale*50,"",1,1);
}
if MarketPosition == -1 Then
{
ExitShort("①",atlimit,EntryPrice-PriceScale*100,"",1,1);
ExitShort("②",atlimit,EntryPrice-PriceScale*200,"",1,1);
ExitShort("③",atlimit,EntryPrice-PriceScale*300,"",1,1);
if CurrentContracts == 1 and
lowest(L,BarsSinceEntry) < EntryPrice-PriceScale*300 then
ExitShort("④",AtStop,lowest(L,BarsSinceEntry)+PriceScale*50,"",1,1);
}
즐거운 하루되세요
> 영구없다 님이 쓴 글입니다.
> 제목 : 문의 드립니다
> 아래의 수식중 4차청산에 400틱 수익실현이 아닌 3차 청산 이후에 최고점을 찍고서 50틱 하락시,3차 청산 이후에 최저점을 찍고서 50틱 상승시로 청산 시점을 바꿔 주십시요
이 부분이요>>
ExitLong("4",atlimit,EntryPrice+PriceScale*400,"",1,1);
ExitShort("④",atlimit,EntryPrice-PriceScale*400,"",1,1);
Input : P1(1),P2(2);
var1 = ma(C,P1);
var2 = ma(C,P2);
if crossup(var1,var2) Then
buy("b",OnClose,def,4);
if CrossDown(var1,var2) Then
sell("s",OnClose,def,4);
if MarketPosition == 1 Then
{
ExitLong("1",atlimit,EntryPrice+PriceScale*100,"",1,1);
ExitLong("2",atlimit,EntryPrice+PriceScale*200,"",1,1);
ExitLong("3",atlimit,EntryPrice+PriceScale*300,"",1,1);
ExitLong("4",atlimit,EntryPrice+PriceScale*400,"",1,1);
}
if MarketPosition == -1 Then
{
ExitShort("①",atlimit,EntryPrice-PriceScale*100,"",1,1);
ExitShort("②",atlimit,EntryPrice-PriceScale*200,"",1,1);
ExitShort("③",atlimit,EntryPrice-PriceScale*300,"",1,1);
ExitShort("④",atlimit,EntryPrice-PriceScale*400,"",1,1);
}