커뮤니티

reverse(T조건화)

프로필 이미지
목마와숙녀
2024-08-01 10:37:34
866
글번호 180378
답변완료
아래는 buy,sell 리버스 수식을 buy진입수식을 T조건화한 후 sell 진입하는 것으로 바꾼 수식입니다. 즉, buy 조건 만족 후 sell 입니다. 그런데, 문제점이 있습니다. buy 조건과 sell 진입 건 모두 장시작 기준으로 봉계산을 하기 때문에 buy 조건을 먼저 만족하면 sell 진입도 계산하여 진입하므로 문제가 없으나, sell 진입 조건을 먼저 만족하면 문제가 발생합니다. sell 진입 조건 만족하면 대기하고 있다가 buy 조건이 만족하면 즉시 sell 진입을 합니다. 이렇게 진입하면 안되고 buy 조건 만족하면 그 때부터 sell 진입을 위한 계산을 해서 진입해야 합니다. 이문제를 해결하려면 sell 진입수식에 buy 조건을 만족한 후부터 봉계산을 한다는 내용을 추가해야 합니다. 수식 수정 부탁드립니다. 항상 고맙습니다. ********************************************************************************* input : up진입시간(084500),up진입제한시간(091200),uup(20),up눌림(2),up돌파(2); //Buy진입을 T조건화 input : dn진입시간(084500),dn진입제한시간(091200),ddn(20),dn눌림(8),dn돌파(0); //Sell진입 var : cnta(0,Data1),cntb(0,Data1); var : LL(0),EH(0),E1(0),H1(0),i1(0),S1(0),V1(0); var : Tcond(false); var : T(0); var : T1(0),entry(0); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if Bdate != Bdate[1] Then { cnta = 0; cntb = 0; } if Data1(Bdate != Bdate[1]) Then T = 0; if (sdate != sdate[1] and stime >= up진입시간) or (sdate == sdate[1] and stime >= up진입시간 and stime[1] < up진입시간) Then Tcond = true; if (sdate != sdate[1] and stime >= up진입제한시간) or (sdate == sdate[1] and stime >= up진입제한시간 and stime[1] < up진입제한시간) Then Tcond = false; if (sdate != sdate[1] and stime >= up진입시간) or (sdate == sdate[1] and stime >= up진입시간 and stime[1] < up진입시간) Then{ E1 = 0; LL = L; } if stime >= up진입시간 then{ if L < LL Then LL = L; if cnta < 1 Then{ if E1 == 0 and C >= LL+PriceScale*uup and C[1] < LL+PriceScale*uup Then{ E1 = 1; H1 = H; i1 = index; V1 = LL; //시작점 종가 } if E1 == 1 and index > i1 then{ if H > H1 Then H1 = H; #저가가 시작봉종가보다 클때만 눌림체크 if L >= V1 and L <= H1-PriceScale*up눌림 Then{ E1 = 2; i1 = index; S1 = H1; } } //시작점 종가보다 낮은 가격이 발생하면 초기화 if E1 >= 1 and L < V1 Then{ E1 = 0; LL = L; } if E1 == 2 and index > i1 and C >= S1+PriceScale*up돌파 and Tcond == true Then{ cnta = cnta+1; { T=1; //Buy진입을 T조건화 } } } } var : HH(0),E2(0),i2(0),S2(0),L1(0),V2(0); if (sdate != sdate[1] and stime >= dn진입시간) or (sdate == sdate[1] and stime >= dn진입시간 and stime[1] < dn진입시간) Then Tcond = true; if (sdate != sdate[1] and stime >= dn진입제한시간) or (sdate == sdate[1] and stime >= dn진입제한시간 and stime[1] < dn진입제한시간) Then Tcond = false; if (sdate != sdate[1] and stime >= dn진입시간) or (sdate == sdate[1] and stime >= dn진입시간 and stime[1] < dn진입시간) Then{ E2 = 0; HH = H; } if stime >= dn진입시간 then{ if H > HH Then HH = H; if cntb < 1 Then{ if E2 == 0 and C <= HH-PriceScale*ddn and C[1] < HH-PriceScale*ddn Then{ E2 = 1; L1 = L; i2 = index; V2 = HH; //시작점 종가 } if E2 == 1 and index > i2 then{ if L < L1 Then L1 = L; #고가가 시작봉종가보다 작을 때만 눌림체크 if H <= V2 and H >= L1+PriceScale*dn눌림 Then{ E2 = 2; i2 = index; S2 = L1; } } //시작점 종가보다 높은 가격이 발생하면 초기화 if E2 >= 1 and H > V2 Then{ E2 = 0; HH = H; } if T==1 and E2 == 2 and index > i2 and C <= S2-PriceScale*dn돌파 and Tcond == true Then{ cntb = cntb+1; { T=2; Sell("s"); } } } }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-06-10 10:30:21

안녕하세요 예스스탁입니다. input : up진입시간(084500),up진입제한시간(091200),uup(20),up눌림(2),up돌파(2); //Buy진입을 T조건화 input : dn진입시간(084500),dn진입제한시간(091200),ddn(20),dn눌림(8),dn돌파(0); //Sell진입 var : cnta(0,Data1),cntb(0,Data1); var : LL(0),EH(0),E1(0),H1(0),i1(0),S1(0),V1(0); var : Tcond(false); var : T(0); var : T1(0),entry(0); var : HH(0),E2(0),i2(0),S2(0),L1(0),V2(0); if Bdate != Bdate[1] Then { T1 = TotalTrades; cnta = 0; cntb = 0; T = 0; } if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if (sdate != sdate[1] and stime >= up진입시간) or (sdate == sdate[1] and stime >= up진입시간 and stime[1] < up진입시간) Then Tcond = true; if (sdate != sdate[1] and stime >= up진입제한시간) or (sdate == sdate[1] and stime >= up진입제한시간 and stime[1] < up진입제한시간) Then Tcond = false; if (sdate != sdate[1] and stime >= up진입시간) or (sdate == sdate[1] and stime >= up진입시간 and stime[1] < up진입시간) Then { E1 = 0; LL = L; } if stime >= up진입시간 and T == 0 then { if L < LL Then LL = L; if cnta < 1 Then { if E1 == 0 and C >= LL+PriceScale*uup and C[1] < LL+PriceScale*uup Then { E1 = 1; H1 = H; i1 = index; V1 = LL; //시작점 종가 } if E1 == 1 and index > i1 then { if H > H1 Then H1 = H; #저가가 시작봉종가보다 클때만 눌림체크 if L >= V1 and L <= H1-PriceScale*up눌림 Then { E1 = 2; i1 = index; S1 = H1; } } //시작점 종가보다 낮은 가격이 발생하면 초기화 if E1 >= 1 and L < V1 Then { E1 = 0; LL = L; } if E1 == 2 and index > i1 and C >= S1+PriceScale*up돌파 and Tcond == true Then { cnta = cnta+1; { T = 1; //Buy진입을 T조건화 E2 = 0; HH = H; } } } } if t == 1 then { if H > HH Then HH = H; if cntb < 1 Then { if E2 == 0 and C <= HH-PriceScale*ddn and C[1] < HH-PriceScale*ddn Then { E2 = 1; L1 = L; i2 = index; V2 = HH; //시작점 종가 } if E2 == 1 and index > i2 then { if L < L1 Then L1 = L; #고가가 시작봉종가보다 작을 때만 눌림체크 if H <= V2 and H >= L1+PriceScale*dn눌림 Then { E2 = 2; i2 = index; S2 = L1; } } //시작점 종가보다 높은 가격이 발생하면 초기화 if E2 >= 1 and H > V2 Then { E2 = 0; HH = H; } if T==1 and E2 == 2 and index > i2 and C <= S2-PriceScale*dn돌파 and Tcond == true Then { cntb = cntb+1; { T=2; Sell("s"); } } } } 즐거운 하루되세요 > 목마와숙녀 님이 쓴 글입니다. > 제목 : 문의 > 아래는 buy,sell 리버스 수식을 buy진입수식을 T조건화한 후 sell 진입하는 것으로 바꾼 수식입니다. 즉, buy 조건 만족 후 sell 입니다. 그런데, 문제점이 있습니다. buy 조건과 sell 진입 건 모두 장시작 기준으로 봉계산을 하기 때문에 buy 조건을 먼저 만족하면 sell 진입도 계산하여 진입하므로 문제가 없으나, sell 진입 조건을 먼저 만족하면 문제가 발생합니다. sell 진입 조건 만족하면 대기하고 있다가 buy 조건이 만족하면 즉시 sell 진입을 합니다. 이렇게 진입하면 안되고 buy 조건 만족하면 그 때부터 sell 진입을 위한 계산을 해서 진입해야 합니다. 이문제를 해결하려면 sell 진입수식에 buy 조건을 만족한 후부터 봉계산을 한다는 내용을 추가해야 합니다. 수식 수정 부탁드립니다. 항상 고맙습니다. ********************************************************************************* input : up진입시간(084500),up진입제한시간(091200),uup(20),up눌림(2),up돌파(2); //Buy진입을 T조건화 input : dn진입시간(084500),dn진입제한시간(091200),ddn(20),dn눌림(8),dn돌파(0); //Sell진입 var : cnta(0,Data1),cntb(0,Data1); var : LL(0),EH(0),E1(0),H1(0),i1(0),S1(0),V1(0); var : Tcond(false); var : T(0); var : T1(0),entry(0); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if Bdate != Bdate[1] Then { cnta = 0; cntb = 0; } if Data1(Bdate != Bdate[1]) Then T = 0; if (sdate != sdate[1] and stime >= up진입시간) or (sdate == sdate[1] and stime >= up진입시간 and stime[1] < up진입시간) Then Tcond = true; if (sdate != sdate[1] and stime >= up진입제한시간) or (sdate == sdate[1] and stime >= up진입제한시간 and stime[1] < up진입제한시간) Then Tcond = false; if (sdate != sdate[1] and stime >= up진입시간) or (sdate == sdate[1] and stime >= up진입시간 and stime[1] < up진입시간) Then{ E1 = 0; LL = L; } if stime >= up진입시간 then{ if L < LL Then LL = L; if cnta < 1 Then{ if E1 == 0 and C >= LL+PriceScale*uup and C[1] < LL+PriceScale*uup Then{ E1 = 1; H1 = H; i1 = index; V1 = LL; //시작점 종가 } if E1 == 1 and index > i1 then{ if H > H1 Then H1 = H; #저가가 시작봉종가보다 클때만 눌림체크 if L >= V1 and L <= H1-PriceScale*up눌림 Then{ E1 = 2; i1 = index; S1 = H1; } } //시작점 종가보다 낮은 가격이 발생하면 초기화 if E1 >= 1 and L < V1 Then{ E1 = 0; LL = L; } if E1 == 2 and index > i1 and C >= S1+PriceScale*up돌파 and Tcond == true Then{ cnta = cnta+1; { T=1; //Buy진입을 T조건화 } } } } var : HH(0),E2(0),i2(0),S2(0),L1(0),V2(0); if (sdate != sdate[1] and stime >= dn진입시간) or (sdate == sdate[1] and stime >= dn진입시간 and stime[1] < dn진입시간) Then Tcond = true; if (sdate != sdate[1] and stime >= dn진입제한시간) or (sdate == sdate[1] and stime >= dn진입제한시간 and stime[1] < dn진입제한시간) Then Tcond = false; if (sdate != sdate[1] and stime >= dn진입시간) or (sdate == sdate[1] and stime >= dn진입시간 and stime[1] < dn진입시간) Then{ E2 = 0; HH = H; } if stime >= dn진입시간 then{ if H > HH Then HH = H; if cntb < 1 Then{ if E2 == 0 and C <= HH-PriceScale*ddn and C[1] < HH-PriceScale*ddn Then{ E2 = 1; L1 = L; i2 = index; V2 = HH; //시작점 종가 } if E2 == 1 and index > i2 then{ if L < L1 Then L1 = L; #고가가 시작봉종가보다 작을 때만 눌림체크 if H <= V2 and H >= L1+PriceScale*dn눌림 Then{ E2 = 2; i2 = index; S2 = L1; } } //시작점 종가보다 높은 가격이 발생하면 초기화 if E2 >= 1 and H > V2 Then{ E2 = 0; HH = H; } if T==1 and E2 == 2 and index > i2 and C <= S2-PriceScale*dn돌파 and Tcond == true Then{ cntb = cntb+1; { T=2; Sell("s"); } } } }