예스스탁
예스스탁 답변
2020-07-23 11:10:43
안녕하세요
예스스탁입니다.
청산된 봉에서 진입조건이 동시에 만족하게 되어 발생하는 부분입니다.
청산과 동시에 동일진입조건이 만족하면 청산이 한번더 발동해 해당 진입도 청산합니다.
진입과 청산식에 marketposition함수로 제어하는 내용을 추가해 드립니다.
Var : value(0);
value = 0;
# 매수 / 매도청산
If CCI(9) > 0 Then
value = 1;
If MACD(12,26) > 0 Then
value = value+1;
If DIPlus(14) > DIMinus(14) Then
value = value+1;
If StochasticsK(12,5) > StochasticsD(12,5,5) Then
value = value+1;
# 매수/매도청산
If MarketPosition <= 0 And value >= 3 Then
{
Buy("매수");
}
value = 0;
# 매도/매수청산
If CCI(9) < 0 Then
value = 1;
If MACD(12,26) < 0 Then
value = value+1;
If DIPlus(14) < DIMinus(14) Then
value = value+1;
If StochasticsK(12,5) < StochasticsD(12,5,5) Then
value = value+1;
If MarketPosition >= 0 And value >= 3 Then
{
Sell("매도");
}
if MarketPosition == 1 And
H[1] == highest(H,5)[1] and
H[1] > max(C[1],O[1]) and
V[1] >= 3500 and
C[0] < C[1] Then
exitlong("매수분 청산");
if MarketPosition == -1 And
L[1] == Lowest(L,5)[1] and
H[1] > max(C[1],O[1]) and
V[1] >= 3500 and
C[0] > C[1] Then
ExitShort("매도분 청산");
if MarketPosition == 1 And
H[2] == highest(H,5)[1] and
H[2] > max(C[2],O[2]) and
V[2] >= 3500 and
C[0] < C[2] Then
exitlong("매수분 올청산");
if MarketPosition == -1 And
L[2] == Lowest(L,5)[1] and
H[1] > max(C[1],O[1]) and
V[1] >= 3500 and
C[0] > C[1] Then
ExitShort("매도분 올청산");
if MarketPosition <= 0 And
L[1]==LOWEST(L,5) and
C[1]<O[1] and
C[1]>L[1] and
O[0]>L[0] and
C[1]==O[0] and
L[1]==L[0] and
C[0]>O[0] and
v>2500 Then
buy("집게발 매수");
if MarketPosition >= 0 And
H[1]==highest(H,5) and
C[1]>O[1] and
C[1]<H[1] and
O[0]<H[0] and
C[1]==O[0] and
H[1]==H[0] and
C[0]<O[0] and
v > 2500 Then
sell("집게발 매도");
즐거운 하루되세요
> 시그너스 님이 쓴 글입니다.
> 제목 : 수정 부탁 합니다.
> 안녕하세요?
기존 사용하던 시스템에서 최근 신호가 동일한 곳에서 2개가 발생 합니다.
수정 부탁 합니다.
Var : value(0);
value = 0;
# 매수 / 매도청산
If CCI(9) > 0 Then
value = 1;
If MACD(12,26) > 0 Then
value = value+1;
If DIPlus(14) > DIMinus(14) Then
value = value+1;
If StochasticsK(12,5) > StochasticsD(12,5,5) Then
value = value+1;
# 매수/매도청산
If value >= 3 Then
{
Buy("매수");
}
value = 0;
# 매도/매수청산
If CCI(9) < 0 Then
value = 1;
If MACD(12,26) < 0 Then
value = value+1;
If DIPlus(14) < DIMinus(14) Then
value = value+1;
If StochasticsK(12,5) < StochasticsD(12,5,5) Then
value = value+1;
If value >= 3 Then
{
Sell("매도");
}
if H[1] == highest(H,5)[1] and
H[1] > max(C[1],O[1]) and
V[1] >= 3500 and
C[0] < C[1] Then
exitlong("매수분 청산");
if L[1] == Lowest(L,5)[1] and
H[1] > max(C[1],O[1]) and
V[1] >= 3500 and
C[0] > C[1] Then
ExitShort("매도분 청산");
if H[2] == highest(H,5)[1] and
H[2] > max(C[2],O[2]) and
V[2] >= 3500 and
C[0] < C[2] Then
exitlong("매수분 올청산");
if L[2] == Lowest(L,5)[1] and
H[1] > max(C[1],O[1]) and
V[1] >= 3500 and
C[0] > C[1] Then
ExitShort("매도분 올청산");
if L[1]==LOWEST(L,5) and
C[1]<O[1] and
C[1]>L[1] and
O[0]>L[0] and
C[1]==O[0] and
L[1]==L[0] and
C[0]>O[0] and
v>2500 Then
buy("집게발 매수");
if H[1]==highest(H,5) and
C[1]>O[1] and
C[1]<H[1] and
O[0]<H[0] and
C[1]==O[0] and
H[1]==H[0] and
C[0]<O[0] and
v > 2500 Then
sell("집게발 매도");