커뮤니티

시스템 합성관리자 질문드립니다.

프로필 이미지
stockric
2017-11-21 10:21:11
175
글번호 114352
답변완료
어제 문의한 로직으로 잘 해결하였습니다. 그런데 문제는 buy용 시스템과 sell용 시스템을 합성관리자에서 합성하여 구동시킬경우 손실제한 로직이 적용되지않는다는 것인데요. 로직은 이러합니다. var&#160;:&#160;시그널(false),Lcnt(0); if&#160;Bdate&#160;!=&#160;Bdate[1]&#160;Then &#160;&#160;&#160;&#160;&#160;&#160;Lcnt&#160;=&#160;0; if&#160;TotalTrades&#160;>&#160;TotalTrades[1]&#160;and&#160;IsExitName("StopLoss",1)&#160;==&#160;true&#160;Then &#160;&#160;&#160;&#160;&#160;&#160;Lcnt&#160;=&#160;Lcnt+1; 시그널&#160;=&#160;false; if&#160;매매조건1&#160;then{ &#160;&#160;&#160;&#160;&#160;&#160;시그널&#160;=&#160;true; } if&#160;매매조건2&#160;then{ &#160;&#160;&#160;&#160;&#160;&#160;시그널&#160;=&#160;true; } if&#160;매매조건3&#160;then{ &#160;&#160;&#160;&#160;&#160;&#160;시그널&#160;=&#160;true; } if&#160;매매조건4&#160;then{ &#160;&#160;&#160;&#160;&#160;&#160;시그널&#160;=&#160;true; } if&#160;시그널&#160;and&#160;Lcnt&#160;<&#160;2&#160;then &#160;&#160;&#160;&#160;&#160;&#160;buy(); SetStopLoss(~~~~); buy용 시스템만 구동시에는 스탑로스 2번 발생시 진입제한이 잘 작동됩니다. 허나 합성관리자에서 2개를 합칠경우 그렇게 구동되지않는데요. var&#160;:&#160;시그널2(false),Lcnt2(0); if&#160;Bdate&#160;!=&#160;Bdate[1]&#160;Then &#160;&#160;&#160;&#160;&#160;&#160;Lcnt2&#160;=&#160;0; if&#160;TotalTrades&#160;>&#160;TotalTrades[1]&#160;and&#160;IsExitName("StopLoss",1)&#160;==&#160;true&#160;Then &#160;&#160;&#160;&#160;&#160;&#160;Lcnt2 =&#160;Lcnt2+1; 시그널2&#160;=&#160;false; if&#160;매매조건1&#160;then{ &#160;&#160;&#160;&#160;&#160;&#160;시그널2&#160;=&#160;true; } if&#160;매매조건2&#160;then{ &#160;&#160;&#160;&#160;&#160;&#160;시그널2&#160;=&#160;true; } if&#160;매매조건3&#160;then{ &#160;&#160;&#160;&#160;&#160;&#160;시그널2&#160;=&#160;true; } if&#160;매매조건4&#160;then{ &#160;&#160;&#160;&#160;&#160;&#160;시그널2&#160;=&#160;true; } if&#160;시그널2&#160;and&#160;Lcnt2&#160;<&#160;2&#160;then &#160;&#160;&#160;&#160;&#160;&#160;sell(); SetStopLoss(~~~~); sell시스템으로 구분하였습니다. 이렇게 두개의 구분된로직을 독립된형태로 돌리면 상관없으나.. 합성관리자로 합성해서 돌리면 진입제한식이 적용이 되지않네요.. 이유가 무엇인가요? 합성관리자의 기능은 buy용 시스템과 sell시스템의 로직을 하나로 합쳐 구동하는 것인가요 아니면 그저 독립된 2개의시스템을 한차트에 한번에 적용시키는 기능인가요?
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2017-11-21 16:18:27

안녕하세요 예스스탁입니다. 합성관리자는 단순히 or 조건으로 식을 합성하는 기능만 가지고 있습니다 각 수식에 사용하는 변수들이 별도로 관리되는 것이 아닙니다. 해당 내용은 합성관리자로 합성해서 별도관리되게 할수 없습니다. 직접 합성식을 작성해 사용하셔야 합니다. var : 매수시그널(false),매도시그널(false),BLcnt(0),SLcnt(0); if Bdate != Bdate[1] Then Lcnt = 0; if TotalTrades > TotalTrades[1] and MarketPosition(1) == 1 and IsExitName("StopLoss",1) == true Then BLcnt = BLcnt+1; if TotalTrades > TotalTrades[1] and MarketPosition(1) == -1 and IsExitName("StopLoss",1) == true Then SLcnt = SLcnt+1; 매수시그널 = false; if 매매조건1 then{ 매수시그널 = true; } if 매매조건2 then{ 매수시그널 = true; } if 매매조건3 then{ 매수시그널 = true; } if 매매조건4 then{ 매수시그널 = true; } if 매수시그널 and BLcnt < 2 then buy(); 매도시그널 = false; if 매매조건1 then{ 매도시그널 = true; } if 매매조건2 then{ 매도시그널 = true; } if 매매조건3 then{ 매도시그널 = true; } if 매매조건4 then{ 매도시그널 = true; } if 매도시그널 and SLcnt < 2 then sell(); SetStopLoss(~~~~); 즐거운 하루되세요 > stockric 님이 쓴 글입니다. > 제목 : 시스템 합성관리자 질문드립니다. > 어제 문의한 로직으로 잘 해결하였습니다. 그런데 문제는 buy용 시스템과 sell용 시스템을 합성관리자에서 합성하여 구동시킬경우 손실제한 로직이 적용되지않는다는 것인데요. 로직은 이러합니다. var&nbsp;:&nbsp;시그널(false),Lcnt(0); if&nbsp;Bdate&nbsp;!=&nbsp;Bdate[1]&nbsp;Then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Lcnt&nbsp;=&nbsp;0; if&nbsp;TotalTrades&nbsp;>&nbsp;TotalTrades[1]&nbsp;and&nbsp;IsExitName("StopLoss",1)&nbsp;==&nbsp;true&nbsp;Then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Lcnt&nbsp;=&nbsp;Lcnt+1; 시그널&nbsp;=&nbsp;false; if&nbsp;매매조건1&nbsp;then{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;시그널&nbsp;=&nbsp;true; } if&nbsp;매매조건2&nbsp;then{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;시그널&nbsp;=&nbsp;true; } if&nbsp;매매조건3&nbsp;then{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;시그널&nbsp;=&nbsp;true; } if&nbsp;매매조건4&nbsp;then{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;시그널&nbsp;=&nbsp;true; } if&nbsp;시그널&nbsp;and&nbsp;Lcnt&nbsp;<&nbsp;2&nbsp;then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buy(); SetStopLoss(~~~~); buy용 시스템만 구동시에는 스탑로스 2번 발생시 진입제한이 잘 작동됩니다. 허나 합성관리자에서 2개를 합칠경우 그렇게 구동되지않는데요. var&nbsp;:&nbsp;시그널2(false),Lcnt2(0); if&nbsp;Bdate&nbsp;!=&nbsp;Bdate[1]&nbsp;Then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Lcnt2&nbsp;=&nbsp;0; if&nbsp;TotalTrades&nbsp;>&nbsp;TotalTrades[1]&nbsp;and&nbsp;IsExitName("StopLoss",1)&nbsp;==&nbsp;true&nbsp;Then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Lcnt2 =&nbsp;Lcnt2+1; 시그널2&nbsp;=&nbsp;false; if&nbsp;매매조건1&nbsp;then{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;시그널2&nbsp;=&nbsp;true; } if&nbsp;매매조건2&nbsp;then{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;시그널2&nbsp;=&nbsp;true; } if&nbsp;매매조건3&nbsp;then{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;시그널2&nbsp;=&nbsp;true; } if&nbsp;매매조건4&nbsp;then{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;시그널2&nbsp;=&nbsp;true; } if&nbsp;시그널2&nbsp;and&nbsp;Lcnt2&nbsp;<&nbsp;2&nbsp;then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sell(); SetStopLoss(~~~~); sell시스템으로 구분하였습니다. 이렇게 두개의 구분된로직을 독립된형태로 돌리면 상관없으나.. 합성관리자로 합성해서 돌리면 진입제한식이 적용이 되지않네요.. 이유가 무엇인가요? 합성관리자의 기능은 buy용 시스템과 sell시스템의 로직을 하나로 합쳐 구동하는 것인가요 아니면 그저 독립된 2개의시스템을 한차트에 한번에 적용시키는 기능인가요?