커뮤니티
문의드립니다
2015-07-15 01:00:57
114
글번호 88429
안녕하세요.
43037 관련하여 식수정부탁드립니다.
1번식 수정요청사항
==================
1.당일 매매횟수제한 및 같은방향 진입제어
매수1회, 매도1회, 당일 총2번매매 (외부변수처리)
2.오류사항
=> 시뮬레이션 차트(crude oil 5분차트 변수 0.3,2,20,2적용)
a)7월9일 - 21시에 신호발생되어야하나 7월10일 다른변수값(0.4)에서신호발생
7월7일 - 상기와 동일현상
b)6월15일 -같은방향 두번매매신호발생
(6월14일, 5월28일,5월20일---동일한현상발생)
2번수식 수정요청사항
===================
1) 1번식에 추가로 재진입조건충족시 매수,매도 각1회씩재진입 하고자함.
(재진입1회는 외부변수처리)
1번수식 (기존수식에 매매2번)과 재진입매매 2번 총 4회매매
(모든조건충족시 최대 4회 발생)
## 같은방향 으로 2번씩 발생되어야함.(매수2회,매도2회)
2.오류사항
매수신호가발생되면 그날은 매도신호가 발생안됨
->매수에서 신호 2번 발생하면 매도조건이 충족되어도 매도신호 발생안함.
(7/13, 7/5, 6/29, 6/17, ---->동일한 현상발생)
번거러우시더라도 한번더 검토 부탁드립니다.
감사합니다.
답변 1
예스스탁 예스스탁 답변
2015-07-15 10:41:38
안녕하세요
예스스탁입니다.
1.
input : len(0.25), len1(2.7),n(20),매수진입횟수(1),매도진입횟수(1);
var: cnt(0),Bentry(0),Sentry(0);
Array : OO[10](0),HH[10](0),LL[10](0);
if Bdate != Bdate[1] Then{
OO[0] = O;
HH[0] = H;
LL[0] = L;
for cnt = 1 to 9{
OO[cnt] = OO[cnt-1][1];
HH[cnt] = HH[cnt-1][1];
LL[cnt] = LL[cnt-1][1];
}
}
if H > HH[0] then
HH[0] = H;
if L < LL[0] then
LL[0] = L;
var1 = HH[1]-LL[1];
if bdate <> bdate[1] Then {
Bentry = 0;
Sentry = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] Then
Bentry = Bentry+1;
if MarketPosition == -1 and MarketPosition != MarketPosition[1] Then
Sentry = Sentry+1;
if stime >= 170000 or stime < 160000 then {
if Bentry < 매수진입횟수 and MarketPosition <> 1 Then
buy("매수", atstop, OO[0]+var1*len);
if Sentry < 매도진입횟수 and MarketPosition <> -1 Then
sell("매도", atstop, OO[0]-var1*len);
}
//청산
If marketposition == 1 Then {
exitlong("매수청산",Atstop,highest(high,barssinceentry+1)-atr(n)*len1);
}
if MarketPosition == -1 then{
exitshort("매도청산",Atstop,lowest(low,barssinceentry+1)+atr(n)*len1);
}
if stime == 160000 or (stime > 160000 and stime[1] < 160000) Then{
exitlong();
ExitShort();
}
2.
input : len(0.25), len1(2.7),n(20),매수진입횟수(1),매도진입횟수(1),매수재진입횟수(1),매도재진입횟수(1);
var: cnt(0),Bentry(0),Sentry(0),reBentry(0),reSentry(0);
Array : OO[10](0),HH[10](0),LL[10](0);
if Bdate != Bdate[1] Then{
OO[0] = O;
HH[0] = H;
LL[0] = L;
for cnt = 1 to 9{
OO[cnt] = OO[cnt-1][1];
HH[cnt] = HH[cnt-1][1];
LL[cnt] = LL[cnt-1][1];
}
}
if H > HH[0] then
HH[0] = H;
if L < LL[0] then
LL[0] = L;
var1 = HH[1]-LL[1];
if bdate <> bdate[1] Then {
Bentry = 0;
Sentry = 0;
reBentry = 0;
reSentry = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("매수1") == true Then
Bentry = Bentry+1;
if MarketPosition == -1 and MarketPosition != MarketPosition[1] and IsEntryName("매도1") == true Then
Sentry = Sentry+1;
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("매수2") == true Then
reBentry = reBentry+1;
if MarketPosition == -1 and MarketPosition != MarketPosition[1] and IsEntryName("매도2") == true Then
reSentry = reSentry+1;
if stime >= 170000 or stime < 160000 then {
if Bentry < 매수진입횟수 and MarketPosition <> 1 Then
buy("매수1", atstop, OO[0]+var1*len);
if Sentry < 매도진입횟수 and MarketPosition <> -1 Then
sell("매도1", atstop, OO[0]-var1*len);
if MarketPosition == 0 and MarketPosition(1) == 1 and reBentry < 매수재진입횟수 Then
buy("매수2", atstop, HH[0]+PriceScale);
if MarketPosition == 0 and MarketPosition(1) == -1 and reSentry < 매도재진입횟수 Then
sell("매도2", atstop, LL[0]-PriceScale);
}
//청산
If marketposition == 1 Then {
exitlong("매수청산",Atstop,highest(high,barssinceentry+1)-atr(n)*len1);
}
if MarketPosition == -1 then{
exitshort("매도청산",Atstop,lowest(low,barssinceentry+1)+atr(n)*len1);
}
if stime == 160000 or (stime > 160000 and stime[1] < 160000) Then{
exitlong();
ExitShort();
}
즐거운 하루되세요
> 베드로 님이 쓴 글입니다.
> 제목 : 문의드립니다
> 안녕하세요.
43037 관련하여 식수정부탁드립니다.
1번식 수정요청사항
==================
1.당일 매매횟수제한 및 같은방향 진입제어
매수1회, 매도1회, 당일 총2번매매 (외부변수처리)
2.오류사항
=> 시뮬레이션 차트(crude oil 5분차트 변수 0.3,2,20,2적용)
a)7월9일 - 21시에 신호발생되어야하나 7월10일 다른변수값(0.4)에서신호발생
7월7일 - 상기와 동일현상
b)6월15일 -같은방향 두번매매신호발생
(6월14일, 5월28일,5월20일---동일한현상발생)
2번수식 수정요청사항
===================
1) 1번식에 추가로 재진입조건충족시 매수,매도 각1회씩재진입 하고자함.
(재진입1회는 외부변수처리)
1번수식 (기존수식에 매매2번)과 재진입매매 2번 총 4회매매
(모든조건충족시 최대 4회 발생)
## 같은방향 으로 2번씩 발생되어야함.(매수2회,매도2회)
2.오류사항
매수신호가발생되면 그날은 매도신호가 발생안됨
->매수에서 신호 2번 발생하면 매도조건이 충족되어도 매도신호 발생안함.
(7/13, 7/5, 6/29, 6/17, ---->동일한 현상발생)
번거러우시더라도 한번더 검토 부탁드립니다.
감사합니다.