커뮤니티

수식 문의

프로필 이미지
softtoug
2017-01-18 00:23:57
112
글번호 106028
답변완료
안녕하세요 하기 수식에 추가적인 사항 문의드립니다. 도움 부탁드립니다. input : P(14),BBP(20),dv(2),MAP(60); input : short(12),long(26),sig(9); var : ADXV(0),DP(0),DM(0),T(0),BBup(0),BBdn(0),mav(0); var : MACDV(0),MACDS(0),Bcond(false),Scond(False);; ADXV = ADX(P); DP = Diplus(P); DM = DiMinus(P); BBup = BollBandUp(BBP,dv); BBdn = BollBandDown(BBP,dv); mav = ma(C,MAP); MACDV = MACD(short,long); MACDS = ema(MACDV,sig); Bcond = TotalTrades == 0 or (MarketPosition == 0 and BarsSinceExit(1) >= 4) or (MarketPosition == -1 and BarsSinceEntry >= 4); Scond = TotalTrades == 0 or (MarketPosition == 0 and BarsSinceExit(1) >= 4) or (MarketPosition == 1 and BarsSinceEntry >= 4); if MarketPosition == 1 and IsEntryName("b1") == true Then{ if CrossDown(DP,DM) Then ExitLong(); } if MarketPosition == -1 and IsEntryName("s1") == true Then{ if CrossUp(DP,DM) Then ExitShort(); } if CrossUp(BBdn,mav) and countif(crossdown(BBdn,mav),5) < 1 and DP < 30 and bcond == true Then buy("b1"); if CrossDown(BBup,mav) and countif(CrossUp(BBup,mav),5) < 1 and DM < 30 and scond == true Then sell("s1"); if MarketPosition == 1 and IsEntryName("b1") == true Then{ if CrossDown(DP,DM) and scond == true Then sell("s2"); } if MarketPosition == -1 and IsEntryName("s1") == true Then{ if crossup(DP,DM) and Bcond == true Then Buy("b2"); } 1. b1 또는 s1 진입 후 익절이 발생한 후 재진입 하는 수식 추가로 부탁드립니다. 조건은 하기와 같습니다. * 전봉의 상태가 b1의 경우 볼린져 밴드 상단을 cross up 한 경우, 또는 볼린져 밴드 상단에 걸쳐져 있는 경우 * 전봉의 종가보다 (2개봉 내에서) 10틱 위에서 매수 재진입 하는 것으로 부탁드립니다. 봉완성과 상관없이 10틱 이상이 되면 재진입 하는 것으로 부탁드립니다. * 청산은 봉의 상태가 볼린져 밴드 상단에 미치지 못하는 봉이 2개 이상 연속으로 발생하면 3번째 봉의 생성과 동시에 청산 부탁드립니다. * 손절은 DP,DM이 교차될 때 손절 부탁드립니다. * 저는 기본적인 익절을 최대 수익 대비 하락 조건으로 사용하고 있는데, 상기 청산 방법을 별도로 적용가능한지요? 확인 부탁드립니다. * 매도는 반대로 부탁드립니다. 2. b2, s2 의 수식은 b1, s1 진입 후 DP,DM이 교차시 반대매매로 들어가는 수식입니다. b2, s2 진입 한 후, 익절이 났다는 가정하에 상기 b1,s1 추가 수식을 똑같이 적용 부탁드립니다. 3. 추가적인 질문입니다. 어떤 신호이든 간에 진입 후 20번째 봉까지 손절이나 익절이 발생하지 않았을 경우, 봉색깔은 검은색으로 표시할 수 있는지요? 확인 부탁드립니다. 어떤 신호이든 간에 진입 후 20번째 봉까지 손절이나 익절이 발생하지 않았고, 최대 수익이 10틱 이하 밖에 발생하지 않았으면, 최초 진입가 또는 -5틱까지 다시 왔을때 청산할 수 있는 수식이 있는지요? 확인 부탁드립니다. 감사합니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2017-01-18 13:55:56

안녕하세요 예스스탁입니다. 3번의 봉의 색표시는 가능하지 않습니다. 시스템식에서 봉에 표시는 가능하지 않습니다. input : P(14),BBP(20),dv(2),MAP(60); input : short(12),long(26),sig(9); var : ADXV(0),DP(0),DM(0),T(0),BBup(0),BBdn(0),mav(0); var : MACDV(0),MACDS(0),Bcond(false),Scond(False);; ADXV = ADX(P); DP = Diplus(P); DM = DiMinus(P); BBup = BollBandUp(BBP,dv); BBdn = BollBandDown(BBP,dv); mav = ma(C,MAP); MACDV = MACD(short,long); MACDS = ema(MACDV,sig); Bcond = TotalTrades == 0 or (MarketPosition == 0 and BarsSinceExit(1) >= 4) or (MarketPosition == -1 and BarsSinceEntry >= 4); Scond = TotalTrades == 0 or (MarketPosition == 0 and BarsSinceExit(1) >= 4) or (MarketPosition == 1 and BarsSinceEntry >= 4); if CrossUp(BBdn,mav) and countif(crossdown(BBdn,mav),5) < 1 and DP < 30 and bcond == true Then buy("b1"); if CrossDown(BBup,mav) and countif(CrossUp(BBup,mav),5) < 1 and DM < 30 and scond == true Then sell("s1"); if MarketPosition == 1 and IsEntryName("b1") == true Then{ if CrossDown(DP,DM) and scond == true Then sell("s2"); } if MarketPosition == -1 and IsEntryName("s1") == true Then{ if crossup(DP,DM) and Bcond == true Then Buy("b2"); } if MarketPosition == 0 Then{ if MarketPosition(1) == 1 and IsExitName("StopTrailing",1) == true and H > BBup Then{ buy("bb",AtStop,C+PriceScale*10); } if MarketPosition(1) == -1 and IsExitName("StopTrailing",1) == true and L < BBdn Then{ sell("ss",AtStop,C-PriceScale*10); } } if MarketPosition == 1 and (IsEntryName("b1") == true or IsEntryName("bb") == true) Then{ if CrossDown(DP,DM) Then ExitLong("bx1"); } if MarketPosition == -1 and (IsEntryName("s1") == true or IsEntryName("ss") == true) Then{ if CrossUp(DP,DM) Then ExitShort("sx1"); } if MarketPosition == 1 and IsEntryName("bb") == true and countif(H<BBup,2) == 2 Then exitlong("bx2",AtMarket); if MarketPosition == -1 and IsEntryName("ss") == true and countif(L>BBup,2) == 2 Then ExitShort("sx2",AtMarket); if MarketPosition == 1 and BarsSinceEntry >= 20 and highest(H,BarsSinceEntry) < EntryPrice+PriceScale*10 Then exitlong("bx3",AtStop,EntryPrice-PriceScale*5); if MarketPosition == -1 and BarsSinceEntry >= 20 and highest(H,BarsSinceEntry) < EntryPrice+PriceScale*10 Then ExitShort("sx3",AtStop,EntryPrice+PriceScale*5); 즐거운 하루되세요 > softtoug 님이 쓴 글입니다. > 제목 : 수식 문의 > 안녕하세요 하기 수식에 추가적인 사항 문의드립니다. 도움 부탁드립니다. input : P(14),BBP(20),dv(2),MAP(60); input : short(12),long(26),sig(9); var : ADXV(0),DP(0),DM(0),T(0),BBup(0),BBdn(0),mav(0); var : MACDV(0),MACDS(0),Bcond(false),Scond(False);; ADXV = ADX(P); DP = Diplus(P); DM = DiMinus(P); BBup = BollBandUp(BBP,dv); BBdn = BollBandDown(BBP,dv); mav = ma(C,MAP); MACDV = MACD(short,long); MACDS = ema(MACDV,sig); Bcond = TotalTrades == 0 or (MarketPosition == 0 and BarsSinceExit(1) >= 4) or (MarketPosition == -1 and BarsSinceEntry >= 4); Scond = TotalTrades == 0 or (MarketPosition == 0 and BarsSinceExit(1) >= 4) or (MarketPosition == 1 and BarsSinceEntry >= 4); if MarketPosition == 1 and IsEntryName("b1") == true Then{ if CrossDown(DP,DM) Then ExitLong(); } if MarketPosition == -1 and IsEntryName("s1") == true Then{ if CrossUp(DP,DM) Then ExitShort(); } if CrossUp(BBdn,mav) and countif(crossdown(BBdn,mav),5) < 1 and DP < 30 and bcond == true Then buy("b1"); if CrossDown(BBup,mav) and countif(CrossUp(BBup,mav),5) < 1 and DM < 30 and scond == true Then sell("s1"); if MarketPosition == 1 and IsEntryName("b1") == true Then{ if CrossDown(DP,DM) and scond == true Then sell("s2"); } if MarketPosition == -1 and IsEntryName("s1") == true Then{ if crossup(DP,DM) and Bcond == true Then Buy("b2"); } 1. b1 또는 s1 진입 후 익절이 발생한 후 재진입 하는 수식 추가로 부탁드립니다. 조건은 하기와 같습니다. * 전봉의 상태가 b1의 경우 볼린져 밴드 상단을 cross up 한 경우, 또는 볼린져 밴드 상단에 걸쳐져 있는 경우 * 전봉의 종가보다 (2개봉 내에서) 10틱 위에서 매수 재진입 하는 것으로 부탁드립니다. 봉완성과 상관없이 10틱 이상이 되면 재진입 하는 것으로 부탁드립니다. * 청산은 봉의 상태가 볼린져 밴드 상단에 미치지 못하는 봉이 2개 이상 연속으로 발생하면 3번째 봉의 생성과 동시에 청산 부탁드립니다. * 손절은 DP,DM이 교차될 때 손절 부탁드립니다. * 저는 기본적인 익절을 최대 수익 대비 하락 조건으로 사용하고 있는데, 상기 청산 방법을 별도로 적용가능한지요? 확인 부탁드립니다. * 매도는 반대로 부탁드립니다. 2. b2, s2 의 수식은 b1, s1 진입 후 DP,DM이 교차시 반대매매로 들어가는 수식입니다. b2, s2 진입 한 후, 익절이 났다는 가정하에 상기 b1,s1 추가 수식을 똑같이 적용 부탁드립니다. 3. 추가적인 질문입니다. 어떤 신호이든 간에 진입 후 20번째 봉까지 손절이나 익절이 발생하지 않았을 경우, 봉색깔은 검은색으로 표시할 수 있는지요? 확인 부탁드립니다. 어떤 신호이든 간에 진입 후 20번째 봉까지 손절이나 익절이 발생하지 않았고, 최대 수익이 10틱 이하 밖에 발생하지 않았으면, 최초 진입가 또는 -5틱까지 다시 왔을때 청산할 수 있는 수식이 있는지요? 확인 부탁드립니다. 감사합니다.