커뮤니티
문의드립니다.
2015-07-16 21:28:10
129
글번호 88560
안녕하세요.
7th 에있는 timeBreak(변형)시스템인데 해외선물로 전환해서 검증하려고하니
현재 작성한 식에대한 지표를 작성하지못해서 지표식및(매수라인,매도라인)
시스템식 오류수정 부탁드립니다.
감사합니다
=====================================
input : len(0.18),len1(2.7),n(40),barr(1), s1(2);
var: CurrentEntryNum(0);
var: cnt(0);
Array : OO[10](0),HH[10](0),LL[10](0),CC[10](0);
if Bdate != Bdate[1] Then{
OO[0] = O;
HH[0] = H;
LL[0] = L;
CC[0] = C;
for cnt = 1 to 9{
OO[cnt] = OO[cnt-1][1];
HH[cnt] = HH[cnt-1][1];
LL[cnt] = LL[cnt-1][1];
CC[cnt] = CC[cnt-1][1];
}
}
if H > HH[0] then
HH[0] = H;
if L < LL[0] then
LL[0] = L;
if C < CC[0] then
CC[0] = C;
if Bdate != Bdate[1] Then { //날이 바뀐 첫봉에서
var1 = TotalTrades;
Var2 = barindex;
}
CurrentEntryNum = iff(marketposition == 0,TotalTrades, TotalTrades+1 );
If barindex-var2==barr then { //2번째봉에서
Var3=highest(high,s1)-atr(n)*len;
Var4=lowest(low,s1)+atr(n)*len;
}
//2번째봉 이후부터 진입
If barindex-var2 > barr And stime<160000 then {
//하루에 두번만
If currententrynum-var1<=1 then {
If OO[0]<=close then { //(양봉)
buy("매수", Atstop,Var3);
}
If OO[0]>close then { // (음봉)
sell("매도",Atstop,Var4);
}
}
}
//청산
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();
}
답변 1
예스스탁 예스스탁 답변
2015-07-17 10:03:50
안녕하세요
예스스탁입니다.
식을 수정했습니다.
1. 시스템
input : len(0.18),len1(2.7),n(40),barr(2), s1(2),당일진입횟수(1);
var: CurrentEntryNum(0),Didx(0),cnt(0),Timecond(false);
Array : OO[10](0),HH[10](0),LL[10](0),CC[10](0);
//영업일 변경
if Bdate != Bdate[1] Then{
//일간 값 초기값
OO[0] = O;
HH[0] = H;
LL[0] = L;
CC[0] = C;
//영업일이 변경되면 기존배열방 값을 다음배열방으로 옮김
for cnt = 1 to 9{
OO[cnt] = OO[cnt-1][1];
HH[cnt] = HH[cnt-1][1];
LL[cnt] = LL[cnt-1][1];
CC[cnt] = CC[cnt-1][1];
}
//당일진입횟수 초기화 0
CurrentEntryNum = 0;
//당일봉수 초기화 0
Didx = 0;
//시간조건 true
Timecond = true;
}
#봉수 카운트
Didx = Didx+1;
#일간 최고가/최저가/종가최저가 계산
if H > HH[0] then
HH[0] = H;
if L < LL[0] then
LL[0] = L;
if C < CC[0] then
CC[0] = C;
#진입횟수 카운트
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
CurrentEntryNum = CurrentEntryNum+1;
If didx == barr then { //2번째봉에서
Var3=highest(high,s1)-atr(n)*len;
Var4=lowest(low,s1)+atr(n)*len;
}
//2번째봉 이후부터 진입
If Didx > barr And TimeCond == true then {
//하루에 두번만
If currententrynum < 당일진입횟수 then {
If OO[0]<=close then { //(양봉)
buy("매수", Atstop,Var3);
}
If OO[0]>close then { // (음봉)
sell("매도",Atstop,Var4);
}
}
}
//청산
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{
Timecond = true;
exitlong();
ExitShort();
}
2 지표는 var3과 var4와 당일시초가를 출력하게 했습니다
input : len(0.18),len1(2.7),n(40),barr(2), s1(2),당일진입횟수(1);
var: CurrentEntryNum(0),Didx(0),cnt(0),Timecond(false);
Array : OO[10](0),HH[10](0),LL[10](0),CC[10](0);
//영업일 변경
if Bdate != Bdate[1] Then{
//일간 값 초기값
OO[0] = O;
HH[0] = H;
LL[0] = L;
CC[0] = C;
//영업일이 변경되면 기존배열방 값을 다음배열방으로 옮김
for cnt = 1 to 9{
OO[cnt] = OO[cnt-1][1];
HH[cnt] = HH[cnt-1][1];
LL[cnt] = LL[cnt-1][1];
CC[cnt] = CC[cnt-1][1];
}
//당일진입횟수 초기화 0
CurrentEntryNum = 0;
//당일봉수 초기화 0
Didx = 0;
//시간조건 true
Timecond = true;
}
#봉수 카운트
Didx = Didx+1;
#일간 최고가/최저가/종가최저가 계산
if H > HH[0] then
HH[0] = H;
if L < LL[0] then
LL[0] = L;
if C < CC[0] then
CC[0] = C;
If didx == barr then { //2번째봉에서
Var3=highest(high,s1)-atr(n)*len;
Var4=lowest(low,s1)+atr(n)*len;
}
plot1(var3);
plot2(var4);
plot3(OO[0]);
즐거운 하루되세요
> 베드로 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 안녕하세요.
7th 에있는 timeBreak(변형)시스템인데 해외선물로 전환해서 검증하려고하니
현재 작성한 식에대한 지표를 작성하지못해서 지표식및(매수라인,매도라인)
시스템식 오류수정 부탁드립니다.
감사합니다
=====================================
input : len(0.18),len1(2.7),n(40),barr(1), s1(2);
var: CurrentEntryNum(0);
var: cnt(0);
Array : OO[10](0),HH[10](0),LL[10](0),CC[10](0);
if Bdate != Bdate[1] Then{
OO[0] = O;
HH[0] = H;
LL[0] = L;
CC[0] = C;
for cnt = 1 to 9{
OO[cnt] = OO[cnt-1][1];
HH[cnt] = HH[cnt-1][1];
LL[cnt] = LL[cnt-1][1];
CC[cnt] = CC[cnt-1][1];
}
}
if H > HH[0] then
HH[0] = H;
if L < LL[0] then
LL[0] = L;
if C < CC[0] then
CC[0] = C;
if Bdate != Bdate[1] Then { //날이 바뀐 첫봉에서
var1 = TotalTrades;
Var2 = barindex;
}
CurrentEntryNum = iff(marketposition == 0,TotalTrades, TotalTrades+1 );
If barindex-var2==barr then { //2번째봉에서
Var3=highest(high,s1)-atr(n)*len;
Var4=lowest(low,s1)+atr(n)*len;
}
//2번째봉 이후부터 진입
If barindex-var2 > barr And stime<160000 then {
//하루에 두번만
If currententrynum-var1<=1 then {
If OO[0]<=close then { //(양봉)
buy("매수", Atstop,Var3);
}
If OO[0]>close then { // (음봉)
sell("매도",Atstop,Var4);
}
}
}
//청산
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();
}
다음글
이전글