커뮤니티

문의

프로필 이미지
목마와숙녀
2021-03-04 13:36:34
816
글번호 146782
답변완료
첫번째 진입 b1 이 bx1 이나 강제손절,익절,트레일링으로 청산된 이후 b2 진입 프로세스를 진행하는 것이 아니라 b1 -> bx1으로 청산되었다면 60 봉이 지난 후부터 b1 -> 강제손절로 청산되었다면 50 봉이 지난 후부터 b1 -> 강제익절로 청산되었다면 40 봉이 지난 후부터 b1 -> 강제트레일링으로 청산되었다면 30 봉이 지난 후부터 b2 진입 프로세스를 진행하는 수식을 추가해주십시요. b1 청산 종류별로 일정 term을 가진 후 진입하자는 취지입니다. ************************************************************************************ input : b1(45),b2(380),X1(200),X2(100); input : stop(300),limit(1000),trail(500); var : T1(0,data1),entry(0,data1),LL(0,data2),EH(0,data2),C2(0,data1); C2 = data2(C); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 and data2(C >= lowD(0)+PriceScale*B1 and C[1] < lowD(0)+PriceScale*B1) Then buy("b1"); if MarketPosition == 1 Then{ if CurrentContracts > CurrentContracts[1] Then EH = data2(H); if data2(H) > EH Then EH = data2(H); if entry == 1 and data2(C <= EH-PriceScale*X1) Then exitlong("bx1"); } if TotalTrades > TotalTrades[1] Then LL = data2(L); if data2(L) < LL Then LL = data2(L); if MarketPosition == 0 and entry == 1 and data2(C >= LL+PriceScale*B2 and C[1] < LL+PriceScale*B2) Then buy("b2"); if MarketPosition== 1 and entry == 2 and data2(L) <= C2[BarsSinceEntry]-data2(PriceScale*X2) Then exitlong("bx2"); SetStopLoss(stop,PointStop); SetStopProfittarget(limit,PointStop); SetStopTrailing(trail,0,PointStop);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-03-04 14:15:29

안녕하세요 예스스탁입니다. input : b1(45),b2(380),X1(200),X2(100); input : stop(300),limit(1000),trail(500); var : T1(0,data1),entry(0,data1),LL(0,data2),EH(0,data2),C2(0,data1); C2 = data2(C); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 and data2(C >= lowD(0)+PriceScale*B1 and C[1] < lowD(0)+PriceScale*B1) Then buy("b1"); if MarketPosition == 1 Then{ if CurrentContracts > CurrentContracts[1] Then EH = data2(H); if data2(H) > EH Then EH = data2(H); if entry == 1 and data2(C <= EH-PriceScale*X1) Then exitlong("bx1"); } if TotalTrades > TotalTrades[1] Then LL = data2(L); if data2(L) < LL Then LL = data2(L); if MarketPosition == 0 and entry == 1 and ((IsExitName("bx1",1) == true and BarsSinceExit(1) >= 60) or (IsExitName("StopLoss",1) == true and BarsSinceExit(1) >= 50) or (IsExitName("StopProfitTarget",1) == true and BarsSinceExit(1) >= 40) or (IsExitName("StopTrailing",1) == true and BarsSinceExit(1) >= 30)) and data2(C >= LL+PriceScale*B2 and C[1] < LL+PriceScale*B2) Then buy("b2"); if MarketPosition== 1 and entry == 2 and data2(L) <= C2[BarsSinceEntry]-data2(PriceScale*X2) Then exitlong("bx2"); SetStopLoss(stop,PointStop); SetStopProfittarget(limit,PointStop); SetStopTrailing(trail,0,PointStop); 즐거운 하루되세요 > 목마와숙녀 님이 쓴 글입니다. > 제목 : 문의 > 첫번째 진입 b1 이 bx1 이나 강제손절,익절,트레일링으로 청산된 이후 b2 진입 프로세스를 진행하는 것이 아니라 b1 -> bx1으로 청산되었다면 60 봉이 지난 후부터 b1 -> 강제손절로 청산되었다면 50 봉이 지난 후부터 b1 -> 강제익절로 청산되었다면 40 봉이 지난 후부터 b1 -> 강제트레일링으로 청산되었다면 30 봉이 지난 후부터 b2 진입 프로세스를 진행하는 수식을 추가해주십시요. b1 청산 종류별로 일정 term을 가진 후 진입하자는 취지입니다. ************************************************************************************ input : b1(45),b2(380),X1(200),X2(100); input : stop(300),limit(1000),trail(500); var : T1(0,data1),entry(0,data1),LL(0,data2),EH(0,data2),C2(0,data1); C2 = data2(C); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 and data2(C >= lowD(0)+PriceScale*B1 and C[1] < lowD(0)+PriceScale*B1) Then buy("b1"); if MarketPosition == 1 Then{ if CurrentContracts > CurrentContracts[1] Then EH = data2(H); if data2(H) > EH Then EH = data2(H); if entry == 1 and data2(C <= EH-PriceScale*X1) Then exitlong("bx1"); } if TotalTrades > TotalTrades[1] Then LL = data2(L); if data2(L) < LL Then LL = data2(L); if MarketPosition == 0 and entry == 1 and data2(C >= LL+PriceScale*B2 and C[1] < LL+PriceScale*B2) Then buy("b2"); if MarketPosition== 1 and entry == 2 and data2(L) <= C2[BarsSinceEntry]-data2(PriceScale*X2) Then exitlong("bx2"); SetStopLoss(stop,PointStop); SetStopProfittarget(limit,PointStop); SetStopTrailing(trail,0,PointStop);