커뮤니티
시스템부탁드립니다
2013-06-10 23:02:58
172
글번호 64187
1)
6개월이동평균선이 상향으로 올라가면서
6개월 이동평균선위에 종가가 (음봉양봉상관없이) 있을 경우 매수를 하라
두가지를 비 만족시 매도하라
라는 수식어 부탁드립니다
2)6개월 이동평균선이 상향으로 올라가면서
6개월 이동평균선 위에 종가가 양봉일 경우 매수를 하라
그리고 6개월 이동평균선이 하향으로 내려가면서,
6개월 이동평균선 아래 종가가 음봉일 경우 매도를 하라
but! 매수를 하고 매도가 나오기전에 6개월 이동평균선은 상행중에 음봉이 나오면
음봉마다 배팅의 1/5를 하라.
부탁드립니다.
답변 1
예스스탁 예스스탁 답변
2013-06-11 13:25:54
안녕하세요
예스스탁입니다.
1.
input : P(6);
var : cnt(0),sum1(0),sum2(0),mav1(0),mav2(0);
Array : CC[20](0);
if date > date[1]+30 Then{
for cnt = 1 to 19{
CC[cnt] = CC[cnt-1][1];
}
}
CC[0] = C;
if CC[P] > 0 Then{
sum1 = 0;
sum2 = 0;
for cnt = 0 to P-1{
sum1 = sum1+CC[cnt];
sum2 = sum2+CC[cnt+1];
}
mav1 = sum1/P;
mav2 = sum2/P;
if mav1 > mav2 and C > mav1 Then
buy();
if !(mav1 > mav2) and !(C > mav1) Then
sell();
}
2.
input : P(6);
var : cnt(0),sum1(0),sum2(0),mav1(0),mav2(0);
Array : CC[20](0);
if date > date[1]+30 Then{
for cnt = 1 to 19{
CC[cnt] = CC[cnt-1][1];
}
}
CC[0] = C;
if CC[P] > 0 Then{
sum1 = 0;
sum2 = 0;
for cnt = 0 to P-1{
sum1 = sum1+CC[cnt];
sum2 = sum2+CC[cnt+1];
}
mav1 = sum1/P;
mav2 = sum2/P;
if mav1 > mav2 and C > mav1 and C > O Then
buy("b");
if MarketPosition == 1 and mav1 > mav2 and C < O Then{
if countif(mav1 > mav2 and C < O,BarsSinceEntry) == 1 Then
ExitLong("bx1",OnClose,def,"",(CurrentContracts/5),1);
if countif(mav1 > mav2 and C < O,BarsSinceEntry) == 2 Then
ExitLong("bx2",OnClose,def,"",(CurrentContracts/5),1);
if countif(mav1 > mav2 and C < O,BarsSinceEntry) == 3 Then
ExitLong("bx3",OnClose,def,"",(CurrentContracts/5),1);
if countif(mav1 > mav2 and C < O,BarsSinceEntry) == 4 Then
ExitLong("bx4",OnClose,def,"",(CurrentContracts/5),1);
if countif(mav1 > mav2 and C < O,BarsSinceEntry) == 5 Then
ExitLong("bx5");
}
if mav1 < mav2 and C < mav1 and C < O Then
sell();
if MarketPosition == -1 and mav1 < mav2 and C > O Then{
if countif(mav1 < mav2 and C > O,BarsSinceEntry) == 1 Then
ExitShort("sx1",OnClose,def,"",(CurrentContracts/5),1);
if countif(mav1 < mav2 and C > O,BarsSinceEntry) == 2 Then
ExitShort("sx2",OnClose,def,"",(CurrentContracts/5),1);
if countif(mav1 < mav2 and C > O,BarsSinceEntry) == 3 Then
ExitShort("sx3",OnClose,def,"",(CurrentContracts/5),1);
if countif(mav1 < mav2 and C > O,BarsSinceEntry) == 4 Then
ExitShort("sx4",OnClose,def,"",(CurrentContracts/5),1);
if countif(mav1 < mav2 and C > O,BarsSinceEntry) == 5 Then
ExitShort("sx5");
}
}
즐거운 하루되세요
> 이의정 님이 쓴 글입니다.
> 제목 : 시스템부탁드립니다
> 1)
6개월이동평균선이 상향으로 올라가면서
6개월 이동평균선위에 종가가 (음봉양봉상관없이) 있을 경우 매수를 하라
두가지를 비 만족시 매도하라
라는 수식어 부탁드립니다
2)6개월 이동평균선이 상향으로 올라가면서
6개월 이동평균선 위에 종가가 양봉일 경우 매수를 하라
그리고 6개월 이동평균선이 하향으로 내려가면서,
6개월 이동평균선 아래 종가가 음봉일 경우 매도를 하라
but! 매수를 하고 매도가 나오기전에 6개월 이동평균선은 상행중에 음봉이 나오면
음봉마다 배팅의 1/5를 하라.
부탁드립니다.
다음글
이전글