커뮤니티
터틀전략
2010-12-07 14:30:18
607
글번호 34125
저는 하이투자 yes3.1 쓰는데 우리투자의 카페 "리딩시스 투자대행"에서 베낀
터틀전략을 시스템에 검정하였드니 아래 내용에서 1째줄에서 에러가 뜨는데
수정부탁드립니다
input:Capital(100,000,000);
var:AtrV(0),unit(0),MP(0);
AtrV=ATR(20);
Unit=(Capital*0.02)/AtrV;
MP=Marketposition;
#진입
if MP==0 then {
buy("B",AtStop,Highest(High,20),unit);
sell("S",AtStop,Lowest(Low,20),Unit);
}
#피라미딩진입
If MP==1 and CurrentEntries<4 Then
buy("bp",AtStop,EntryPrice+AtrV[BarsSinceEntry]*1*CurrentEntries,Unit);
If MP==-1 and CurrentEntries <4 Then
Sell("sp",atstop,Entryprice-AtrV[BarsSinceEntry]*1*CurrentEntries,Unit);
#청산
If MP ==1 then {
ExitLong("El",AtStop,Lowest(L,10));
ExitLong("El_stop",AtStop,AvgEntryPrice-2*AtrV);
}
If MP == -1 then {
ExitShort("ES",AtStop,Highest (H,10));
ExitShort("ES_stop",AtStop, AvgEntryPrice+2*AtrV);
}
감사합니다
답변 1
예스스탁 예스스탁 답변
2010-12-07 15:37:29
안녕하세요
예스스탁입니다.
금액이나 숫자를 지정하실때 천단위 구분기호를
입력하시면 안됩니다.
input:Capital(100000000);
var:AtrV(0),unit(0),MP(0);
AtrV=ATR(20);
Unit=(Capital*0.02)/AtrV;
MP=Marketposition;
#진입
if MP==0 then {
buy("B",AtStop,Highest(High,20),unit);
sell("S",AtStop,Lowest(Low,20),Unit);
}
#피라미딩진입
If MP==1 and CurrentEntries<4 Then
buy("bp",AtStop,EntryPrice+AtrV[BarsSinceEntry]*1*CurrentEntries,Unit);
If MP==-1 and CurrentEntries <4 Then
Sell("sp",atstop,Entryprice-AtrV[BarsSinceEntry]*1*CurrentEntries,Unit);
#청산
If MP ==1 then {
ExitLong("El",AtStop,Lowest(L,10));
ExitLong("El_stop",AtStop,AvgEntryPrice-2*AtrV);
}
If MP == -1 then {
ExitShort("ES",AtStop,Highest (H,10));
ExitShort("ES_stop",AtStop, AvgEntryPrice+2*AtrV);
}
즐거운 하루되세요
> 강변거사 님이 쓴 글입니다.
> 제목 : 터틀전략
> 저는 하이투자 yes3.1 쓰는데 우리투자의 카페 "리딩시스 투자대행"에서 베낀
터틀전략을 시스템에 검정하였드니 아래 내용에서 1째줄에서 에러가 뜨는데
수정부탁드립니다
input:Capital(100,000,000);
var:AtrV(0),unit(0),MP(0);
AtrV=ATR(20);
Unit=(Capital*0.02)/AtrV;
MP=Marketposition;
#진입
if MP==0 then {
buy("B",AtStop,Highest(High,20),unit);
sell("S",AtStop,Lowest(Low,20),Unit);
}
#피라미딩진입
If MP==1 and CurrentEntries<4 Then
buy("bp",AtStop,EntryPrice+AtrV[BarsSinceEntry]*1*CurrentEntries,Unit);
If MP==-1 and CurrentEntries <4 Then
Sell("sp",atstop,Entryprice-AtrV[BarsSinceEntry]*1*CurrentEntries,Unit);
#청산
If MP ==1 then {
ExitLong("El",AtStop,Lowest(L,10));
ExitLong("El_stop",AtStop,AvgEntryPrice-2*AtrV);
}
If MP == -1 then {
ExitShort("ES",AtStop,Highest (H,10));
ExitShort("ES_stop",AtStop, AvgEntryPrice+2*AtrV);
}
감사합니다
다음글