커뮤니티

각 전략식에 따른 손절시 재진입

프로필 이미지
샐리짱
2021-12-17 16:54:50
579
글번호 154614
답변완료
안녕하세요. 항상 수고가 많으십니다. 질문드립니다 ----------------------------------------------------------------------- input : stopper1(1.0); input : stopper2(1.0); if dayindex > 0 and stime < 152000 then { if 매수1 진입식 then { buy("b1"); } if 매도1 진입식 then { sell("s1"); } if 매수2 진입식 then { buy("b2"); } if 매도2 진입식 then { sell("s2"); } if 매수1 진입식에서 손절 and 매수1진입식 then { buy("rb1"); } if 매도1 진입식에서 손절 and 매도1진입식 then { sell("rs1"); } if 매수2 진입식에서 손절 and 매수2진입식 then { buy("rb2"); } if 매도2 진입식에서 손절 and 매도2진입식 then { sell("rs2"); } } if IsEntryName("b1") == true Then SetStopLoss(stopper1, PointStop); if IsEntryName("s1") == true Then SetStopLoss(stopper2, PointStop); if IsEntryName("b2") == true Then SetStopLoss(stopper1, PointStop); if IsEntryName("s2") == true Then SetStopLoss(stopper2, PointStop); if IsEntryName("b1") == true and (stime == 151900 or CrossUp(stime, 151900)) Then { exitlong("b1청산"); } if IsEntryName("s1") == true and (stime == 151900 or CrossUp(stime, 151900)) Then { exitshort("s1청산"); } if IsEntryName("b2") == true and (stime == 151900 or CrossUp(stime, 151900)) Then { exitlong("b2청산"); } if IsEntryName("s2") == true and (stime == 151900 or CrossUp(stime, 151900)) Then { exitshort("s2청산"); } ------------------------------------------------------------------------------------ 위 전략식은 서로 다른 전략식에서 각 전략에 따른 손절이 발생시, 같은 전략식으로 다시 재진입 하려는 의도로 작성된 식입니다. 물론, 손절이 발생하지 않으면 15시 19분에 청산합니다 각각의 진입식을 구분하여 그에 따른 전략식으로 재진입하려 합니다. 도움 부탁드립니다. 감사합니다. 항상 좋은 일만 많이 생기시길를 ~~
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-12-20 11:06:35

안녕하세요 예스스탁입니다. input : stopper1(1.0); input : stopper2(1.0); if dayindex > 0 and stime < 152000 then { if 매수1 진입식 then { buy("b1"); } if 매도1 진입식 then { sell("s1"); } if 매수2 진입식 then { buy("b2"); } if 매도2 진입식 then { sell("s2"); } if MarketPosition == 0 and ExitDate(1) == sDate and IsEntryName("b1",1) == true and IsExitName("StopLoss",1) == true and 매수1 진입식 then { buy("rb1"); } ifMarketPosition == 0 and ExitDate(1) == sDate and IsEntryName("s1",1) == true and IsExitName("StopLoss",1) == true and 매도1 진입식 then { sell("rs1"); } if MarketPosition == 0 and ExitDate(1) == sDate and IsEntryName("b2",1) == true and IsExitName("StopLoss",1) == true and 매수2 진입식 then { buy("rb2"); } if MarketPosition == 0 and ExitDate(1) == sDate and IsEntryName("s2",1) == true and IsExitName("StopLoss",1) == true and 매도2 진입식 then { sell("rs2"); } } if IsEntryName("b1") == true Then SetStopLoss(stopper1, PointStop); if IsEntryName("s1") == true Then SetStopLoss(stopper2, PointStop); if IsEntryName("b2") == true Then SetStopLoss(stopper1, PointStop); if IsEntryName("s2") == true Then SetStopLoss(stopper2, PointStop); if IsEntryName("b1") == true and (stime == 151900 or CrossUp(stime, 151900)) Then { exitlong("b1청산"); } if IsEntryName("s1") == true and (stime == 151900 or CrossUp(stime, 151900)) Then { exitshort("s1청산"); } if IsEntryName("b2") == true and (stime == 151900 or CrossUp(stime, 151900)) Then { exitlong("b2청산"); } if IsEntryName("s2") == true and (stime == 151900 or CrossUp(stime, 151900)) Then { exitshort("s2청산"); } 즐거운 하루되세요 > 샐리짱 님이 쓴 글입니다. > 제목 : 각 전략식에 따른 손절시 재진입 > 안녕하세요. 항상 수고가 많으십니다. 질문드립니다 ----------------------------------------------------------------------- input : stopper1(1.0); input : stopper2(1.0); if dayindex > 0 and stime < 152000 then { if 매수1 진입식 then { buy("b1"); } if 매도1 진입식 then { sell("s1"); } if 매수2 진입식 then { buy("b2"); } if 매도2 진입식 then { sell("s2"); } if 매수1 진입식에서 손절 and 매수1진입식 then { buy("rb1"); } if 매도1 진입식에서 손절 and 매도1진입식 then { sell("rs1"); } if 매수2 진입식에서 손절 and 매수2진입식 then { buy("rb2"); } if 매도2 진입식에서 손절 and 매도2진입식 then { sell("rs2"); } } if IsEntryName("b1") == true Then SetStopLoss(stopper1, PointStop); if IsEntryName("s1") == true Then SetStopLoss(stopper2, PointStop); if IsEntryName("b2") == true Then SetStopLoss(stopper1, PointStop); if IsEntryName("s2") == true Then SetStopLoss(stopper2, PointStop); if IsEntryName("b1") == true and (stime == 151900 or CrossUp(stime, 151900)) Then { exitlong("b1청산"); } if IsEntryName("s1") == true and (stime == 151900 or CrossUp(stime, 151900)) Then { exitshort("s1청산"); } if IsEntryName("b2") == true and (stime == 151900 or CrossUp(stime, 151900)) Then { exitlong("b2청산"); } if IsEntryName("s2") == true and (stime == 151900 or CrossUp(stime, 151900)) Then { exitshort("s2청산"); } ------------------------------------------------------------------------------------ 위 전략식은 서로 다른 전략식에서 각 전략에 따른 손절이 발생시, 같은 전략식으로 다시 재진입 하려는 의도로 작성된 식입니다. 물론, 손절이 발생하지 않으면 15시 19분에 청산합니다 각각의 진입식을 구분하여 그에 따른 전략식으로 재진입하려 합니다. 도움 부탁드립니다. 감사합니다. 항상 좋은 일만 많이 생기시길를 ~~