커뮤니티
참조관련....
2012-07-05 21:55:07
257
글번호 52636
data2에 코스피200을 넣어서 참조하고 싶습니다.
data2(atlimit)를 사용하고 싶은데 오류가 발생하는군요.
어떤식으로 사용을 해야 할까요?
-------------------------------------------------------------
input : 매수1(1),매수2(1),매수손절(1),N(2),매도1(1000),매도2(1000),매도손절(1000);
#당일 진입횟수 계산
var : count(0);
//value1 = data2((highest(Close,9)+lowest(Close,9))/2);
//value2 = data2((highest(Close,26)+lowest(Close,26))/2);
//value3 = data2((highest(Close,52)+lowest(Close,52))/2);
Count = 0 ;
for Value1 = 0 to 10 {
if EntryDate( Value1 ) == sdate then
Count = Count + 1;
}
if MarketPosition == 0 and count<n-1 Then {
buy("b1",data2(atlimit),매수1);
//count = count +1;
}
if MarketPosition == 1 and CurrentEntries == 1 and count<n Then {
buy("b2",data2(atlimit),매수2);
//count = count +1;
}
if MarketPosition == 0 and count<n-1 Then { // n-1을 통해서 한번으로 진입을 제한한다.
Sell("s1",data2(atlimit),매도1);
//count = count +1;
}
if MarketPosition == -1 and CurrentEntries == 1 and count<n Then {
sell("s2",data2(AtLimit),매도2);
//count = count +1;
}
if MarketPosition == 1 Then {
ExitLong("bx",data2(AtStop),매수손절);
}
if MarketPosition == -1 Then {
ExitShort("sx",data2(AtStop),매도손절);
}
SetStopEndofday(150000);
답변 1
예스스탁 예스스탁 답변
2012-07-06 10:19:25
안녕하세요
예스스탁입니다.
문의하신 내용 수식으로 가능하지 않습니다.
atstop과 atlimit은 주종목의 시세만을 대상으로 합니다.
참조종목에서 지정한 가격조건 만족즉시는 가능하지 않습니다.
즐거운 하루되세요
> wops 님이 쓴 글입니다.
> 제목 : 참조관련....
> data2에 코스피200을 넣어서 참조하고 싶습니다.
data2(atlimit)를 사용하고 싶은데 오류가 발생하는군요.
어떤식으로 사용을 해야 할까요?
-------------------------------------------------------------
input : 매수1(1),매수2(1),매수손절(1),N(2),매도1(1000),매도2(1000),매도손절(1000);
#당일 진입횟수 계산
var : count(0);
//value1 = data2((highest(Close,9)+lowest(Close,9))/2);
//value2 = data2((highest(Close,26)+lowest(Close,26))/2);
//value3 = data2((highest(Close,52)+lowest(Close,52))/2);
Count = 0 ;
for Value1 = 0 to 10 {
if EntryDate( Value1 ) == sdate then
Count = Count + 1;
}
if MarketPosition == 0 and count<n-1 Then {
buy("b1",data2(atlimit),매수1);
//count = count +1;
}
if MarketPosition == 1 and CurrentEntries == 1 and count<n Then {
buy("b2",data2(atlimit),매수2);
//count = count +1;
}
if MarketPosition == 0 and count<n-1 Then { // n-1을 통해서 한번으로 진입을 제한한다.
Sell("s1",data2(atlimit),매도1);
//count = count +1;
}
if MarketPosition == -1 and CurrentEntries == 1 and count<n Then {
sell("s2",data2(AtLimit),매도2);
//count = count +1;
}
if MarketPosition == 1 Then {
ExitLong("bx",data2(AtStop),매수손절);
}
if MarketPosition == -1 Then {
ExitShort("sx",data2(AtStop),매도손절);
}
SetStopEndofday(150000);
다음글
이전글