커뮤니티
한가지 추가 부탁드립니다.
2013-09-13 09:42:01
112
글번호 67524
아래 식에 청산을 추가해 주세요. 감사합니다.
-매수 후 다음날 부터, 시초가가 5일(일봉)이동평균선 이격도 98이상 100 미만이면, 100 이상이 될때, 다음 첫봉에 청산.
-매수 후 다음날 부터, 시초가가 5일(일봉)이동평균선 이격도 97이상 98 미만이면, 99.5 이상이 될때, 다음 첫봉에 청산.
-매수 후 다음날 부터, 시초가가 5일(일봉)이동평균선 이격도 97 미만이면, 99 이상이 될때, 다음 첫봉에 청산.
<한가지 여쭤볼께 있는데요, 시스템식에 거래량의 조건이 들어 있을때, 전략실행시 차트에 거래량 봉을 삭제해도 상관이 없나요?>
======================================
input : P(5);
var : cnt(0),sum(0),sum1(0),mav(0),mav1(0),dis(0),dis1(0),daycnt(0),PredayVol(0);
Var : Pivot(0),R1(0),R2(0),S1(0),S2(0);
Pivot = (DayHigh(1)+DayLow(1)+DayClose(1))/3;
if date != date[1] Then
Daycnt = daycnt+1;
sum = 0;
sum1 = 0;
for cnt = 0 to P-1{
sum = sum+DayClose(cnt);
sum1 = sum1+DayClose(cnt+1);
}
mav = sum/P;
mav1 = sum1/P;
dis = c/mav*100;
dis1 = DayClose(1)/mav1*100;
for cnt = 1 to 1000 {
if stime == stime[cnt] and sdate != sdate[cnt] then{
PredayVol = DayVolume[cnt];
cnt = 1001;
}
}
if dayopen <= DayClose(1)*1.05 and
dayhigh <= dayopen*1.05 and
dis1 >= 103 and
ExitDate(1) != sdate and
DayVolume < PredayVol*1 Then{
if stime >= 90000 and stime < 100000 and dis >= 100.5 and dis < 101.5 Then
buy("b1",AtMarket);
if stime >= 100000 and stime < 110000 and dis >= 100.5 and dis < 102.0 Then
buy("b2",AtMarket);
if stime >= 110000 and stime < 120000 and dis >= 100.5 and dis < 102.5 Then
buy("b3",AtMarket);
if stime >= 120000 and stime < 130000 and dis >= 100.5 and dis < 103.0 Then
buy("b4",AtMarket);
if stime >= 130000 and stime < 140000 and dis >= 100.5 and dis < 103.5 Then
buy("b5",AtMarket);
if stime >= 140000 and stime < 144800 and dis >= 100.5 and dis < 104.0 Then
buy("b6",AtMarket);
if stime >= 143000 and stime < 144800 and c < Pivot and dis >= 100.5 and dis < 105.0 Then
buy("b7",AtMarket);
}
if MarketPosition == 1 Then{
if C >= EntryPrice*1.06 Then
exitlong("bx1",AtMarket);
if C <= EntryPrice*0.945 Then
exitlong("bx2",AtMarket);
if sdate == EntryDate and C >= EntryPrice*1.045 then
exitlong("bx3",AtMarket);
if sdate > EntryDate and daycnt == daycnt[BarsSinceEntry]+2 and stime >= 94000 Then
exitlong("bx4",AtMarket);
}
답변 1
예스스탁 예스스탁 답변
2013-09-13 09:56:20
안녕하세요
예스스탁입니다.
1.
input : P(5);
var : cnt(0),sum(0),sum1(0),mav(0),mav1(0),dis(0),dis1(0),daycnt(0),PredayVol(0);
Var : Pivot(0),R1(0),R2(0),S1(0),S2(0);
Pivot = (DayHigh(1)+DayLow(1)+DayClose(1))/3;
if date != date[1] Then
Daycnt = daycnt+1;
sum = 0;
sum1 = 0;
for cnt = 0 to P-1{
sum = sum+DayClose(cnt);
sum1 = sum1+DayClose(cnt+1);
}
mav = sum/P;
mav1 = sum1/P;
dis = c/mav*100;
dis1 = DayClose(1)/mav1*100;
for cnt = 1 to 1000 {
if stime == stime[cnt] and sdate != sdate[cnt] then{
PredayVol = DayVolume[cnt];
cnt = 1001;
}
}
if dayopen <= DayClose(1)*1.05 and
dayhigh <= dayopen*1.05 and
dis1 >= 103 and
ExitDate(1) != sdate and
DayVolume < PredayVol*1 Then{
if stime >= 90000 and stime < 100000 and dis >= 100.5 and dis < 101.5 Then
buy("b1",AtMarket);
if stime >= 100000 and stime < 110000 and dis >= 100.5 and dis < 102.0 Then
buy("b2",AtMarket);
if stime >= 110000 and stime < 120000 and dis >= 100.5 and dis < 102.5 Then
buy("b3",AtMarket);
if stime >= 120000 and stime < 130000 and dis >= 100.5 and dis < 103.0 Then
buy("b4",AtMarket);
if stime >= 130000 and stime < 140000 and dis >= 100.5 and dis < 103.5 Then
buy("b5",AtMarket);
if stime >= 140000 and stime < 144800 and dis >= 100.5 and dis < 104.0 Then
buy("b6",AtMarket);
if stime >= 143000 and stime < 144800 and c < Pivot and dis >= 100.5 and dis < 105.0 Then
buy("b7",AtMarket);
}
if MarketPosition == 1 Then{
if C >= EntryPrice*1.06 Then
exitlong("bx1",AtMarket);
if C <= EntryPrice*0.945 Then
exitlong("bx2",AtMarket);
if sdate == EntryDate and C >= EntryPrice*1.045 then
exitlong("bx3",AtMarket);
if sdate > EntryDate and daycnt == daycnt[BarsSinceEntry]+2 and stime >= 94000 Then
exitlong("bx4",AtMarket);
if sdate > EntryDate and dis >= 100 and dis[dayindex] >= 98 and dis[dayindex] < 100 Then
exitlong("bx51",AtMarket);
if sdate > EntryDate and dis >= 99.5 and dis[dayindex] >= 97 and dis[dayindex] < 98 Then
exitlong("bx52",AtMarket);
if sdate > EntryDate and dis >= 99 and dis[dayindex] < 97 Then
exitlong("bx53",AtMarket);
}
2.
각 수식은 독립적입니다.
차트의 적용되어 있는 지표와 시스템은 서로 관계가 없습니다.
시스템 안에서 V와 같은 데이터예약어로 거래량을 수신받아
전략이 구현되므로 차트에 적용되어 있는 거래량은 삭제하셔도 됩니다.
즐거운 하루되세요
> 쌀사비팔 님이 쓴 글입니다.
> 제목 : 한가지 추가 부탁드립니다.
> 아래 식에 청산을 추가해 주세요. 감사합니다.
-매수 후 다음날 부터, 시초가가 5일(일봉)이동평균선 이격도 98이상 100 미만이면, 100 이상이 될때, 다음 첫봉에 청산.
-매수 후 다음날 부터, 시초가가 5일(일봉)이동평균선 이격도 97이상 98 미만이면, 99.5 이상이 될때, 다음 첫봉에 청산.
-매수 후 다음날 부터, 시초가가 5일(일봉)이동평균선 이격도 97 미만이면, 99 이상이 될때, 다음 첫봉에 청산.
<한가지 여쭤볼께 있는데요, 시스템식에 거래량의 조건이 들어 있을때, 전략실행시 차트에 거래량 봉을 삭제해도 상관이 없나요?>
======================================
input : P(5);
var : cnt(0),sum(0),sum1(0),mav(0),mav1(0),dis(0),dis1(0),daycnt(0),PredayVol(0);
Var : Pivot(0),R1(0),R2(0),S1(0),S2(0);
Pivot = (DayHigh(1)+DayLow(1)+DayClose(1))/3;
if date != date[1] Then
Daycnt = daycnt+1;
sum = 0;
sum1 = 0;
for cnt = 0 to P-1{
sum = sum+DayClose(cnt);
sum1 = sum1+DayClose(cnt+1);
}
mav = sum/P;
mav1 = sum1/P;
dis = c/mav*100;
dis1 = DayClose(1)/mav1*100;
for cnt = 1 to 1000 {
if stime == stime[cnt] and sdate != sdate[cnt] then{
PredayVol = DayVolume[cnt];
cnt = 1001;
}
}
if dayopen <= DayClose(1)*1.05 and
dayhigh <= dayopen*1.05 and
dis1 >= 103 and
ExitDate(1) != sdate and
DayVolume < PredayVol*1 Then{
if stime >= 90000 and stime < 100000 and dis >= 100.5 and dis < 101.5 Then
buy("b1",AtMarket);
if stime >= 100000 and stime < 110000 and dis >= 100.5 and dis < 102.0 Then
buy("b2",AtMarket);
if stime >= 110000 and stime < 120000 and dis >= 100.5 and dis < 102.5 Then
buy("b3",AtMarket);
if stime >= 120000 and stime < 130000 and dis >= 100.5 and dis < 103.0 Then
buy("b4",AtMarket);
if stime >= 130000 and stime < 140000 and dis >= 100.5 and dis < 103.5 Then
buy("b5",AtMarket);
if stime >= 140000 and stime < 144800 and dis >= 100.5 and dis < 104.0 Then
buy("b6",AtMarket);
if stime >= 143000 and stime < 144800 and c < Pivot and dis >= 100.5 and dis < 105.0 Then
buy("b7",AtMarket);
}
if MarketPosition == 1 Then{
if C >= EntryPrice*1.06 Then
exitlong("bx1",AtMarket);
if C <= EntryPrice*0.945 Then
exitlong("bx2",AtMarket);
if sdate == EntryDate and C >= EntryPrice*1.045 then
exitlong("bx3",AtMarket);
if sdate > EntryDate and daycnt == daycnt[BarsSinceEntry]+2 and stime >= 94000 Then
exitlong("bx4",AtMarket);
}