커뮤니티

추가 요청3

프로필 이미지
손추
2021-06-29 09:36:16
1243
글번호 150380
답변완료
안녕하세요? 문의에 매번 답변 주심에 항상 감사드립니다. 아래 로직에서 진입후 만약 수익이 났다가 익절 되지 않고 다시 되돌림이 와서 진입가에 도달하면 본절하는 조건을 추가할수 있는지요? --------------- input : P1(5),P2(20); input : sto1(10),sto2(5),sto3(5); var : stok(0),stod(0); var : mav1(0),mav2(0),T(0); stok = stochasticsK(sto1,sto2); stod = stochasticsD(sto1,sto2,sto3); mav1 = ma(C,P1); mav2 = ma(C,P2); if CrossUp(mav1,mav2) Then T = 1; if CrossDown(mav1,mav2) Then T = -1; if T == 1 and CrossUp(stok,stod) Then { T = 2; Buy("b"); } if T == -1 and CrossDown(stok,stod) Then { T = -2; Sell("s"); } SetStopProfittarget(1.3,PointStop); SetStopLoss(0.8,PointStop); var : month(0),nday(0),week(0); month = int(date/100)-int(date/10000)*100; nday = date - int(date/100)*100; Week = DayOfWeek(date); if (month%3 == 0 and nday >= 8 and nday <= 14 and week == 4) then SetStopEndofday(151500); Else SetStopEndofday(153000);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-06-29 11:12:07

안녕하세요 예스스탁입니다. 지정한 최소수익이상 수익 후에 진입가에 돌아오면 청산하게 작성해 드립니다. input : P1(5),P2(20); input : sto1(10),sto2(5),sto3(5); input : 익절(1.3),손절(0.8),최소수익(0.5); var : stok(0),stod(0); var : mav1(0),mav2(0),T(0); stok = stochasticsK(sto1,sto2); stod = stochasticsD(sto1,sto2,sto3); mav1 = ma(C,P1); mav2 = ma(C,P2); if CrossUp(mav1,mav2) Then T = 1; if CrossDown(mav1,mav2) Then T = -1; if T == 1 and CrossUp(stok,stod) Then { T = 2; Buy("b"); } if T == -1 and CrossDown(stok,stod) Then { T = -2; Sell("s"); } SetStopProfittarget(익절,PointStop); SetStopLoss(손절,PointStop); if MarketPosition == 1 and Highest(h,BarsSinceEntry) >= EntryPrice+최소수익 Then ExitLong("bx",AtStop,EntryPrice); if MarketPosition == -1 and Lowest(L,BarsSinceEntry) <= EntryPrice-최소수익 Then ExitShort("sx",AtStop,EntryPrice); var : month(0),nday(0),week(0); month = int(date/100)-int(date/10000)*100; nday = date - int(date/100)*100; Week = DayOfWeek(date); if (month%3 == 0 and nday >= 8 and nday <= 14 and week == 4) then SetStopEndofday(151500); Else SetStopEndofday(153000); 즐거운 하루되세요 > 손추 님이 쓴 글입니다. > 제목 : 추가 요청3 > 안녕하세요? 문의에 매번 답변 주심에 항상 감사드립니다. 아래 로직에서 진입후 만약 수익이 났다가 익절 되지 않고 다시 되돌림이 와서 진입가에 도달하면 본절하는 조건을 추가할수 있는지요? --------------- input : P1(5),P2(20); input : sto1(10),sto2(5),sto3(5); var : stok(0),stod(0); var : mav1(0),mav2(0),T(0); stok = stochasticsK(sto1,sto2); stod = stochasticsD(sto1,sto2,sto3); mav1 = ma(C,P1); mav2 = ma(C,P2); if CrossUp(mav1,mav2) Then T = 1; if CrossDown(mav1,mav2) Then T = -1; if T == 1 and CrossUp(stok,stod) Then { T = 2; Buy("b"); } if T == -1 and CrossDown(stok,stod) Then { T = -2; Sell("s"); } SetStopProfittarget(1.3,PointStop); SetStopLoss(0.8,PointStop); var : month(0),nday(0),week(0); month = int(date/100)-int(date/10000)*100; nday = date - int(date/100)*100; Week = DayOfWeek(date); if (month%3 == 0 and nday >= 8 and nday <= 14 and week == 4) then SetStopEndofday(151500); Else SetStopEndofday(153000);