커뮤니티

문의

프로필 이미지
목마와숙녀
2025-10-31 14:29:40
105
글번호 227548
답변완료

데이트레이딩 084500부터 154500까지 거래
아래 수식은 거래횟수 20회까지 허용, 누적패수 3회면 거래중지 수식입니다. 연속으로 2패할 경우, "거래횟수" 20회를 3회로 변동하는 수식을 요청드립니다.

어제 요청드리고 답변 받은 내용은 거래횟수 20회까지 허용, 누적패수 5회면 거래중지 수식이었고 연속으로 3패할 경우 , "누적패수" 5회를 4회로 조정하는 수식을 요청드린 바 있습니다. 위 내용은 "거래횟수" 조정입니다. 어제 것과 다르므로 참고하시라고 적었습니다.
항상 고맙습니다.
************************************************************************************************************************************************
input : 진입시간(084700),진입제한시간(125000); input : 거래횟수(20),누적패수(3); input : b1(54),진입눌림1(6),진입돌파1(4); input : b2(142),진입눌림2(6),진입돌파2(4); input : als(42),atr1(0),atr2(112); input : bls(70),btr1(0),btr2(132); var : T1(0),entry(0),HH(0),LL(0),EH(0),EL(0),E1(0),H1(0),i1(0),S1(0),L1(0),V1(0); var : Tcond(false); Var : loss(0); if bdate != bdate[1] Then loss = 0; if TotalTrades > TotalTrades[1] and PositionProfit(1) < 0 Then loss = loss+1; if (sdate != sdate[1] and stime >= 진입시간) or (sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then Tcond = true; if (sdate != sdate[1] and stime >= 진입제한시간) or (sdate == sdate[1] and stime >= 진입제한시간 and stime[1] < 진입제한시간) Then Tcond = false; if (sdate != sdate[1] and stime >= 진입시간) or (sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then{ T1 = TotalTrades; E1 = 0; HH = H; } if stime >= 진입시간 then{ if H > HH Then HH = H; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 Then{ if E1 == 0 and C <= HH-PriceScale*B1 Then{ E1 = 1; L1 = L; i1 = index; V1 = HH; //시작점 종가 } if E1 == 1 and index > i1 then{ if L < L1 Then L1 = L; #고가가 시작봉종가보다 작을 때만 눌림체크 if H <= V1 and H >= L1+PriceScale*진입눌림1 Then{ E1 = 2; i1 = index; S1 = L1; } } //시작점 종가보다 높은 가격이 발생하면 초기화 if E1 >= 1 and H > V1 Then{ E1 = 0; HH = H; } if loss < 누적패수 and E1 == 2 and index > i1 and C <= S1-PriceScale*진입돌파1 and Tcond == true Then{ sell("s1"); } } if TotalTrades > TotalTrades[1] Then{ E1 = 0; HH = H; } if H > HH Then HH = H; if MarketPosition == 0 and entry >= 1 and entry < 거래횟수 Then{ if E1 == 0 and C <= HH-PriceScale*B2 Then{ E1 = 1; L1 = L; i1 = index; } if E1 == 1 and index > i1 then{ if L < L1 Then L1 = L; if H >= L1+PriceScale*진입눌림2 Then{ E1 = 2; i1 = index; S1 = L1; } } if loss < 누적패수 and E1 == 2 and index > i1 and C <= S1-PriceScale*진입돌파2 and Tcond == true Then{ sell("s2"); E1 = 0; } } } if MarketPosition== -1 Then { if IsEntryName("s1") == true Then { SetStopLoss(PriceScale*als,PointStop); SetStopTrailing(PriceScale*atr2,PriceScale*atr1,PointStop,1); } Else if IsEntryName("s2") == true Then { SetStopLoss(PriceScale*bls,PointStop); SetStopTrailing(PriceScale*btr2,PriceScale*btr1,PointStop,1); } Else { SetStopLoss(0); SetStopTrailing(0,0); } }

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

예스스탁 예스스탁 답변

2025-10-31 18:06:15

안녕하세요 예스스탁입니다. input : 진입시간(084700),진입제한시간(125000); input : 거래횟수(20),누적패수(3),연속손실(2),연속손실후거래횟수(3); input : b1(54),진입눌림1(6),진입돌파1(4); input : b2(142),진입눌림2(6),진입돌파2(4); input : als(42),atr1(0),atr2(112); input : bls(70),btr1(0),btr2(132); var : T1(0),entry(0),HH(0),LL(0),EH(0),EL(0),E1(0),H1(0),i1(0),S1(0),L1(0),V1(0); var : Tcond(false); Var : loss(0),consecloss(0),진입횟수(0); //영업일 변경시 if bdate != bdate[1] Then { //손실횟수 초기화 0 loss = 0; //연속손실횟수 초기화 0 consecloss = 0; //진입횟수는 거래횟수 진입횟수 = 거래횟수; } //청산발생 if TotalTrades > TotalTrades[1] Then { //손실 if PositionProfit(1) < 0 Then { //손실횟수 1증가 loss = loss+1; //연속손실횟수 1증가 consecloss = consecloss+1; if consecloss == 연속손실 Then 진입횟수 = 연속손실후거래횟수; } Else //손실이 아니면 consecloss = 0; //연속손실횟수 0으로 초기화 } if (sdate != sdate[1] and stime >= 진입시간) or (sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then Tcond = true; if (sdate != sdate[1] and stime >= 진입제한시간) or (sdate == sdate[1] and stime >= 진입제한시간 and stime[1] < 진입제한시간) Then Tcond = false; if (sdate != sdate[1] and stime >= 진입시간) or (sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then{ T1 = TotalTrades; E1 = 0; HH = H; } if stime >= 진입시간 then { if H > HH Then HH = H; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 Then { if E1 == 0 and C <= HH-PriceScale*B1 Then { E1 = 1; L1 = L; i1 = index; V1 = HH; //시작점 종가 } if E1 == 1 and index > i1 then { if L < L1 Then L1 = L; #고가가 시작봉종가보다 작을 때만 눌림체크 if H <= V1 and H >= L1+PriceScale*진입눌림1 Then { E1 = 2; i1 = index; S1 = L1; } } //시작점 종가보다 높은 가격이 발생하면 초기화 if E1 >= 1 and H > V1 Then { E1 = 0; HH = H; } if loss < 누적패수 and E1 == 2 and index > i1 and C <= S1-PriceScale*진입돌파1 and Tcond == true Then { sell("s1"); } } if TotalTrades > TotalTrades[1] Then { E1 = 0; HH = H; } if H > HH Then HH = H; if MarketPosition == 0 and entry >= 1 and entry < 진입횟수 Then { if E1 == 0 and C <= HH-PriceScale*B2 Then { E1 = 1; L1 = L; i1 = index; } if E1 == 1 and index > i1 then { if L < L1 Then L1 = L; if H >= L1+PriceScale*진입눌림2 Then { E1 = 2; i1 = index; S1 = L1; } } if loss < 누적패수 and E1 == 2 and index > i1 and C <= S1-PriceScale*진입돌파2 and Tcond == true Then { sell("s2"); E1 = 0; } } } if MarketPosition== -1 Then { if IsEntryName("s1") == true Then { SetStopLoss(PriceScale*als,PointStop); SetStopTrailing(PriceScale*atr2,PriceScale*atr1,PointStop,1); } Else if IsEntryName("s2") == true Then { SetStopLoss(PriceScale*bls,PointStop); SetStopTrailing(PriceScale*btr2,PriceScale*btr1,PointStop,1); } Else { SetStopLoss(0); SetStopTrailing(0,0); } } 즐거운 하루되세요