커뮤니티
시스템
2011-06-16 16:30:12
650
글번호 39872
시초 선물1분봉 진입시 처음봉 다음부터(즉2번째 봉부터) 시스템 작동부탁드림니다.
감사합니다
input : value1(0.5), value2(0.5);
var : cnt(0), bpos(0), bval(0), spos(0), sval(0);
var : bpos2(0), bval2(0), spos2(0), sval2(0);
//최초 진입이 매수일 경우
if date != date[1] then {
cnt = 0;
bpos = 0;
spos = 0;
}
if cnt==0 and C > H[1]+value1 then {
buy("B최초진입");
bpos = 1;
bVal = C;
cnt = 1;
}
if bpos == 1 and crossUp(C,bval+value2) then {
exitlong("B종료1");
bpos = 0;
}
if bpos == 1 and crossdown(C,bval-value2) then {
sell("B재진입1");
sVal = C;
spos = 1;
bpos = 0;
}
if spos == 1 and crossdown(C,sval-value2) then {
exitshort("B종료2");
spos = 0;
}
if spos == 1 and crossup(C, sval+value2) then {
sell("B재진입2");
bval = C;
spos = 0;
bpos = 1;
}
//최초 진입이 매도일 경우
if date != date[1] then {
bpos2 = 0;
spos2 = 0;
}
if cnt==0 and C > L[1]-value1 then {
buy("S최초진입");
spos2 = 1;
sVal2 = C;
cnt = 1;
}
if spos2 == 1 and crossdown(C,sval2-value2) then {
exitshort("S종료1");
spos2 = 0;
}
if spos2 == 1 and crossup(C,sval2+value2) then {
buy("S재진입1");
bVal2 = C;
bpos2 = 1;
spos2 = 0;
}
if bpos2 == 1 and crossup(C,bval2+value2) then {
exitlong("S종료2");
bpos2 = 0;
}
if bpos2 == 1 and crossdown(C, bval2-value2) then {
buy("S재진입2");
sval2 = C;
bpos2= 0;
spos2 = 1;
}
답변 1
예스스탁 예스스탁 답변
2011-06-16 16:56:06
안녕하세요
예스스탁입니다.
input : value1(0.5), value2(0.5);
var : cnt(0), bpos(0), bval(0), spos(0), sval(0);
var : bpos2(0), bval2(0), spos2(0), sval2(0);
//최초 진입이 매수일 경우
if date != date[1] then {
cnt = 0;
bpos = 0;
spos = 0;
}
if dayindex > 0 then{
if cnt==0 and C > H[1]+value1 then {
buy("B최초진입");
bpos = 1;
bVal = C;
cnt = 1;
}
if bpos == 1 and crossUp(C,bval+value2) then {
exitlong("B종료1");
bpos = 0;
}
if bpos == 1 and crossdown(C,bval-value2) then {
sell("B재진입1");
sVal = C;
spos = 1;
bpos = 0;
}
if spos == 1 and crossdown(C,sval-value2) then {
exitshort("B종료2");
spos = 0;
}
if spos == 1 and crossup(C, sval+value2) then {
sell("B재진입2");
bval = C;
spos = 0;
bpos = 1;
}
}
//최초 진입이 매도일 경우
if date != date[1] then {
bpos2 = 0;
spos2 = 0;
}
if dayindex > 0 then{
if cnt==0 and C > L[1]-value1 then {
buy("S최초진입");
spos2 = 1;
sVal2 = C;
cnt = 1;
}
if spos2 == 1 and crossdown(C,sval2-value2) then {
exitshort("S종료1");
spos2 = 0;
}
if spos2 == 1 and crossup(C,sval2+value2) then {
buy("S재진입1");
bVal2 = C;
bpos2 = 1;
spos2 = 0;
}
if bpos2 == 1 and crossup(C,bval2+value2) then {
exitlong("S종료2");
bpos2 = 0;
}
if bpos2 == 1 and crossdown(C, bval2-value2) then {
buy("S재진입2");
sval2 = C;
bpos2= 0;
spos2 = 1;
}
}
즐거운 하루되세요
> 외국인 님이 쓴 글입니다.
> 제목 : 시스템
> 시초 선물1분봉 진입시 처음봉 다음부터(즉2번째 봉부터) 시스템 작동부탁드림니다.
감사합니다
input : value1(0.5), value2(0.5);
var : cnt(0), bpos(0), bval(0), spos(0), sval(0);
var : bpos2(0), bval2(0), spos2(0), sval2(0);
//최초 진입이 매수일 경우
if date != date[1] then {
cnt = 0;
bpos = 0;
spos = 0;
}
if cnt==0 and C > H[1]+value1 then {
buy("B최초진입");
bpos = 1;
bVal = C;
cnt = 1;
}
if bpos == 1 and crossUp(C,bval+value2) then {
exitlong("B종료1");
bpos = 0;
}
if bpos == 1 and crossdown(C,bval-value2) then {
sell("B재진입1");
sVal = C;
spos = 1;
bpos = 0;
}
if spos == 1 and crossdown(C,sval-value2) then {
exitshort("B종료2");
spos = 0;
}
if spos == 1 and crossup(C, sval+value2) then {
sell("B재진입2");
bval = C;
spos = 0;
bpos = 1;
}
//최초 진입이 매도일 경우
if date != date[1] then {
bpos2 = 0;
spos2 = 0;
}
if cnt==0 and C > L[1]-value1 then {
buy("S최초진입");
spos2 = 1;
sVal2 = C;
cnt = 1;
}
if spos2 == 1 and crossdown(C,sval2-value2) then {
exitshort("S종료1");
spos2 = 0;
}
if spos2 == 1 and crossup(C,sval2+value2) then {
buy("S재진입1");
bVal2 = C;
bpos2 = 1;
spos2 = 0;
}
if bpos2 == 1 and crossup(C,bval2+value2) then {
exitlong("S종료2");
bpos2 = 0;
}
if bpos2 == 1 and crossdown(C, bval2-value2) then {
buy("S재진입2");
sval2 = C;
bpos2= 0;
spos2 = 1;
}
다음글
이전글