커뮤니티

손절시에만 재진입 수식 부탁드립니다

프로필 이미지
샐리짱
2021-12-15 21:01:02
528
글번호 154523
답변완료
안녕하세요. 항상 수고가 많으십니다. 질문드립니다 ----------------------------------------------------------------------- input : stopper1(1.0); input : stopper2(1.0); var1 = ma(c, 20); if dayindex > 0 and stime < 152000 then { if stime < 093000 then { if var1 > var1[1] then { buy("b1"); } } if stime >= 100000 then { if 이전에 손절 and var1 > var1[1] then { buy("b2"); } } } if IsEntryName("b1") == true Then SetStopLoss(stopper1, PointStop); if IsEntryName("b2") == true Then SetStopLoss(stopper2, PointStop); if IsEntryName("b1") == true and (stime == 151900 or CrossUp(stime, 151900)) Then { exitlong("b1청산"); } if IsEntryName("b2") == true and (stime == 151900 or CrossUp(stime, 151900)) Then { exitlong("b2청산"); } ------------------------------------------------------------------------------------ 위 전략식은 진입시간을 따로 분리하여 9시 30분 이전에 조건 만족하면 진입하여, 손절이 발생하지 않으면 15시 19분에 청산하고 9시 30분 이전에 진입하여 10시 이전에 손절 발생하면, 10시 이후에는 손절됐을 경우에만 재진입하려는 의도로 작성된 식입니다. "이전에 손절"을 수식으로 부탁드립니다. 감사합니다. 항상 좋은 일만 생기시길를 ~~
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-12-16 10:07:59

안녕하세요 예스스탁입니다. input : stopper1(1.0); input : stopper2(1.0); var : LossCond(False); var1 = ma(c, 20); #영업일 변경시 false if Bdate != Bdate[1] Then LossCond = False; #청산발생하고 #진입이 9시30분 전이고 #청산이 10시 전에 손절매된 거래이면 #true if TotalTrades > TotalTrades[1] and EntryTime(1) < 93000 and ExitTime(1) < 100000 and IsExitName("StopLoss",1) == true Then LossCond = true; if dayindex > 0 and stime < 152000 then { if stime < 093000 then { if var1 > var1[1] then { buy("b1"); } } if stime >= 100000 then { if LossCond == true and var1 > var1[1] then { buy("b2"); } } } if IsEntryName("b1") == true Then SetStopLoss(stopper1, PointStop); if IsEntryName("b2") == true Then SetStopLoss(stopper2, PointStop); if IsEntryName("b1") == true and (stime == 151900 or CrossUp(stime, 151900)) Then { exitlong("b1청산"); } if IsEntryName("b2") == true and (stime == 151900 or CrossUp(stime, 151900)) Then { exitlong("b2청산"); } 즐거운 하루되세요 > 샐리짱 님이 쓴 글입니다. > 제목 : 손절시에만 재진입 수식 부탁드립니다 > 안녕하세요. 항상 수고가 많으십니다. 질문드립니다 ----------------------------------------------------------------------- input : stopper1(1.0); input : stopper2(1.0); var1 = ma(c, 20); if dayindex > 0 and stime < 152000 then { if stime < 093000 then { if var1 > var1[1] then { buy("b1"); } } if stime >= 100000 then { if 이전에 손절 and var1 > var1[1] then { buy("b2"); } } } if IsEntryName("b1") == true Then SetStopLoss(stopper1, PointStop); if IsEntryName("b2") == true Then SetStopLoss(stopper2, PointStop); if IsEntryName("b1") == true and (stime == 151900 or CrossUp(stime, 151900)) Then { exitlong("b1청산"); } if IsEntryName("b2") == true and (stime == 151900 or CrossUp(stime, 151900)) Then { exitlong("b2청산"); } ------------------------------------------------------------------------------------ 위 전략식은 진입시간을 따로 분리하여 9시 30분 이전에 조건 만족하면 진입하여, 손절이 발생하지 않으면 15시 19분에 청산하고 9시 30분 이전에 진입하여 10시 이전에 손절 발생하면, 10시 이후에는 손절됐을 경우에만 재진입하려는 의도로 작성된 식입니다. "이전에 손절"을 수식으로 부탁드립니다. 감사합니다. 항상 좋은 일만 생기시길를 ~~