커뮤니티

수식 부탁드립니다.

프로필 이미지
stockric
2016-08-16 00:21:07
137
글번호 101017
답변완료
해외선물 수식입니다. price channel지표인데요. INPUT : LENGTH(30); VAR : TCHAN(0), BCHAN(0); TCHAN = HIGHEST(HIGH, LENGTH)[1]; BCHAN = LOWEST(LOW, LENGTH)[1]; PLOT1(TCHAN, "TOP"); PLOT2(BCHAN, "BOT"); 에서 위 상단밴드를 돌파했을때 매수합니다. 10틱 수익시 청산하고 5틱하락시 손절합니다. 10틱에 도달하지못하고 하락시 7틱에서 이익보존하여 청산합니다. 만약 10틱이상 초과상승시 20틱에 청산하는 기능이 있다면 첨가부탁드립니다. 하단밴드를 돌파했을때 매도합니다. 10틱 수익시 청산하고 5틱하락시 손절합니다. 10틱에 도달하지못하고 하락시 7틱에서 이익보존하여 청산합니다. 만약 10틱이상 초과상승시 20틱에 청산하는 기능이 있다면 첨가부탁드립니다. 한 선물에 중복진입은 없어야 합니다.
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2016-08-16 16:54:41

안녕하세요? 예스스탁입니다. 문의하신 내용 답변드립니다. INPUT : LENGTH(30); VAR : TCHAN(0), BCHAN(0); TCHAN = HIGHEST(HIGH, LENGTH)[1]; BCHAN = LOWEST(LOW, LENGTH)[1]; # 진입 if CrossUp(C, Tchan) Then buy(); if CrossDown(C, Bchan) Then sell(); # 목표청산/손절 if MarketPosition == 1 Then { exitlong("EL", atlimit, entryPrice+PriceScale*10); exitlong("EL2", atstop, entryPrice-PriceScale*5); } if MarketPosition == -1 Then { exitshort("ES", atlimit, entryPrice-PriceScale*10); exitshort("ES2", atstop, entryPrice+PriceScale*5); } #추적청산 if MarketPosition == 1 and highest(H,BarsSinceEntry) > EntryPrice+PriceScale*7 and highest(H,BarsSinceEntry) < EntryPrice+PriceScale*10 Then exitlong("EL3", atstop,EntryPrice+PriceScale*7); if MarketPosition == -1 and lowest(L,BarsSinceEntry) < EntryPrice-PriceScale*7 and lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*10 Then exitshort("ES3", atstop,EntryPrice-PriceScale*7); 즐거운 날 되세요. > stockric 님이 쓴 글입니다. > 제목 : 수식 부탁드립니다. > 해외선물 수식입니다. price channel지표인데요. INPUT : LENGTH(30); VAR : TCHAN(0), BCHAN(0); TCHAN = HIGHEST(HIGH, LENGTH)[1]; BCHAN = LOWEST(LOW, LENGTH)[1]; PLOT1(TCHAN, "TOP"); PLOT2(BCHAN, "BOT"); 에서 위 상단밴드를 돌파했을때 매수합니다. 10틱 수익시 청산하고 5틱하락시 손절합니다. 10틱에 도달하지못하고 하락시 7틱에서 이익보존하여 청산합니다. 만약 10틱이상 초과상승시 20틱에 청산하는 기능이 있다면 첨가부탁드립니다. 하단밴드를 돌파했을때 매도합니다. 10틱 수익시 청산하고 5틱하락시 손절합니다. 10틱에 도달하지못하고 하락시 7틱에서 이익보존하여 청산합니다. 만약 10틱이상 초과상승시 20틱에 청산하는 기능이 있다면 첨가부탁드립니다. 한 선물에 중복진입은 없어야 합니다.
프로필 이미지

stockric

2016-08-16 23:37:31

답변감사합니다. 질문 2가지만 더할께요. 1. 현물에 적용시킬려고합니다. INPUT : LENGTH(30); VAR : TCHAN(0), BCHAN(0); TCHAN = HIGHEST(HIGH, LENGTH)[1]; BCHAN = LOWEST(LOW, LENGTH)[1]; # 진입 if CrossUp(C, Tchan) Then buy(); if CrossDown(C, Bchan) Then sell(); # 목표청산/손절 if MarketPosition == 1 Then { exitlong("EL", atlimit, entryPrice+PriceScale*10); exitlong("EL2", atstop, entryPrice-PriceScale*5); } if MarketPosition == -1 Then { exitshort("ES", atlimit, entryPrice-PriceScale*10); exitshort("ES2", atstop, entryPrice+PriceScale*5); } #추적청산 if MarketPosition == 1 and highest(H,BarsSinceEntry) > EntryPrice+PriceScale*7 and highest(H,BarsSinceEntry) < EntryPrice+PriceScale*10 Then exitlong("EL3", atstop,EntryPrice+PriceScale*7); if MarketPosition == -1 and lowest(L,BarsSinceEntry) < EntryPrice-PriceScale*7 and lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*10 Then exitshort("ES3", atstop,EntryPrice-PriceScale*7); 현물에 적용시키기 위해서 %로 바꿀려는데요. 5%수익에 청산, 혹은 5%에 도달하지못하고 하락시 3%에 청산하여 이익보존 3%하락시 손절. 이렇게 조건으로 바꿀려면 어떻게 해야하나요? 2. INPUT : LENGTH(30); VAR : TCHAN(0), BCHAN(0); TCHAN = HIGHEST(HIGH, LENGTH)[1]; BCHAN = LOWEST(LOW, LENGTH)[1]; # 진입 if CrossUp(C, Tchan) Then buy(); if CrossDown(C, Bchan) Then sell(); # 목표청산/손절 if MarketPosition == 1 Then { exitlong("EL", atlimit, entryPrice+PriceScale*10); exitlong("EL2", atstop, entryPrice-PriceScale*5); } if MarketPosition == -1 Then { exitshort("ES", atlimit, entryPrice-PriceScale*10); exitshort("ES2", atstop, entryPrice+PriceScale*5); } #추적청산 if MarketPosition == 1 and highest(H,BarsSinceEntry) > EntryPrice+PriceScale*7 and highest(H,BarsSinceEntry) < EntryPrice+PriceScale*10 Then exitlong("EL3", atstop,EntryPrice+PriceScale*7); if MarketPosition == -1 and lowest(L,BarsSinceEntry) < EntryPrice-PriceScale*7 and lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*10 Then exitshort("ES3", atstop,EntryPrice-PriceScale*7); 매수청산 시점은 봉완성시 다음봉에 청산하게 하고싶습니다. 이는 매도청산 역시 동일합니다.