커뮤니티
문의드려요.
2011-06-08 17:05:17
640
글번호 39556
아래는 일전에 문의 드린사항 입니다.
답변 너무 감사 드립니다.
예제로, 시스템식 두개를 올릴것인데
이 두 로직으로 하나의 로직으로 작성해주실수 있나요?
감사합니다.
------------------------------------------------------------------------------
안녕하세요
예스스탁입니다.
말씀하신 부분과 같이 처리하려면
하나의 시스템으로 구성하셔야 합니다.
단순 합성관리자로는 처리가 되지 않고
따로 여러개의 시스템식 내용을 모아 하나의 시스템으로
구성하셔야 하고 당일 진입이 한번만 발생하도록 제어를 해야 합니다.
즐거운 하루되세요
> 꼬망꼬망 님이 쓴 글입니다.
> 제목 : 합성에 대해서 ..
> 안녕하세요 ?
선물 시스템을 예스로 여려개 돌리고 싶은데요..
증거금이 한계약 돌릴거밖에 안됩니다
그런데 제가 돌릴려는 시스템은 3~4일에 한번만 주문이 나가는데
이런경우 여러개 로직을 돌리면서 당일은 신호가 나오는 한 로직 만 돌아가게 해서
적은 증거금으로 여러개 선물 당일 청산 시스템을 돌리고 싶습니다
이런 경우 추천 되는 방법을 소개해주실수 있나요?
합성이나 로직 등등
감사합니다
-------------------------------------------------------------------------------
로직1
Inputs: Len(6.8), P(60), DiV(25), mult(5), bongp(20), bong(2), stl(6);
vars: MP(0), stopprice(0), Move(0);
If High - Low <> 0 then
Move = ema( (C - O) / (H - L) * V, len);
If Low < lowest( low, P )[1] and Move > highest( Move, P)[1] then
Buy("B2",AtMarket, def,1);
If High > Highest( High, P )[1] and Move < Lowest( Move, P)[1] then
Sell("S2",AtMarket, def,1);
If Low < Lowest( Low , P )[1] and MRO(Move < lowest( Move , P )[1],bongp,1) == -1 then {
var1= h;
var2 = index;
}
If High > Highest( High, P )[1] AND MRO(Move > Highest( Move, P)[1],bongp,1) == -1 then {
var3 = L;
var2 = index;
}
if index - var2 < bong then {
if CrossUp(C, var1) and C > dayOpen then buy();
if CrossDown(C, var3) and C < dayOpen then sell();
}
mp = marketposition;
if MP == 1 and MP[1] <> 1 then Begin
StopPrice = low - ma(range,4)*mult;
end;
if MP == -1 and MP[1] <> -1 then begin
StopPrice = High + ma(range,4)*mult;
end;
If MP == 1 then begin
exitlong ("ExitLong", atstop,stopprice );
stopprice = stopprice +( low-stopprice )/Div;
end;
If MP == -1 then begin
exitshort ("Exitshort", atstop,stopprice);
stopprice = stopprice - (stopprice-high)/Div;
end;
setstopendofday(150400);
SetStopLoss(stl, PointStop);
---------------------------------------------------------------------------
로직2
input : len(3.2), len1(0.34), atrrate(20);
vars: Move(0);
//디마크 설정
If dayOpen>dayClose(1) Then { //시가가 전일종가보다 크면
Var1=(dayHigh(1)+dayClose(1)+2*dayLow(1))/2-dayLow(1);
Var2=(dayHigh(1)+dayClose(1)+2*dayLow(1))/2-dayHigh(1);
}
Else if dayOpen<dayClose(1) Then {//시가가 전일종가보다 작으면
Var1=(2*dayHigh(1)+dayClose(1)+dayLow(1))/2-dayLow(1);
Var2=(2*dayHigh(1)+dayClose(1)+dayLow(1))/2-dayHigh(1);
}
Else {//두조건다 아니라면
Var1=(dayHigh(1)+2*dayClose(1)+dayLow(1))/2-dayLow(1);
Var2=(dayHigh(1)+2*dayClose(1)+dayLow(1))/2-dayHigh(1);
}
Condition1= date==exitdate(1) And marketposition(1)==1; //최근청산날짜가 금일이고 직전이 매수
Condition2= date==exitdate(1) And marketposition(1)==-1;//최근청산날짜가 금일이고 직전이 매도
//진입
If stime < 150000 Then {
If Condition1==False and MarketPosition <> 1 Then {
If dayOpen>var1 Then //시가가 var1보다 크면
buy("매수1",Atstop,dayOpen+(Var1-var2)*len1);//지정가 상향돌파시 매수
If dayOpen<var2 Then //시가가 var2보다 작으면
buy("매수4",Atstop,Var2); //지정가 상향돌파시 매수
}
If Condition2==False and MarketPosition <> -1 Then {
If dayOpen>var1 Then //시가가 var1보다 크면
sell("매도1",Atstop,Var1);//지정가 하향돌파시 매도
If dayOpen<var2 Then //시가가 var2보다 작으면
sell("매도4",Atstop,dayOpen-(Var1-var2)*len1); //지정가 하향돌파시 매도
}
}
//청산
If marketposition<>0 Then {
exitlong("매수청산",Atstop,highest(high,barssinceentry+1)-atr(atrrate)*len);
exitshort("매도청산",Atstop,lowest(low,barssinceentry+1)+atr(atrrate)*len);
}
---------------------------------------------------------------------------
부탁드립니다.
p.s=혹시 어느 한 로직을 우선적으로 주문이 나가게 할수도 있나요?
답변 1
예스스탁 예스스탁 답변
2011-06-09 10:37:24
안녕하세요
예스스탁입니다.
Inputs: Len(6.8), P(60), DiV(25), mult(5), bongp(20), bong(2), stl(6);
vars: MP(0), stopprice(0), Move(0);
If High - Low <> 0 then
Move = ema( (C - O) / (H - L) * V, len);
If MarketPosition == 0 and Low < lowest( low, P )[1] and Move > highest( Move, P)[1] then
Buy("B1",AtMarket, def,1);
If MarketPosition == 0 and High > Highest( High, P )[1] and Move < Lowest( Move, P)[1] then
Sell("S1",AtMarket, def,1);
If Low < Lowest( Low , P )[1] and MRO(Move < lowest( Move , P )[1],bongp,1) == -1 then {
var1= h;
var2 = index;
}
If High > Highest( High, P )[1] AND MRO(Move > Highest( Move, P)[1],bongp,1) == -1 then {
var3 = L;
var2 = index;
}
if MarketPosition == 0 and index - var2 < bong then {
if CrossUp(C, var1) and C > dayOpen then buy("b2");
if CrossDown(C, var3) and C < dayOpen then sell("s2");
}
mp = marketposition;
if MP == 1 and MP[1] <> 1 then Begin
StopPrice = low - ma(range,4)*mult;
end;
if MP == -1 and MP[1] <> -1 then begin
StopPrice = High + ma(range,4)*mult;
end;
If MP == 1 and (IsEntryName("b1") or IsEntryName("b2")) then begin
exitlong ("ExitLong", atstop,stopprice);
stopprice = stopprice +( low-stopprice )/Div;
end;
If MP == -1 and (IsEntryName("s1") or IsEntryName("s2")) then begin
exitshort ("Exitshort", atstop,stopprice);
stopprice = stopprice - (stopprice-high)/Div;
end;
if IsEntryName("b1") or IsEntryName("b1") or IsEntryName("s1") or IsEntryName("s1") Then{
SetStopLoss(stl, PointStop);
setstopendofday(150400);
}
else{
SetStopLoss(0);
setstopendofday(0);
}
input : len1(3.2), len11(0.34), atrrate(20);
//디마크 설정
If dayOpen>dayClose(1) Then { //시가가 전일종가보다 크면
var11=(dayHigh(1)+dayClose(1)+2*dayLow(1))/2-dayLow(1);
var22=(dayHigh(1)+dayClose(1)+2*dayLow(1))/2-dayHigh(1);
}
Else if dayOpen<dayClose(1) Then {//시가가 전일종가보다 작으면
var11=(2*dayHigh(1)+dayClose(1)+dayLow(1))/2-dayLow(1);
var22=(2*dayHigh(1)+dayClose(1)+dayLow(1))/2-dayHigh(1);
}
Else {//두조건다 아니라면
var11=(dayHigh(1)+2*dayClose(1)+dayLow(1))/2-dayLow(1);
var22=(dayHigh(1)+2*dayClose(1)+dayLow(1))/2-dayHigh(1);
}
Condition1= date==exitdate(1) And marketposition(1)==1; //최근청산날짜가 금일이고 직전이 매수
Condition2= date==exitdate(1) And marketposition(1)==-1;//최근청산날짜가 금일이고 직전이 매도
//진입
If stime < 150000 and MarketPosition == 0 Then {
If Condition1==False and MarketPosition <> 1 Then {
If dayOpen>var11 Then //시가가 var11보다 크면
buy("매수1",Atstop,dayOpen+(var11-var22)*len11);//지정가 상향돌파시 매수
If dayOpen<var22 Then //시가가 var22보다 작으면
buy("매수2",Atstop,var22); //지정가 상향돌파시 매수
}
If Condition2==False and MarketPosition <> -1 Then {
If dayOpen>var11 Then //시가가 var11보다 크면
sell("매도1",Atstop,var11);//지정가 하향돌파시 매도
If dayOpen<var22 Then //시가가 var22보다 작으면
sell("매도2",Atstop,dayOpen-(var11-var22)*len11); //지정가 하향돌파시 매도
}
}
//청산
If marketposition<>0 Then {
if IsEntryName("매수1") or IsEntryName("매수2") Then
exitlong("매수청산",Atstop,highest(high,barssinceentry+1)-atr(atrrate)*len1);
if IsEntryName("매도1") or IsEntryName("매도2") Then
exitshort("매도청산",Atstop,lowest(low,barssinceentry+1)+atr(atrrate)*len1);
}
1. 모든 진입은 무포지션일때 발생하게 만들었습니다.
2. 시스템별로 청산이 다르므로 청산을 시스템별로 구분했습니다.
3. 각 시스템별로 먼저만족한 진입으로 들어갑니다.
즐거운 하루되세요
> 꼬망꼬망 님이 쓴 글입니다.
> 제목 : 문의드려요.
>
아래는 일전에 문의 드린사항 입니다.
답변 너무 감사 드립니다.
예제로, 시스템식 두개를 올릴것인데
이 두 로직으로 하나의 로직으로 작성해주실수 있나요?
감사합니다.
------------------------------------------------------------------------------
안녕하세요
예스스탁입니다.
말씀하신 부분과 같이 처리하려면
하나의 시스템으로 구성하셔야 합니다.
단순 합성관리자로는 처리가 되지 않고
따로 여러개의 시스템식 내용을 모아 하나의 시스템으로
구성하셔야 하고 당일 진입이 한번만 발생하도록 제어를 해야 합니다.
즐거운 하루되세요
> 꼬망꼬망 님이 쓴 글입니다.
> 제목 : 합성에 대해서 ..
> 안녕하세요 ?
선물 시스템을 예스로 여려개 돌리고 싶은데요..
증거금이 한계약 돌릴거밖에 안됩니다
그런데 제가 돌릴려는 시스템은 3~4일에 한번만 주문이 나가는데
이런경우 여러개 로직을 돌리면서 당일은 신호가 나오는 한 로직 만 돌아가게 해서
적은 증거금으로 여러개 선물 당일 청산 시스템을 돌리고 싶습니다
이런 경우 추천 되는 방법을 소개해주실수 있나요?
합성이나 로직 등등
감사합니다
-------------------------------------------------------------------------------
로직1
Inputs: Len(6.8), P(60), DiV(25), mult(5), bongp(20), bong(2), stl(6);
vars: MP(0), stopprice(0), Move(0);
If High - Low <> 0 then
Move = ema( (C - O) / (H - L) * V, len);
If Low < lowest( low, P )[1] and Move > highest( Move, P)[1] then
Buy("B2",AtMarket, def,1);
If High > Highest( High, P )[1] and Move < Lowest( Move, P)[1] then
Sell("S2",AtMarket, def,1);
If Low < Lowest( Low , P )[1] and MRO(Move < lowest( Move , P )[1],bongp,1) == -1 then {
var1= h;
var2 = index;
}
If High > Highest( High, P )[1] AND MRO(Move > Highest( Move, P)[1],bongp,1) == -1 then {
var3 = L;
var2 = index;
}
if index - var2 < bong then {
if CrossUp(C, var1) and C > dayOpen then buy();
if CrossDown(C, var3) and C < dayOpen then sell();
}
mp = marketposition;
if MP == 1 and MP[1] <> 1 then Begin
StopPrice = low - ma(range,4)*mult;
end;
if MP == -1 and MP[1] <> -1 then begin
StopPrice = High + ma(range,4)*mult;
end;
If MP == 1 then begin
exitlong ("ExitLong", atstop,stopprice );
stopprice = stopprice +( low-stopprice )/Div;
end;
If MP == -1 then begin
exitshort ("Exitshort", atstop,stopprice);
stopprice = stopprice - (stopprice-high)/Div;
end;
setstopendofday(150400);
SetStopLoss(stl, PointStop);
---------------------------------------------------------------------------
로직2
input : len(3.2), len1(0.34), atrrate(20);
vars: Move(0);
//디마크 설정
If dayOpen>dayClose(1) Then { //시가가 전일종가보다 크면
Var1=(dayHigh(1)+dayClose(1)+2*dayLow(1))/2-dayLow(1);
Var2=(dayHigh(1)+dayClose(1)+2*dayLow(1))/2-dayHigh(1);
}
Else if dayOpen<dayClose(1) Then {//시가가 전일종가보다 작으면
Var1=(2*dayHigh(1)+dayClose(1)+dayLow(1))/2-dayLow(1);
Var2=(2*dayHigh(1)+dayClose(1)+dayLow(1))/2-dayHigh(1);
}
Else {//두조건다 아니라면
Var1=(dayHigh(1)+2*dayClose(1)+dayLow(1))/2-dayLow(1);
Var2=(dayHigh(1)+2*dayClose(1)+dayLow(1))/2-dayHigh(1);
}
Condition1= date==exitdate(1) And marketposition(1)==1; //최근청산날짜가 금일이고 직전이 매수
Condition2= date==exitdate(1) And marketposition(1)==-1;//최근청산날짜가 금일이고 직전이 매도
//진입
If stime < 150000 Then {
If Condition1==False and MarketPosition <> 1 Then {
If dayOpen>var1 Then //시가가 var1보다 크면
buy("매수1",Atstop,dayOpen+(Var1-var2)*len1);//지정가 상향돌파시 매수
If dayOpen<var2 Then //시가가 var2보다 작으면
buy("매수4",Atstop,Var2); //지정가 상향돌파시 매수
}
If Condition2==False and MarketPosition <> -1 Then {
If dayOpen>var1 Then //시가가 var1보다 크면
sell("매도1",Atstop,Var1);//지정가 하향돌파시 매도
If dayOpen<var2 Then //시가가 var2보다 작으면
sell("매도4",Atstop,dayOpen-(Var1-var2)*len1); //지정가 하향돌파시 매도
}
}
//청산
If marketposition<>0 Then {
exitlong("매수청산",Atstop,highest(high,barssinceentry+1)-atr(atrrate)*len);
exitshort("매도청산",Atstop,lowest(low,barssinceentry+1)+atr(atrrate)*len);
}
---------------------------------------------------------------------------
부탁드립니다.
p.s=혹시 어느 한 로직을 우선적으로 주문이 나가게 할수도 있나요?
다음글
이전글