커뮤니티
수식검토 문의입니다.
2011-05-23 01:10:32
723
글번호 38918
연일 수고가 많으십니다.
폭주하는 질문에
아래식의 오류를 찾기 힘드네요
도움 주시기 바랍니다.
inputs : sbn(150), // 고저점 판단 간격
mxg(100), // 고저점 최대폭
mig(70), // 고저점 최소폭
enc(0.5), // 진입상수
cc(1.0);// 청산보정값
var : AA(0), nhb(0),nlb(0), ps(0), hlg(0);
nhb=Nthhighestbar(1,H,sbn);
nlb=Nthlowestbar(1,L,sbn);
hlg=Nthhighest(1,H,sbn)-Nthlowest(1,L,sbn);
조건1
if nlb>nhb and hlg>mig*ps
and hlg<mxg*ps then{
condition1 = true;
value11 = NthLowest(1,L,sbn);
Value12 = nthhighest(1,H,sbn);
if BarsSinceExit>=1 Then
Condition1= false;
}
조건2
if nlb<nhb and hlg>mig*ps
and hlg<mxg*ps then{
condition2 = true;
value21 = nthhighest(1,H,sbn);
Value22 = NthLowest(1,L,sbn);
if BarsSinceExit>=1 Then
Condition2= false;
}
// buy
if MarketPosition>=0 and Condition1==True
then {
if value12-hlg*enc>C Then
buy("b", atlimit, value12-hlg*enc);
}
// buy 익절
if MarketPosition>=1 and Condition1==True
then{
if value12+(value12-hlg*enc)<C
then
exitlong("bx",AtLimit,value12+(value12-hlg*enc)) ;
}
// buy 손절
if MarketPosition>=1 and Condition1==True
then{
if value11<C
then
exitlong("bl",Atstop,value11) ;
}
//sell
if MarketPosition<=0 and Condition2==True
then {
if value22+hlg*enc<C
then
sell("s", atlimit, value22+hlg*enc);
}
// sell 익절
if MarketPosition<=1 and Condition2==True
then {
if value22-(value21-hlg*enc)>C
then
exitshort("sx",Atstop,value22-(value21-hlg*enc));
}
//sell 손절
if MarketPosition<=1 and Condition2==True
then{
if value21<C then
exitshort("sl",Atlimit,value21);
}
답변 1
예스스탁 예스스탁 답변
2011-05-23 13:46:40
안녕하세요
예스스탁입니다.
식상에 조건1,조건2라는 한글이 있습니다.
해당 내용을 주석으로 처리하면 정상 검증됩니다.
inputs : sbn(150), // 고저점 판단 간격
mxg(100), // 고저점 최대폭
mig(70), // 고저점 최소폭
enc(0.5), // 진입상수
cc(1.0);// 청산보정값
var : AA(0), nhb(0),nlb(0), ps(0), hlg(0);
nhb=Nthhighestbar(1,H,sbn);
nlb=Nthlowestbar(1,L,sbn);
hlg=Nthhighest(1,H,sbn)-Nthlowest(1,L,sbn);
#조건1
if nlb>nhb and hlg>mig*ps
and hlg<mxg*ps then{
condition1 = true;
value11 = NthLowest(1,L,sbn);
Value12 = nthhighest(1,H,sbn);
if BarsSinceExit>=1 Then
Condition1= false;
}
# 조건2
if nlb<nhb and hlg>mig*ps
and hlg<mxg*ps then{
condition2 = true;
value21 = nthhighest(1,H,sbn);
Value22 = NthLowest(1,L,sbn);
if BarsSinceExit>=1 Then
Condition2= false;
}
// buy
if MarketPosition>=0 and Condition1==True
then {
if value12-hlg*enc>C Then
buy("b", atlimit, value12-hlg*enc);
}
// buy 익절
if MarketPosition>=1 and Condition1==True
then{
if value12+(value12-hlg*enc)<C
then
exitlong("bx",AtLimit,value12+(value12-hlg*enc)) ;
}
// buy 손절
if MarketPosition>=1 and Condition1==True
then{
if value11<C
then
exitlong("bl",Atstop,value11) ;
}
//sell
if MarketPosition<=0 and Condition2==True
then {
if value22+hlg*enc<C
then
sell("s", atlimit, value22+hlg*enc);
}
// sell 익절
if MarketPosition<=1 and Condition2==True
then {
if value22-(value21-hlg*enc)>C
then
exitshort("sx",Atstop,value22-(value21-hlg*enc));
}
//sell 손절
if MarketPosition<=1 and Condition2==True
then{
if value21<C then
exitshort("sl",Atlimit,value21);
}
즐거운 하루되세요
> 골드핑거 님이 쓴 글입니다.
> 제목 : 수식검토 문의입니다.
> 연일 수고가 많으십니다.
폭주하는 질문에
아래식의 오류를 찾기 힘드네요
도움 주시기 바랍니다.
inputs : sbn(150), // 고저점 판단 간격
mxg(100), // 고저점 최대폭
mig(70), // 고저점 최소폭
enc(0.5), // 진입상수
cc(1.0);// 청산보정값
var : AA(0), nhb(0),nlb(0), ps(0), hlg(0);
nhb=Nthhighestbar(1,H,sbn);
nlb=Nthlowestbar(1,L,sbn);
hlg=Nthhighest(1,H,sbn)-Nthlowest(1,L,sbn);
조건1
if nlb>nhb and hlg>mig*ps
and hlg<mxg*ps then{
condition1 = true;
value11 = NthLowest(1,L,sbn);
Value12 = nthhighest(1,H,sbn);
if BarsSinceExit>=1 Then
Condition1= false;
}
조건2
if nlb<nhb and hlg>mig*ps
and hlg<mxg*ps then{
condition2 = true;
value21 = nthhighest(1,H,sbn);
Value22 = NthLowest(1,L,sbn);
if BarsSinceExit>=1 Then
Condition2= false;
}
// buy
if MarketPosition>=0 and Condition1==True
then {
if value12-hlg*enc>C Then
buy("b", atlimit, value12-hlg*enc);
}
// buy 익절
if MarketPosition>=1 and Condition1==True
then{
if value12+(value12-hlg*enc)<C
then
exitlong("bx",AtLimit,value12+(value12-hlg*enc)) ;
}
// buy 손절
if MarketPosition>=1 and Condition1==True
then{
if value11<C
then
exitlong("bl",Atstop,value11) ;
}
//sell
if MarketPosition<=0 and Condition2==True
then {
if value22+hlg*enc<C
then
sell("s", atlimit, value22+hlg*enc);
}
// sell 익절
if MarketPosition<=1 and Condition2==True
then {
if value22-(value21-hlg*enc)>C
then
exitshort("sx",Atstop,value22-(value21-hlg*enc));
}
//sell 손절
if MarketPosition<=1 and Condition2==True
then{
if value21<C then
exitshort("sl",Atlimit,value21);
}