커뮤니티

수식 부탁드립니다.

프로필 이미지
강태공3
2011-12-22 12:06:32
480
글번호 45970
답변완료
안녕하세요 안녕하세요.

아래 수식에 덧붙여서 수정부탁드립니다.

 

아래 매수 매도 진입조건은 금일 진입횟수 제한에서는 제외

매수진입 및 청산조건

1. 금일 7번째봉부터~33봉까지

  (1) 데이타8 이 연속 3봉이 음봉이고 데이타9.10이 연속 3봉이 양봉이고 데이타2,3,4 중에 양봉이 1개이상(단 데이타2,3,4 중에 3봉연속 음봉이 2개이상이면 안됨)

      이면 그 이후에 7봉이내에 선물이 5이평보다 크면 매수

  (2) (현재 무포이거나 or 매도후 최고 수익이 진입가대비 1.1%이상이고) and 데이타8 이 연속 3봉이 음봉이고 데이타9.10이 3봉동안 양봉이 총4개이고

       (단 데이타2,3,4 중에 3봉연속 음봉이 2개이상이면 안됨) and (데이타2,3,4,가 모두 양봉이거나 or 데이타2,3,4 중에서 3봉연속 양봉이 1개이상이면)

       그 이후에 7봉이내에 선물이 5이평보다 크면 매수

2. 금일 3봉부터 31봉까지는

     매수후 현재 수익이 종가로 진입가 대비 0.85% 이상이고 현재 종가가 시초가*1.005 보다 크고 (데이타8이 시초가보다 크다+ 데이타9가 시초가보다 작다+

     데이타10 이 시초가보다 작다+ 데이타7이 시초가보다 작다+ 데이타11이 시초가보다 작다= 이렇게 5조건중에 2개이상 만족하면 ) 그 이후 10봉이내에

      c가 5이평보다 작으면 청산후 금일 모든매매종료

 

 

매도진입 및 청산조건

1. 금일 7번째봉부터~33봉까지

  (1) 데이타8 이 연속 3봉이 양봉이고 데이타9.10이 연속 3봉이 음봉이고 데이타2,3,4 중에 음봉이 1개이상(단 데이타2,3,4 중에 3봉연속 양봉이 2개이상이면 안됨)이면

       그 이후에 7봉이내에 선물이 5이평보다 작으면 매도

  (2) (현재 무포이거나 or 매수후 최고 수익이 진입가대비 1.1%이상이고) and 데이타8 이 연속 3봉이 양봉이고 데이타9.10이 3봉동안 음봉이 총4개이고

      (단 데이타2,3,4 중에 3봉연속 양봉이 2개이상이면 안됨) and (데이타2,3,4,가 모두 음봉이거나 or 데이타2,3,4 중에서 3봉연속 음봉이 1개이상이면)

      그 이후에 7봉이내에 선물이 5이평보다 작으면 매도

2. 금일 3봉부터 31봉까지는

     매도후 현재 수익이 종가로 진입가 대비 0.85% 이상이고 현재 종가가 시초가*0.9955 보다 작고 (데이타8이 시초가보다 작다+ 데이타9가 시초가보다 크다+

     데이타10 이 시초가보다 크다+ 데이타7이 시초가보다 크다+ 데이타11이 시초가보다 크다= 이렇게 5조건중에 2개이상 만족하면 ) 그 이후 10봉이내에 c가 5이평보다

     크면 청산후 금일 모든매매종료

 



input : 하루이익1(3),하루이익2(4);
var : PLR(0),XCommission(0,data1),XSlippage(0,data1),OpenPL(0,data1),dayPL(0,data1),count(0,data1),aa(0,data1); 
var : mav1(0,data1),mav2(0,data1),mav3(0,data1),mav4(0,data1),cond(false,data1);

#당일누적손익계산 시작
XCommission = ((C*ExitCommission)/100)*CurrentContracts; #%설정
XSlippage = (ExitSlippage)*CurrentContracts; #Pt설정

PLR = 0;
count = 0;
for aa = 0 to 10{
    if sdate == EntryDate(aa) Then
        count = count+1;
    if aa > 0 and sdate == EntryDate(aa) Then
        PLR = PLR+PositionProfit(aa);
}

if MarketPosition() == 0 Then{
    OpenPL = 0;
    dayPL = PLR;
}
Else{
    OpenPL = (PositionProfit-(XCommission+XSlippage));
    dayPL = PLR+OpenPL;
}


cond = ExitDate(1) == sdate and (IsExitName("BP1",1) or IsExitName("BP2",1) or IsExitName("SP1",1) or IsExitName("SP2",1));

mav1 = data1(ma(c,5));
mav2 = data1(ma(c,10));
mav3 = data1(ma(c,20));
mav4 = data1(ma(c,60));


if data1(dayindex+1 >= 1 and dayindex+1 <= 30)  and count < 3 and cond == false  then{
      if C < dayopen*1.004 And C > max(mav1,mav2,mav3,mav4) Then{
            if data2(iff(C>O or (C==O and C>=C[1]),1,0))+
                  data3(iff(C>O or (C==O and C>=C[1]),1,0))+
                  data4(iff(C>O or (C==O and C>=C[1]),1,0))+
                  data5(iff(C>O or (C==O and C>=C[1]),1,0))+
                  data6(iff(C>O or (C==O and C>=C[1]),1,0))+
                  data7(iff(C>O or (C==O and C>=C[1]),1,0)) >= 4 Then
                  buy("b2_1");

      }
      if C > dayopen*0.996 And C < Min(mav1,mav2,mav3,mav4) Then{
            if data2(iff(C<O or (C==O and C<C[1]),1,0))+
                  data3(iff(C<O or (C==O and C<C[1]),1,0))+
                  data4(iff(C<O or (C==O and C<C[1]),1,0))+
                  data5(iff(C<O or (C==O and C<C[1]),1,0))+
                  data6(iff(C<O or (C==O and C<C[1]),1,0))+
                  data7(iff(C<O or (C==O and C<C[1]),1,0)) >= 4 Then
                  Sell("s2_1");

      }


If MarketPosition == 1 Then{
      if data1(dayindex+1) >= 40 and C < mav2 Then
            exitlong("bx4");
}

If MarketPosition == -1 Then{
      if data1(dayindex+1) >= 40 and C > mav2 Then
            ExitShort("sx4");
}


if MarketPosition == 1 Then{
    if data1(dayindex+1 < 20) Then
          ExitLong("BP1",AtLimit,EntryPrice+((하루이익1)-(PLR)));
    if data1(dayindex+1 >= 20) Then
          ExitLong("BP2",AtLimit,EntryPrice+((하루이익2)-(PLR)));
}

if MarketPosition == -1 Then{
      if data1(dayindex+1 < 20) Then   
          ExitShort("SP1",AtLimit,EntryPrice+(-(하루이익1)+(PLR)));
    if data1(dayindex+1 >= 20) Then
          ExitShort("SP2",AtLimit,EntryPrice+(-(하루이익2)+(PLR)));
}

시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2011-12-22 15:22:52

안녕하세요 예스스탁입니다. input : 하루이익1(2); var : PLR(0),XCommission(0,data1),XSlippage(0,data1),OpenPL(0,data1),dayPL(0,data1),count(0,data1),aa(0,data1); var : mav1(0,data1),mav2(0,data1),mav3(0,data1),mav4(0,data1),cond(false,data1); var : bcond1(false,data1),B1idx(0,data1),bcond2(false,data1),B2idx(0,data1); var : Scond1(false,data1),S1idx(0,data1),Scond2(false,data1),S2idx(0,data1); var : d2Y(0,data2),d3Y(0,data3),D4Y(0,data4),Bxcond1(false,data1),Bxidx(0,data1); var : d2E(0,data2),d3E(0,data3),D4E(0,data4),Sxcond1(false,data1),Sxidx(0,data1); #당일누적손익계산 시작 XCommission = ((C*ExitCommission)/100)*CurrentContracts; #%설정 XSlippage = (ExitSlippage)*CurrentContracts; #Pt설정 PLR = 0; count = 0; for aa = 0 to 10{ if sdate == EntryDate(aa) Then count = count+1; if aa > 0 and sdate == EntryDate(aa) Then PLR = PLR+PositionProfit(aa); } if MarketPosition() == 0 Then{ OpenPL = 0; dayPL = PLR; } Else{ OpenPL = (PositionProfit-(XCommission+XSlippage)); dayPL = PLR+OpenPL; } cond = ExitDate(1) == sdate and (IsExitName("BP1",1) or IsExitName("BP2",1) or IsExitName("SP1",1) or IsExitName("SP2",1) or IsExitName("bxxx",1) or IsExitName("Sxxx",1)); mav1 = data1(ma(c,5)); mav2 = data1(ma(c,10)); mav3 = data1(ma(c,20)); mav4 = data1(ma(c,60)); if data1(dayindex+1 >= 1 and dayindex+1 <= 30) and count < 3 and cond == false then{ if C < dayopen*1.004 And C > max(mav1,mav2,mav3,mav4) Then{ if data2(iff(C>O or (C==O and C>=C[1]),1,0))+ data3(iff(C>O or (C==O and C>=C[1]),1,0))+ data4(iff(C>O or (C==O and C>=C[1]),1,0)) >= 2 Then buy("b2_1"); } if C > dayopen*0.996 And C < Min(mav1,mav2,mav3,mav4) Then{ if data2(iff(C<O or (C==O and C<C[1]),1,0))+ data3(iff(C<O or (C==O and C<C[1]),1,0))+ data4(iff(C<O or (C==O and C<C[1]),1,0)) >= 2 Then Sell("s2_1"); } } If MarketPosition == 1 Then{ if data1(dayindex+1) >= 40 and C < mav2 Then ExitLong("bx4"); } If MarketPosition == -1 Then{ if data1(dayindex+1) >= 40 and C > mav2 Then ExitShort("sx4"); } if MarketPosition == 1 Then{ if data1(dayindex+1 >= 20) Then ExitLong("BP2",AtLimit,EntryPrice+((하루이익1)-(PLR))); } if MarketPosition == -1 Then{ if data1(dayindex+1 >= 20) Then ExitShort("SP2",AtLimit,EntryPrice+(-(하루이익1)+(PLR))); } if data1(dayindex+1 == 1) Then Bcond1 = false; if data2(dayindex ==0) Then d2Y = 0; if data2(dayindex+1 == 3 and countif(C<O,3)==3) or data2(dayindex+1 > 3 and !(C[4] < O[4]) and countif(C<O,3)==3) Then d2Y = d2Y+1; if data2(dayindex+1 == 3 and countif(C>O,3)==3) or data2(dayindex+1 > 3 and !(C[4] > O[4]) and countif(C>O,3)==3) Then d2E = d2E+1; if data3(dayindex ==0) Then d3Y = 0; if data3(dayindex+1 == 3 and countif(C< O,3)==3) or data3(dayindex+1 > 3 and !(C[4] < O[4]) and countif(C<O,3)==3) Then d3Y = d3Y+1; if data3(dayindex+1 == 3 and countif(C>O,3)==3) or data3(dayindex+1 > 3 and !(C[4] > O[4]) and countif(C>O,3)==3) Then d3E = d3E+1; if data4(dayindex ==0) Then d4Y = 0; if data4(dayindex+1 == 3 and countif(C< O,3)==3) or data4(dayindex+1 > 3 and !(C[4] < O[4]) and countif(C<O,3)==3) Then d4E = d4E+1; if data4(dayindex+1 == 3 and countif(C>O,3)==3) or data4(dayindex+1 > 3 and !(C[4] > O[4]) and countif(C>O,3)==3) Then d4Y = d4Y+1; if data1(dayindex+1 >= 7 and dayindex+1 <= 33) and cond == false Then{ if data8(countif(c<O,3) == 3) and data9(countif(C>O,3) == 3) and data10(countif(C>O,3)== 3) And data2(iff(C>O,1,0))+data3(iff(C>O,1,0))+data4(iff(C>O,1,0)) >= 1 and D2E < 2 and D3E < 2 and D4E < 2 Then{ Bcond1 = true; B1idx = data1(index); } if Bcond1 == true and data1(index) <= B1idx+7 and data1(C> ma(c,5)) Then buy(); if (MarketPosition == 0 or (MarketPosition == -1 and data1(lowest(L,BarsSinceEntry) <= EntryPrice*0.989))) And data8(countif(C<O,3)== 3) and data9(countif(C>O,3))+data10(countif(C>O,3)) >= 4 And D2E < 2 and D3E < 2 and D4E < 2 and ((data2(C>O) and data3(C>O) and data4(C>O)) or data2(countif(C>O,3)== 3) or data3(countif(C>O,3)== 3) or data4(countif(C>O,3)== 3)) Then{ Bcond2 = true; B2idx = data1(index); } if Bcond2 == true and data1(index) <= B2idx+7 and data1(C> ma(c,5)) Then buy(); } if MarketPosition == 1 and C >= EntryPrice*1.0085 and C > dayopen*1.005 then{ if data8(iff(C>OpenD(0),1,0))+data9(iff(C<OpenD(0),1,0)) and data10(iff(C<OpenD(0),1,0)) and data7(iff(C<OpenD(0),1,0))+data11(iff(C<OpenD(0),1,0)) >= 2 Then{ BXcond1 = true; Bxidx = data1(index); } if Bxcond1 == true and data1(index) <= Bxidx+7 and data1(C< ma(c,5)) Then exitlong("bxxx"); } if MarketPosition != 1 Then Bxcond1 = false; if data1(dayindex+1 >= 7 and dayindex+1 <= 33) and cond == false Then{ if data8(countif(c>O,3) == 3) and data9(countif(C<O,3) == 3) and data10(countif(C<O,3)== 3) And data2(iff(C<O,1,0))+data3(iff(C<O,1,0))+data4(iff(C<O,1,0)) >= 1 and D2Y < 2 and D3Y < 2 and D4Y < 2 Then{ Scond1 = true; S1idx = data1(index); } if Scond1 == true and data1(index) <= B1idx+7 and data1(C<ma(c,5)) Then Sell(); if (MarketPosition == 0 or (MarketPosition == 1 and data1(highest(H,BarsSinceEntry) >= EntryPrice*1.011))) And data8(countif(C>O,3)== 3) and data9(countif(C<O,3))+data10(countif(C<O,3)) >= 4 And D2Y < 2 and D3Y < 2 and D4Y < 2 and ((data2(C<O) and data3(C<O) and data4(C<O)) or data2(countif(C<O,3)== 3) or data3(countif(C<O,3)== 3) or data4(countif(C<O,3)== 3)) Then{ Scond2 = true; S2idx = data1(index); } if Scond2 == true and data1(index) <= B2idx+7 and data1(C<ma(c,5)) Then Sell(); } if MarketPosition == -1 and C <= EntryPrice*0.9915 and C < dayopen*0.9955 then{ if data8(iff(C<OpenD(0),1,0))+data9(iff(C>OpenD(0),1,0)) and data10(iff(C>OpenD(0),1,0)) and data7(iff(C>OpenD(0),1,0))+data11(iff(C>OpenD(0),1,0)) >= 2 Then{ SXcond1 = true; Sxidx = data1(index); } if Sxcond1 == true and data1(index) <= Bxidx+10 and data1(C>ma(c,5)) Then ExitShort("Sxxx"); } if MarketPosition != -1 Then Sxcond1 = false; 즐거운 하루되세요 > 강태공3 님이 쓴 글입니다. > 제목 : 수식 부탁드립니다. > <html> <head> <title>안녕하세요</title> <meta name="generator" content="Namo WebEditor v4.0"> </head> <body bgcolor="white" text="black" link="blue" vlink="purple" alink="red"> 안녕하세요. <p>아래 수식에 덧붙여서 수정부탁드립니다.</p> <p>&nbsp;</p> <p><font color="blue">아래 매수 매도 진입조건은 금일 진입횟수 제한에서는 제외</font></p> <p><b><font color="red">매수진입 및 청산조건</font></b></p> <p><font color="black">1. 금일 7번째봉부터~33봉까지</font></p> <p><font color="black">&nbsp;&nbsp;(1) 데이타8 이 연속 3봉이 음봉이고 데이타9.10이 연속 3봉이 양봉이고 데이타2,3,4 중에 양봉이 1개이상(단 데이타2,3,4 중에 3봉연속 음봉이 2개이상이면 안됨)</font></p> <p><font color="black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 이면 그 이후에 7봉이내에 선물이 5이평보다 크면 매수 </font></p> <p><font color="black">&nbsp;&nbsp;(2) (현재 무포이거나 or 매도후 최고 수익이 진입가대비 1.1%이상이고) and 데이타8 이 연속 3봉이 음봉이고 데이타9.10이 3봉동안 양봉이 총</font><font color="black">4</font><font color="black">개이고 </font></p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(단 데이타2,3,4 중에 3봉연속 음봉이 2개이상이면 안됨) and (데이타2,3,4,가 모두 양봉이거나 or 데이타2,3,4 중에서 3봉연속 양봉이 1개이상이면) </p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;그 이후에 7봉이내에 선물이 5이평보다 크면 매수</p> <p>2. 금일 3봉부터 31봉까지는 </p> <p>&nbsp;&nbsp;&nbsp;&nbsp; 매수후 현재 수익이 종가로 진입가 대비 0.85% 이상이고 현재 종가가 시초가*1.005 보다 크고 (데이타8이 시초가보다 크다+ 데이타9가 시초가보다 작다+</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;데이타10 이 시초가보다 작다+ 데이타7이 시초가보다 작다+ 데이타11이 시초가보다 작다= 이렇게 5조건중에 2개이상 만족하면 ) 그 이후 10봉이내에</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c가 5이평보다 작으면 청산후 <font color="red">금일 모든매매종료</font></p> <p>&nbsp;</p> <p>&nbsp;</p> <p><b><font color="blue">매도진입 및 청산조건</font></b></p> <p><font color="black">1. 금일 7번째봉부터~33봉까지</font></p> <p><font color="black">&nbsp;&nbsp;(1)&nbsp;데이타8 이 연속 3봉이 양봉이고 데이타9.10이 연속 3봉이 음봉이고 데이타2,3,4 중에 음봉이 1개이상(단 데이타2,3,4 중에 3봉연속 양봉이 2개이상이면 안됨)이면</font></p> <p><font color="black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 그 이후에 7봉이내에 선물이 5이평보다 작으면 매도</font></p> <p><font color="black">&nbsp;&nbsp;(2) (현재 무포이거나 or 매수후 최고 수익이 진입가대비 1.1%이상이고) and 데이타8 이 연속 3봉이 양봉이고 데이타9.10이 3봉동안 음봉이 총</font><font color="black">4</font><font color="black">개이고</font></p> <p><font color="black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(단 데이타2,3,4 중에 3봉연속 양봉이 2개이상이면 안됨)&nbsp;and (데이타2,3,4,가 모두 음봉이거나 or 데이타2,3,4 중에서 3봉연속 음봉이 1개이상이면) </font></p> <p><font color="black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;그 이후에 7봉이내에 선물이 5이평보다 작으면 매도</font></p> <p><font color="black">2. 금일 3봉부터 31봉까지는 </font></p> <p>&nbsp;&nbsp;&nbsp;&nbsp; 매도후 현재 수익이 종가로 진입가 대비 0.85% 이상이고 현재 종가가 시초가*0.9955 보다 작고 (데이타8이 시초가보다 작다+ 데이타9가 시초가보다 크다+</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;데이타10 이 시초가보다 크다+ 데이타7이 시초가보다 크다+ 데이타11이 시초가보다 크다= 이렇게 5조건중에 2개이상 만족하면 ) 그 이후 10봉이내에 c가 5이평보다</p> <p>&nbsp;&nbsp;&nbsp;&nbsp; 크면 청산후 <font color="red">금일 모든매매종료</font></p> <p>&nbsp;</p> <p><BR><BR>input&nbsp;:&nbsp;하루이익1(3),하루이익2(4);<BR>var&nbsp;:&nbsp;PLR(0),XCommission(0,data1),XSlippage(0,data1),OpenPL(0,data1),dayPL(0,data1),count(0,data1),aa(0,data1);&nbsp;<BR>var&nbsp;:&nbsp;mav1(0,data1),mav2(0,data1),mav3(0,data1),mav4(0,data1),cond(false,data1);<BR><BR>#당일누적손익계산&nbsp;시작<BR>XCommission&nbsp;=&nbsp;((C*ExitCommission)/100)*CurrentContracts;&nbsp;#%설정<BR>XSlippage&nbsp;=&nbsp;(ExitSlippage)*CurrentContracts;&nbsp;#Pt설정<BR><BR>PLR&nbsp;=&nbsp;0;<BR>count&nbsp;=&nbsp;0;<BR>for&nbsp;aa&nbsp;=&nbsp;0&nbsp;to&nbsp;10{<BR>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;sdate&nbsp;==&nbsp;EntryDate(aa)&nbsp;Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;count&nbsp;=&nbsp;count+1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;aa&nbsp;>&nbsp;0&nbsp;and&nbsp;sdate&nbsp;==&nbsp;EntryDate(aa)&nbsp;Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PLR&nbsp;=&nbsp;PLR+PositionProfit(aa);<BR>}<BR><BR>if&nbsp;MarketPosition()&nbsp;==&nbsp;0&nbsp;Then{<BR>&nbsp;&nbsp;&nbsp;&nbsp;OpenPL&nbsp;=&nbsp;0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;dayPL&nbsp;=&nbsp;PLR;<BR>}<BR>Else{<BR>&nbsp;&nbsp;&nbsp;&nbsp;OpenPL&nbsp;=&nbsp;(PositionProfit-(XCommission+XSlippage));<BR>&nbsp;&nbsp;&nbsp;&nbsp;dayPL&nbsp;=&nbsp;PLR+OpenPL;<BR>}<BR><BR><BR>cond&nbsp;=&nbsp;ExitDate(1)&nbsp;==&nbsp;sdate&nbsp;and&nbsp;(IsExitName("BP1",1)&nbsp;or&nbsp;IsExitName("BP2",1)&nbsp;or&nbsp;IsExitName("SP1",1)&nbsp;or&nbsp;IsExitName("SP2",1));<BR><BR>mav1&nbsp;=&nbsp;data1(ma(c,5));<BR>mav2&nbsp;=&nbsp;data1(ma(c,10));<BR>mav3&nbsp;=&nbsp;data1(ma(c,20));<BR>mav4&nbsp;=&nbsp;data1(ma(c,60));<BR><BR><BR>if&nbsp;data1(dayindex+1&nbsp;>=&nbsp;1&nbsp;and&nbsp;dayindex+1&nbsp;<=&nbsp;30)&nbsp;&nbsp;and&nbsp;count&nbsp;<&nbsp;3&nbsp;and&nbsp;cond&nbsp;==&nbsp;false&nbsp;&nbsp;then{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;C&nbsp;<&nbsp;dayopen*1.004&nbsp;And&nbsp;C&nbsp;>&nbsp;max(mav1,mav2,mav3,mav4)&nbsp;Then{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;data2(iff(C>O&nbsp;or&nbsp;(C==O&nbsp;and&nbsp;C>=C[1]),1,0))+<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sell("s2_1");<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR><BR>If&nbsp;MarketPosition&nbsp;==&nbsp;1&nbsp;Then{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;data1(dayindex+1)&nbsp;>=&nbsp;40&nbsp;and&nbsp;C&nbsp;<&nbsp;mav2&nbsp;Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exitlong("bx4");<BR>}<BR><BR>If&nbsp;MarketPosition&nbsp;==&nbsp;-1&nbsp;Then{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;data1(dayindex+1)&nbsp;>=&nbsp;40&nbsp;and&nbsp;C&nbsp;>&nbsp;mav2&nbsp;Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ExitShort("sx4");<BR>}<BR><BR><BR>if&nbsp;MarketPosition&nbsp;==&nbsp;1&nbsp;Then{<BR>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;data1(dayindex+1&nbsp;<&nbsp;20)&nbsp;Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ExitLong("BP1",AtLimit,EntryPrice+((하루이익1)-(PLR)));<BR>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;data1(dayindex+1&nbsp;>=&nbsp;20)&nbsp;Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ExitLong("BP2",AtLimit,EntryPrice+((하루이익2)-(PLR)));<BR>}<BR><BR>if&nbsp;MarketPosition&nbsp;==&nbsp;-1&nbsp;Then{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;data1(dayindex+1&nbsp;<&nbsp;20)&nbsp;Then&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ExitShort("SP1",AtLimit,EntryPrice+(-(하루이익1)+(PLR)));<BR>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;data1(dayindex+1&nbsp;>=&nbsp;20)&nbsp;Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ExitShort("SP2",AtLimit,EntryPrice+(-(하루이익2)+(PLR)));<BR>}<BR></p> </body> </html>