커뮤니티

시스템식 솔루션 문의

프로필 이미지
cwc1988
2012-08-08 15:57:30
358
글번호 53618
답변완료

첨부 이미지

제가 다음과 같은 시스템을 짰습니다. 보시면 아시겠지만, 지표중에 파라볼릭과 RSI라는 지표, bollinger band width 라는 지표 3개를 사용해서 구성한겁니다. 이 시스템을 돌려보면 아실 테지만 제가 첨부파일로도 그림 파일을 올려드리겠습니다. 질문이 3개인데, 1. 'pic1' 이라는 그림 파일을 보면 11월 7일에 보면 'trendbuy'라는 매수 신호 하나와 'wrongsig2'라는 청산 신호 2개가 뜨면서 결과적으로 position이 0이 되는데, 저는 'wrongsig2'라는 청산 신호가 1개만 뜨길 원합니다. 마찬가지로 12월 5에 'trendsell' 이라는 매도 신호와 'wrongsig'라는 청산 신호 2개가 뜨면서 결과적으로 position이 0이 되는데 'wrongsig'라는 청산신호가 1개만 뜨길 원합니다. 2. 'pic2' 이라는 그림 파일을 보면 7월 27일에 'trendsell'이라는 매도 신호와 'bwex'라는 청산 신호가 2개가 뜹니다. 그런데 저는 'bwex'라는 청산신호 1개만 뜨게 하고 싶습니다. 3. 마지막 질문은 아래의 시스템과 관계가 없고 그냥 궁금해서 질문드리는 건데 'pic3'를 보시면 5월 5일에 'trendbuy'와 'sell'이라는 주문의 조건이 둘다 만족하는데 결국 sell이 trendbuy를 압도하면서 position이 -1이 되었습니다. 궁금한 것은 buy와 sell 조건이 둘다 만족할 때 어떤 기준에 따라 포지션을 취하는건가요? 시스템식 작성 시 위에 있는 걸 따르게 되는건가요? 1번과 2번 질문은 로직을 손상시키지 않고 약간 버그성의 신호들을 고치고자 몇일을 노 력했는데도 도저히 해결될 기미가 보이지 않아 이렇게 질문 올리게 되었습니다. 귀찮으시더라도 솔루션을 제공해주시면 정말 감사하겠습니다. Input : Highperiod(48),period(20),af(0.005), maxAF(0.1),loss(2),D(2),PeriodR(7); var : PriceROC(0),BBTop(0), BBMid(0), BBBot(0),Bwidth(0),StoK(0),StoD(0),Relative(0); var1 = SAR(af,maxAF); BBTop = BollBandUp(Period,D); BBMid = ma(C,Period); BBBot = BollBandDown(Period,D); BWidth = ((BBTop - BBBot)/ BBMid); Relative = RSI(PeriodR); If (marketposition == 0 and Isexitname("endvolatil2",1) == false) or (marketposition != 0 and Isentryname("trendbuy") == false and Isexitname("endvolatil2",1) == false) then { If (Relative[1] >= 70 and Relative < Relative[1]) then sell("sell1");} If (marketposition == 0 and Isexitname("endvolatil1",1) == false) or (marketposition != 0 and entryname != "trendsell" and Isexitname("endvolatil1",1) == false) then { If Relative[1] <= 30 and Relative >= 30 then buy("buy1");} If (marketposition == 0 ) or (marketposition != 0 and entryname != "buy1" and entryname != "sell1") then { If var1 < c then buy("trendbuy"); If var1 > c then exitlong("endtrend1",onclose,def, "trendbuy"); If BarsSinceEntry(0) == 2 and c[2] > c then exitlong("wrongsig2",onclose,def,"trendbuy"); } If (marketposition == 0 and Isexitname("bwex",1) == false) or (marketposition != 0 and entryname != "buy1" and entryname != "sell1") then { If var1 > c then sell("trendsell"); If var1 < c then exitshort("endtrend2",onclose,def,"trendsell"); If BarsSinceEntry(0) == 3 and c[3] < c then exitshort("wrongsig",onclose,def,"trendsell"); If Bwidth[1] == Highest(Bwidth,Highperiod) and Bwidth[1] > Bwidth then exitshort("bwex",onclose,def,"trendsell"); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2012-08-09 17:22:33

안녕하세요 예스스탁입니다. 식을 수정했습니다. Input : Highperiod(48),period(20),af(0.005), maxAF(0.1),loss(2),D(2),PeriodR(7); var : PriceROC(0),BBTop(0), BBMid(0), BBBot(0),Bwidth(0),StoK(0),StoD(0),Relative(0); var1 = SAR(af,maxAF); BBTop = BollBandUp(Period,D); BBMid = ma(C,Period); BBBot = BollBandDown(Period,D); BWidth = ((BBTop - BBBot)/ BBMid); Relative = RSI(PeriodR); If (marketposition == 0 and Isexitname("endvolatil2",1) == false) or (marketposition != 0 and Isentryname("trendbuy") == false and Isexitname("endvolatil2",1) == false) then { If (Relative[1] >= 70 and Relative < Relative[1]) then sell("sell1");} If (marketposition == 0 and Isexitname("endvolatil1",1) == false) or (marketposition != 0 and entryname != "trendsell" and Isexitname("endvolatil1",1) == false) then { If Relative[1] <= 30 and Relative >= 30 then buy("buy1");} If (marketposition == 0 ) or (marketposition != 1 and entryname != "buy1" and entryname != "sell1") then { If var1 < c then buy("trendbuy"); } if MarketPosition == 1 then{ If var1 > c then exitlong("endtrend1",onclose,def, "trendbuy"); if BarsSinceEntry(0) == 2 and c[2] > c then exitlong("wrongsig2",onclose,def,"trendbuy"); } If (marketposition == 0 and Isexitname("bwex",1) == false) or (marketposition != -1 and entryname != "buy1" and entryname != "sell1") then { If var1 > c then sell("trendsell"); } if MarketPosition == -1 Then{ If var1 < c then exitshort("endtrend2",onclose,def,"trendsell"); If BarsSinceEntry(0) == 3 and c[3] < c then exitshort("wrongsig",onclose,def,"trendsell"); If Bwidth[1] == Highest(Bwidth,Highperiod) and Bwidth[1] > Bwidth then exitshort("bwex",onclose,def,"trendsell"); } 아래 링크는 신호체계에 관련된 글입니다. 올리신 내용은 나)항에 해당 하는 부분입니다. https://www.yesstock.com/YesTrader/YesLanguage/YesLanguage_help/4_6.htm 신호체계 확인하시기 바랍니다. 즐거운 하루되세요 즐거운 하루되세요 > cwc1988 님이 쓴 글입니다. > 제목 : 시스템식 솔루션 문의 > 제가 다음과 같은 시스템을 짰습니다. 보시면 아시겠지만, 지표중에 파라볼릭과 RSI라는 지표, bollinger band width 라는 지표 3개를 사용해서 구성한겁니다. 이 시스템을 돌려보면 아실 테지만 제가 첨부파일로도 그림 파일을 올려드리겠습니다. 질문이 3개인데, 1. 'pic1' 이라는 그림 파일을 보면 11월 7일에 보면 'trendbuy'라는 매수 신호 하나와 'wrongsig2'라는 청산 신호 2개가 뜨면서 결과적으로 position이 0이 되는데, 저는 'wrongsig2'라는 청산 신호가 1개만 뜨길 원합니다. 마찬가지로 12월 5에 'trendsell' 이라는 매도 신호와 'wrongsig'라는 청산 신호 2개가 뜨면서 결과적으로 position이 0이 되는데 'wrongsig'라는 청산신호가 1개만 뜨길 원합니다. 2. 'pic2' 이라는 그림 파일을 보면 7월 27일에 'trendsell'이라는 매도 신호와 'bwex'라는 청산 신호가 2개가 뜹니다. 그런데 저는 'bwex'라는 청산신호 1개만 뜨게 하고 싶습니다. 3. 마지막 질문은 아래의 시스템과 관계가 없고 그냥 궁금해서 질문드리는 건데 'pic3'를 보시면 5월 5일에 'trendbuy'와 'sell'이라는 주문의 조건이 둘다 만족하는데 결국 sell이 trendbuy를 압도하면서 position이 -1이 되었습니다. 궁금한 것은 buy와 sell 조건이 둘다 만족할 때 어떤 기준에 따라 포지션을 취하는건가요? 시스템식 작성 시 위에 있는 걸 따르게 되는건가요? 1번과 2번 질문은 로직을 손상시키지 않고 약간 버그성의 신호들을 고치고자 몇일을 노 력했는데도 도저히 해결될 기미가 보이지 않아 이렇게 질문 올리게 되었습니다. 귀찮으시더라도 솔루션을 제공해주시면 정말 감사하겠습니다. Input : Highperiod(48),period(20),af(0.005), maxAF(0.1),loss(2),D(2),PeriodR(7); var : PriceROC(0),BBTop(0), BBMid(0), BBBot(0),Bwidth(0),StoK(0),StoD(0),Relative(0); var1 = SAR(af,maxAF); BBTop = BollBandUp(Period,D); BBMid = ma(C,Period); BBBot = BollBandDown(Period,D); BWidth = ((BBTop - BBBot)/ BBMid); Relative = RSI(PeriodR); If (marketposition == 0 and Isexitname("endvolatil2",1) == false) or (marketposition != 0 and Isentryname("trendbuy") == false and Isexitname("endvolatil2",1) == false) then { If (Relative[1] >= 70 and Relative < Relative[1]) then sell("sell1");} If (marketposition == 0 and Isexitname("endvolatil1",1) == false) or (marketposition != 0 and entryname != "trendsell" and Isexitname("endvolatil1",1) == false) then { If Relative[1] <= 30 and Relative >= 30 then buy("buy1");} If (marketposition == 0 ) or (marketposition != 0 and entryname != "buy1" and entryname != "sell1") then { If var1 < c then buy("trendbuy"); If var1 > c then exitlong("endtrend1",onclose,def, "trendbuy"); If BarsSinceEntry(0) == 2 and c[2] > c then exitlong("wrongsig2",onclose,def,"trendbuy"); } If (marketposition == 0 and Isexitname("bwex",1) == false) or (marketposition != 0 and entryname != "buy1" and entryname != "sell1") then { If var1 > c then sell("trendsell"); If var1 < c then exitshort("endtrend2",onclose,def,"trendsell"); If BarsSinceEntry(0) == 3 and c[3] < c then exitshort("wrongsig",onclose,def,"trendsell"); If Bwidth[1] == Highest(Bwidth,Highperiod) and Bwidth[1] > Bwidth then exitshort("bwex",onclose,def,"trendsell"); }