예스스탁
예스스탁 답변
2019-11-21 15:19:42
안녕하세요
예스스탁입니다.
1
input : P1(10),P2(20),Period(20);
var : FK1(0),FK2(0),ATRV(0),Bcond(false),Scond(false);
FK1 = FastK(P1);
FK2 = FastK(P2);
ATRV = ATR(Period);
Bcond = MarketPosition == 0 and MarketPosition(1) == 1 and PositionProfit(1) > 0;
Scond = MarketPosition == 0 and MarketPosition(1) == -1 and PositionProfit(1) > 0;
if crossup(FK2,80) and bcond == false Then
buy("b");
if CrossDown(FK2,20) and Scond == false Then
sell("s");
if MarketPosition == 1 then
{
if CrossDown(FK1,20) Then
{
ExitLong("bx");
}
if !CrossDown(FK1,20) and MaxEntries < 4 Then
{
buy("bb",AtStop,LatestEntryPrice(0)+ATRV,1);
}
ExitLong("bl",AtStop,LatestEntryPrice(0)-ATRV*2);
}
if MarketPosition == -1 then
{
if crossup(FK1,80) Then
{
ExitShort("sx");
}
if !crossup(FK1,80) and MaxEntries < 4 Then
{
sell("ss",AtStop,LatestEntryPrice(0)-ATRV,1);
}
ExitShort("sl",AtStop,EntryPrice+ATRV*2);
}
2
input : P1(20),P2(55),Period(20);
var : FK1(0),FK2(0),ATRV(0),Bcond(false),Scond(false);
FK1 = FastK(P1);
FK2 = FastK(P2);
ATRV = ATR(Period);
Bcond = MarketPosition == 0 and MarketPosition(1) == 1 and PositionProfit(1) > 0;
Scond = MarketPosition == 0 and MarketPosition(1) == -1 and PositionProfit(1) > 0;
if crossup(FK2,80) and bcond == false Then
buy("b");
if CrossDown(FK2,20) and Scond == false Then
sell("s");
if MarketPosition == 1 then
{
if CrossDown(FK1,20) Then
{
ExitLong("bx");
}
if !CrossDown(FK1,20) and MaxEntries < 4 Then
{
buy("bb",AtStop,LatestEntryPrice(0)+ATRV,1);
}
ExitLong("bl",AtStop,LatestEntryPrice(0)-ATRV*2);
}
if MarketPosition == -1 then
{
if crossup(FK1,80) Then
{
ExitShort("sx");
}
if !crossup(FK1,80) and MaxEntries < 4 Then
{
sell("ss",AtStop,LatestEntryPrice(0)-ATRV,1);
}
ExitShort("sl",AtStop,EntryPrice+ATRV*2);
}
즐거운 하루되세요
> 마틸다 님이 쓴 글입니다.
> 제목 : 수식 작성 부탁 드립니다
> 시스템1. Stocastic Fast(20일)의 80%대를 상향 돌파하면 매수포지션 진입
Stocastic Fast(10일)의 20%대를 하향 돌파하면 매수포지션 청산
반대로 Stocastic Fast(20일)의 20%대를 하향 돌파하면 매도포지션 진입
Stocastic Fast(10일)의 80%대를 상향 돌파하면 매도포지션 청산
매수포지션 진입한 경우: 손절 가격은 ATR(20일)*2를 빼준 가격 (매도포지션은 그 반대)
ex> 1481.7에 매수, ATR(20일)이 15.2일 경우 손절 가격은 1451.3
이후 피라미딩 매수. 가격 수준이 1*ATR(20일)만큼 늘어난 경우 1계약 추가
ex> 1496.9에 1계약 추가, 2계약의 손절가는 1496.3-2*ATR(20일)인 1465.9
이후 가격 수준이 1*ATR(20일)만큼 늘어난 경우 다시 1계약 추가
ex> 1512.1에 1계약 추가, 3계약의 손절가는 1512.1-2*ATR(20일)인 1481.7
이후 가격 수준이 1*ATR(20일)만큼 늘어난 경우 다시 1계약 추가
ex> 1537.3에 1계약 추가, 4계약의 손절가는 1537.3-2*ATR(20일)인 1506.9
피라미딩은 최대 4계약까지 진입합니다
<<필터>> 만약 최근에 Stocastic Fast(20일)의 80% 돌파 신호를 보고 이익을 보았다면 다시 나타난 Stocastic Fast(20일)의 80& 돌파 신호는 무시된다. 하지만 최근에 Stocastic Fast(20일)의 80% 돌파 신호에서 2*ATR(20일)의 손실을 보았다면 돌파 신호를 받아들이고 매수한다.
매도포지션일 경우 최근 Stocastic Fast(20일) 20%하향 돌파 신호를 보고 이익을 보았다면 다시 나타난 Stocastic Fast(20일)의 20%하향 돌파 신호는 무시된다. 하지만 최근에 Stocastic Fast(20일)의 20%하향 돌파 신호에서 2*ATR(20일)의 손실을 보았다면 돌파 신호를 받아들이고 매도포지션에 진입한다.
시스템2. 위의 시스템에서 Stocastic Fast(55일)의 80%를 상향 돌파하면 매수포지션 진입
Stocastic Fast(20일)의 20%를 하향 돌파하면 매수포지션 청산
반대로 Stocastic Fast(55일)의 20%를 하향 돌파하면 매도포지션 진입
Stocastic Fast(20일)의 80%를 상향 돌파하면 매도포지션 청산
피라미딩, 손절가와 관련된 조건은 동일합니다.