커뮤니티

청산 설정 체크 부탁드릴께요~~

프로필 이미지
이형지
2020-03-17 13:45:29
253
글번호 136948
답변완료

첨부 이미지

매수 진입후 다음봉에 손절 금액도달시 즉시 청산하는 기능도 부여 부탁해요.. 해당 수식에 atstop이나 atlimit 로 구현가능할까요?? 이유는 onclose 와 atstop / atlimit의 청산 조건(시장가,현재가등)을 다르게 설정하려구요 if MarketPosition == 1 then { BuySetup = false; if countif(CrossDown(CCIv,CCI값),BarsSinceEntry) >= 1 and CCIv < CCI값 and C < O Then ExitLong("매수cci청산",OnClose); if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*즉시익절1 and C < O Then ExitLong("즉시익절1",OnClose); if highest(H,BarsSinceEntry) >= (EntryPrice+PriceScale*즉시익절1*N2) Then ExitLong("본전청산1",AtStop,EntryPrice+PriceScale*즉시익절1*N3); Else ExitLong("즉시손절1",AtStop,EntryPrice-PriceScale*즉시손절1); if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*tr수익 Then ExitLong("tr",AtStop, highest(H,BarsSinceEntry)-PriceScale*tr하락); if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*즉시손절1*N4 and C < O Then ExitLong("저점에서 올라와서 본전 청산",atlimit,EntryPrice+PriceScale*본전생각틱); if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*즉시손절1 *N5 and CCIv >= CCI값1 and C < O Then ExitLong("저점에서 올라와서 약손절",OnClose); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2020-03-17 16:42:07

안녕하세요 예스스탁입니다. 현재 청산식에 atstop이나 atlimit으로 구현가능한 내용은 이미 되어 있는 상태입니다. 다만 진입이 onclose이고 진입이후에 한개봉이 완성이 되어야 포지션등이 인식되고 각 값이 셋팅이 되어 진입봉 다음봉에서 청산이 발생하지 않습니다. 해당 부분은 아래의 즉시손절2와 같이 진입신호와 함께 청산이 설정되는 내용을 추가하셔야 합니다. 다른 청산신호는 진입이후 if문으로 체크해야 하는 내용들이 있어 진입과 동시셋팅되게 가능하지 않아 즉시손절만 추가해 드립니다. if MarketPosition <= 0 Then { ExitLong("즉시손절2",AtStop,EntryPrice-PriceScale*즉시손절1); } if MarketPosition == 1 then { BuySetup = false; if countif(CrossDown(CCIv,CCI값),BarsSinceEntry) >= 1 and CCIv < CCI값 and C < O Then ExitLong("매수cci청산",OnClose); if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*즉시익절1 and C < O Then ExitLong("즉시익절1",OnClose); if highest(H,BarsSinceEntry) >= (EntryPrice+PriceScale*즉시익절1*N2) Then ExitLong("본전청산1",AtStop,EntryPrice+PriceScale*즉시익절1*N3); Else ExitLong("즉시손절1",AtStop,EntryPrice-PriceScale*즉시손절1); if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*tr수익 Then ExitLong("tr",AtStop, highest(H,BarsSinceEntry)-PriceScale*tr하락); if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*즉시손절1*N4 and C < O Then ExitLong("저점에서 올라와서 본전 청산",atlimit,EntryPrice+PriceScale*본전생각틱); if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*즉시손절1 *N5 and CCIv >= CCI값1 and C < O Then ExitLong("저점에서 올라와서 약손절",OnClose); } 즐거운 하루되세요 > 이형지 님이 쓴 글입니다. > 제목 : 청산 설정 체크 부탁드릴께요~~ > 매수 진입후 다음봉에 손절 금액도달시 즉시 청산하는 기능도 부여 부탁해요.. 해당 수식에 atstop이나 atlimit 로 구현가능할까요?? 이유는 onclose 와 atstop / atlimit의 청산 조건(시장가,현재가등)을 다르게 설정하려구요 if MarketPosition == 1 then { BuySetup = false; if countif(CrossDown(CCIv,CCI값),BarsSinceEntry) >= 1 and CCIv < CCI값 and C < O Then ExitLong("매수cci청산",OnClose); if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*즉시익절1 and C < O Then ExitLong("즉시익절1",OnClose); if highest(H,BarsSinceEntry) >= (EntryPrice+PriceScale*즉시익절1*N2) Then ExitLong("본전청산1",AtStop,EntryPrice+PriceScale*즉시익절1*N3); Else ExitLong("즉시손절1",AtStop,EntryPrice-PriceScale*즉시손절1); if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*tr수익 Then ExitLong("tr",AtStop, highest(H,BarsSinceEntry)-PriceScale*tr하락); if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*즉시손절1*N4 and C < O Then ExitLong("저점에서 올라와서 본전 청산",atlimit,EntryPrice+PriceScale*본전생각틱); if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*즉시손절1 *N5 and CCIv >= CCI값1 and C < O Then ExitLong("저점에서 올라와서 약손절",OnClose); }