커뮤니티
질문
2016-07-07 10:59:04
82
글번호 99825
아래식을 바꿔주세요.
선물식
1.
매수 시그날후 가격이 오를때에 수익이 +5틱 +10틱 챠트에 표시되도록 식을 바꿔주세요.
매도 시그날후 가격이 내릴때에 수익이 +5틱 +10틱 챠트에 표시되도록 식을 바
2.
피라미딩사용해서 2계약으로 매수, 매도 진입후 목표가 +5틱, +10틱에 수익도달시 청산 하게끔 식을 바꿔주세요.
Input : shortPeriod(5), longPeriod(20);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
If CrossUP(value1, value2) Then
{
Buy();
}
If CrossDown(value1, value2) Then
{
Sell();
}
답변 1
예스스탁 예스스탁 답변
2016-07-07 11:24:25
안녕하세요
예스스탁입니다.
Input : shortPeriod(5), longPeriod(20);
var : TL1(0),TL2(0);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
If CrossUP(value1, value2) Then
{
Buy("b",OnClose,def,2);
}
If CrossDown(value1, value2) Then
{
Sell("s",OnClose,def,2);
}
if TotalTrades > TotalTrades[1] Then{
if MarketPosition(1) == 1 Then{
TL_New(EntryDate(1),EntryTime(1),EntryPrice(1)+PriceScale*5,sdate,stime,EntryPrice(1)+PriceScale*5);
TL_New(EntryDate(1),EntryTime(1),EntryPrice(1)+PriceScale*10,sdate,stime,EntryPrice(1)+PriceScale*10);
}
if MarketPosition(1) == -1 Then{
TL_New(EntryDate(1),EntryTime(1),EntryPrice(1)-PriceScale*5,sdate,stime,EntryPrice(1)-PriceScale*5);
TL_New(EntryDate(1),EntryTime(1),EntryPrice(1)-PriceScale*10,sdate,stime,EntryPrice(1)-PriceScale*10);
}
}
TL_Delete(TL1);
TL_Delete(TL2);
if MarketPosition == 1 Then{
TL1 = TL_New(EntryDate,EntryTime,EntryPrice+PriceScale*5,sdate,stime,EntryPrice+PriceScale*5);
TL2 = TL_New(EntryDate,EntryTime,EntryPrice+PriceScale*10,sdate,stime,EntryPrice+PriceScale*10);
exitlong("bx1",Atlimit,EntryPrice+PriceScale*5,"",1,1);
exitlong("bx2",Atlimit,EntryPrice+PriceScale*10,"",1,1);
}
if MarketPosition == -1 Then{
TL1 = TL_New(EntryDate,EntryTime,EntryPrice-PriceScale*5,sdate,stime,EntryPrice-PriceScale*5);
TL2 = TL_New(EntryDate,EntryTime,EntryPrice-PriceScale*10,sdate,stime,EntryPrice-PriceScale*10);
ExitShort("sx1",Atlimit,EntryPrice-PriceScale*5,"",1,1);
ExitShort("sx2",Atlimit,EntryPrice-PriceScale*10,"",1,1);
}
즐거운 하루되세요
> erwe343 님이 쓴 글입니다.
> 제목 : 질문
> 아래식을 바꿔주세요.
선물식
1.
매수 시그날후 가격이 오를때에 수익이 +5틱 +10틱 챠트에 표시되도록 식을 바꿔주세요.
매도 시그날후 가격이 내릴때에 수익이 +5틱 +10틱 챠트에 표시되도록 식을 바
2.
피라미딩사용해서 2계약으로 매수, 매도 진입후 목표가 +5틱, +10틱에 수익도달시 청산 하게끔 식을 바꿔주세요.
Input : shortPeriod(5), longPeriod(20);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
If CrossUP(value1, value2) Then
{
Buy();
}
If CrossDown(value1, value2) Then
{
Sell();
}
다음글