커뮤니티
문의드립니다
2011-01-27 23:45:59
717
글번호 35348
안녕하세요.
아래 식에서 atstop 을 onclose 로 변환코저 실행하여보니 신호가 이상하여
너무 초보이기에 2가지 문의드립니다.
1.atstop 을 onclose로 전환 부탁드립니다.
2.청산식에서 { } 있는것과 없는것 차이가 무엇인가요.
감사합니다.
======================================================================
input : len(0.1), len1(2.7),n(20),tcount(2);
var: CurrentEntryNum(0);
var1 = dayHigh(1)-dayLow(1);
if date<>date[1] Then {
var10 = TotalTrades;
}
CurrentEntryNum = TotalTrades;
Condition1 = date==exitdate(1) And MarketPosition(1) == 1;
Condition2 = date==exitdate(1) And MarketPosition(1) == -1;
if stime < 150000 then {
if CurrentEntryNum < var10 + tcount and Condition1 == false and MarketPosition <> 1 Then
buy("매수", atstop, dayOpen(0)+var1*len);
if CurrentEntryNum < var10 + tcount and Condition2 == false and MarketPosition <> -1 Then
sell("매도", atstop, dayOpen(0)-var1*len);
}
//청산
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);
}
setstopendofday(1500);
끋.
답변 1
예스스탁 예스스탁 답변
2011-01-28 09:52:30
안녕하세요
예스스탁입니다.
input : len(0.1), len1(2.7),n(20),tcount(2);
var: CurrentEntryNum(0);
var1 = dayHigh(1)-dayLow(1);
if date<>date[1] Then {
var10 = TotalTrades;
}
CurrentEntryNum = TotalTrades;
Condition1 = date==exitdate(1) And MarketPosition(1) == 1;
Condition2 = date==exitdate(1) And MarketPosition(1) == -1;
if stime < 150000 and dayindex > 0 then {
if CurrentEntryNum < var10 + tcount and Condition1 == false and MarketPosition <> 1 Then
if H >= dayOpen(0)+var1[1]*len Then
buy("매수");
if CurrentEntryNum < var10 + tcount and Condition2 == false and MarketPosition <> -1 Then
if L <= dayOpen(0)-var1[1]*len then
sell("매도");
}
If marketposition == 1 and BarsSinceEntry > 1 Then {
if L <= highest(high,barssinceentry+1)[1]-atr(n)[1]*len1 Then
exitlong("매수청산");
}
if MarketPosition == -1 and BarsSinceEntry > 1 then{
if H >= lowest(low,barssinceentry+1)[1]+atr(n)[1]*len1 Then
exitshort("매도청산");
}
setstopendofday(1500);
현재 청산식에서 {}은 있는것과 없는 것의 차이는 없습니다.
if문 아래로 실행문이 여러개 있을 때 하나로 묶어주는 것이므로
청산함수 하나만 있으므로 사용하지 않으셔도 됩니다.
즐거운 하루되세요
> 베드로 님이 쓴 글입니다.
> 제목 : 문의드립니다
> 안녕하세요.
아래 식에서 atstop 을 onclose 로 변환코저 실행하여보니 신호가 이상하여
너무 초보이기에 2가지 문의드립니다.
1.atstop 을 onclose로 전환 부탁드립니다.
2.청산식에서 { } 있는것과 없는것 차이가 무엇인가요.
감사합니다.
======================================================================
input : len(0.1), len1(2.7),n(20),tcount(2);
var: CurrentEntryNum(0);
var1 = dayHigh(1)-dayLow(1);
if date<>date[1] Then {
var10 = TotalTrades;
}
CurrentEntryNum = TotalTrades;
Condition1 = date==exitdate(1) And MarketPosition(1) == 1;
Condition2 = date==exitdate(1) And MarketPosition(1) == -1;
if stime < 150000 then {
if CurrentEntryNum < var10 + tcount and Condition1 == false and MarketPosition <> 1 Then
buy("매수", atstop, dayOpen(0)+var1*len);
if CurrentEntryNum < var10 + tcount and Condition2 == false and MarketPosition <> -1 Then
sell("매도", atstop, dayOpen(0)-var1*len);
}
//청산
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);
}
setstopendofday(1500);
끋.
다음글
이전글