커뮤니티
문의드립니다
2010-11-23 14:32:04
722
글번호 33826
안녕하세요.
한개의 시스템식에 변수를 분할하여 진입,청산하고자 합니다.
아래식에 적용된 진입,청산 변수값을 A 진입,청산이라고 가정하고
B 진입: LEN2(0.1),LEN3(3),N(20);
C 진입: LEN4(0.3),LEN5(4),N(30);
D 진입: LEN6(0.5),LEN7(6),N(50);
E 진입: LEN8(0.6),LEN9(2),N(70);
.
.
.
--------------------------------
이렇게 10 개정도 변수값을 설정하고 A로 진입한것은 A로 청산하고
B로 진입한것은 B로 청산하는 방식으로 변수값을 여러개 사용하고자
합니다.
이러한 방법에 문제가 있으면 다른방법 좀 알려 주세요.
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);
}
감사합니다.
답변 1
예스스탁 예스스탁 답변
2010-11-23 17:20:21
안녕하세요
예스스탁입니다.
진입을 케스별로 따로 작성하신 이후에
청산에서 진입명을 사용하여 제어하셔야 합니다.
경우별로 모두 작성하시는 것과 같습니다.
input : Len(0.1), len1(2.7),n(20);
input : LEN2(0.1),LEN3(3),N1(20);
input : LEN4(0.3),LEN5(4),N2(30);
input : LEN6(0.5),LEN7(6),N3(50);
input : LEN8(0.6),LEN9(2),N4(70);
input : 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("매수1", atstop, dayOpen(0)+var1*len);
if CurrentEntryNum < var10 + tcount and Condition2 == false and MarketPosition <> -1 Then
sell("매도1", atstop, dayOpen(0)-var1*len);
}
If marketposition == 1 Then {
exitlong("매수청산1",Atstop,highest(high,barssinceentry+1)-atr(n)*len1,"매수1");
}
if MarketPosition == -1 then{
exitshort("매도청산1",Atstop,lowest(low,barssinceentry+1)+atr(n)*len1,"매도1");
}
if stime < 150000 then {
if CurrentEntryNum < var10 + tcount and Condition1 == false and MarketPosition <> 1 Then
buy("매수2", atstop, dayOpen(0)+var1*len2);
if CurrentEntryNum < var10 + tcount and Condition2 == false and MarketPosition <> -1 Then
sell("매도2", atstop, dayOpen(0)-var1*len2);
}
If marketposition == 1 Then {
exitlong("매수청산2",Atstop,highest(high,barssinceentry+1)-atr(n)*len3,"매수2");
}
if MarketPosition == -1 then{
exitshort("매도청산2",Atstop,lowest(low,barssinceentry+1)+atr(n)*len3,"매도2");
}
if stime < 150000 then {
if CurrentEntryNum < var10 + tcount and Condition1 == false and MarketPosition <> 1 Then
buy("매수3", atstop, dayOpen(0)+var1*len4);
if CurrentEntryNum < var10 + tcount and Condition2 == false and MarketPosition <> -1 Then
sell("매도3", atstop, dayOpen(0)-var1*len4);
}
If marketposition == 1 Then {
exitlong("매수청산3",Atstop,highest(high,barssinceentry+1)-atr(n)*len5,"매수3");
}
if MarketPosition == -1 then{
exitshort("매도청산3",Atstop,lowest(low,barssinceentry+1)+atr(n)*len5,"매도3");
}
if stime < 150000 then {
if CurrentEntryNum < var10 + tcount and Condition1 == false and MarketPosition <> 1 Then
buy("매수4", atstop, dayOpen(0)+var1*len6);
if CurrentEntryNum < var10 + tcount and Condition2 == false and MarketPosition <> -1 Then
sell("매도4", atstop, dayOpen(0)-var1*len6);
}
If marketposition == 1 Then {
exitlong("매수청산4",Atstop,highest(high,barssinceentry+1)-atr(n)*len7,"매수4");
}
if MarketPosition == -1 then{
exitshort("매도청산4",Atstop,lowest(low,barssinceentry+1)+atr(n)*len7,"매도4");
}
if stime < 150000 then {
if CurrentEntryNum < var10 + tcount and Condition1 == false and MarketPosition <> 1 Then
buy("매수5", atstop, dayOpen(0)+var1*len8);
if CurrentEntryNum < var10 + tcount and Condition2 == false and MarketPosition <> -1 Then
sell("매도5", atstop, dayOpen(0)-var1*len8);
}
If marketposition == 1 Then {
exitlong("매수청산5",Atstop,highest(high,barssinceentry+1)-atr(n)*len9,"매수5");
}
if MarketPosition == -1 then{
exitshort("매도청산5",Atstop,lowest(low,barssinceentry+1)+atr(n)*len9,"매도5");
}
즐거운 하루되세요
> 베드로 님이 쓴 글입니다.
> 제목 : 문의드립니다
> 안녕하세요.
한개의 시스템식에 변수를 분할하여 진입,청산하고자 합니다.
아래식에 적용된 진입,청산 변수값을 A 진입,청산이라고 가정하고
B 진입: LEN2(0.1),LEN3(3),N(20);
C 진입: LEN4(0.3),LEN5(4),N(30);
D 진입: LEN6(0.5),LEN7(6),N(50);
E 진입: LEN8(0.6),LEN9(2),N(70);
.
.
.
--------------------------------
이렇게 10 개정도 변수값을 설정하고 A로 진입한것은 A로 청산하고
B로 진입한것은 B로 청산하는 방식으로 변수값을 여러개 사용하고자
합니다.
이러한 방법에 문제가 있으면 다른방법 좀 알려 주세요.
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);
}
감사합니다.
다음글
이전글