커뮤니티

수식 문의

프로필 이미지
에구머니
2019-12-27 18:24:46
158
글번호 134680
답변완료
안녕하세요? 즐거운 성탄절 보내셨는지요? 수식 정정을 부탁드립니다. 감사합니다.
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2019-12-27 14:53:51

안녕하세요 예스스탁입니다. 식을 수정했습니다. input: howmany(5), n1(1), n2(2), n3(3),n4(4),n5(5),k최초(2), k일반(3), k익절(4), k손절(4),again(3),pause(5); var : atrv(0),vv(0); atrv = atr(50); if C < highest(C,30)-3*atrv then var1 = C; if C > Lowest(C,30)+3*atrv then var2 = C; Condition1 = MarketPosition == 0 and MarketPosition(1) == 1 and IsExitName("bL"); Condition2 = MarketPosition == 0 and MarketPosition(1) == -1 and IsExitName("sL"); if MarketPosition == 0 and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) >= pause)) and (Condition1 == false or (Condition1 == true and var1-k최초*atrv <= ExitPrice(1)-Again*Atr(50))) Then buy("b",atlimit,var1-k최초*atrv,n1); if MarketPosition == 1 then { ExitLong("bL",AtStop,AvgEntryPrice-k손절*atrv); ExitLong("bP",AtLimit,AvgEntryPrice+k익절*atrv); if howmany >= 2 and MaxEntries < howmany then { if MaxEntries == 1 then vv = n2; if MaxEntries == 2 then vv = n3; if MaxEntries == 3 then vv = n4; if MaxEntries == 4 then vv = n5; buy("bb",atlimit,LatestEntryPrice(0)-k일반*atrv,vv); } } if MarketPosition == 0 and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) >= pause)) and (Condition2 == false or (Condition2 == true and var1+k최초*atrv >= ExitPrice(1)+Again*Atr(50))) Then sell("s",atlimit,var2+k최초*atrv,n1); if MarketPosition == -1 then { ExitShort("sL",AtStop,AvgEntryPrice+k손절*atrv); ExitShort("sP",AtLimit,AvgEntryPrice-k익절*atrv); if howmany >= 2 and CurrentEntries < howmany then { if MaxEntries == 1 then vv = n2; if MaxEntries == 2 then vv = n3; if MaxEntries == 3 then vv = n4; if MaxEntries == 4 then vv = n5; sell("ss",atlimit,LatestEntryPrice(0)+k일반*atrv,vv); } } bb는 매수추가진입이름입니다. bb진입후 손절에 걸려 모두 청산이 되어서 최종 수량이 0이 되었습니다. 보내주신 그림에 보면 bb로 몸통 중간쯤에 진입했는데 아랫꼬리에서 손절조건이 만족해 2개의 진입이 모두 청산했습니다. 시스템에서 atstop,atlimit은 완성봉에서 셋팅되서 다음봉의 현재가와 비교해 신호가 발생합니다. 직전 완성봉에서 추가진입과 손절매가 셋팅이 되서 한봉에 모두 신호가 발생한것입니다. 시스템은 봉준간에 발생한 진입에 대해 인지를 하지 못합니다. 해당봉이 완성되어야 그때 평단가를 계산하게 됩니다. 즐거운 하루되세요 > 에구머니 님이 쓴 글입니다. > 제목 : 수식 문의 > 안녕하세요? 즐거운 성탄절 보내셨는지요? 수식 정정을 부탁드립니다. 감사합니다.
프로필 이미지

에구머니

2019-12-27 18:25:31

감사합니다. 그런데, 여전히 문제가 좀 있어 보이네요. 체크해 주시기 바랍니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 수식 문의 > 안녕하세요 예스스탁입니다. 식을 수정했습니다. input: howmany(5), n1(1), n2(2), n3(3),n4(4),n5(5),k최초(2), k일반(3), k익절(4), k손절(4),again(3),pause(5); var : atrv(0),vv(0); atrv = atr(50); if C < highest(C,30)-3*atrv then var1 = C; if C > Lowest(C,30)+3*atrv then var2 = C; Condition1 = MarketPosition == 0 and MarketPosition(1) == 1 and IsExitName("bL"); Condition2 = MarketPosition == 0 and MarketPosition(1) == -1 and IsExitName("sL"); if MarketPosition == 0 and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) >= pause)) and (Condition1 == false or (Condition1 == true and var1-k최초*atrv <= ExitPrice(1)-Again*Atr(50))) Then buy("b",atlimit,var1-k최초*atrv,n1); if MarketPosition == 1 then { ExitLong("bL",AtStop,AvgEntryPrice-k손절*atrv); ExitLong("bP",AtLimit,AvgEntryPrice+k익절*atrv); if howmany >= 2 and MaxEntries < howmany then { if MaxEntries == 1 then vv = n2; if MaxEntries == 2 then vv = n3; if MaxEntries == 3 then vv = n4; if MaxEntries == 4 then vv = n5; buy("bb",atlimit,LatestEntryPrice(0)-k일반*atrv,vv); } } if MarketPosition == 0 and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) >= pause)) and (Condition2 == false or (Condition2 == true and var1+k최초*atrv >= ExitPrice(1)+Again*Atr(50))) Then sell("s",atlimit,var2+k최초*atrv,n1); if MarketPosition == -1 then { ExitShort("sL",AtStop,AvgEntryPrice+k손절*atrv); ExitShort("sP",AtLimit,AvgEntryPrice-k익절*atrv); if howmany >= 2 and CurrentEntries < howmany then { if MaxEntries == 1 then vv = n2; if MaxEntries == 2 then vv = n3; if MaxEntries == 3 then vv = n4; if MaxEntries == 4 then vv = n5; sell("ss",atlimit,LatestEntryPrice(0)+k일반*atrv,vv); } } bb는 매수추가진입이름입니다. bb진입후 손절에 걸려 모두 청산이 되어서 최종 수량이 0이 되었습니다. 보내주신 그림에 보면 bb로 몸통 중간쯤에 진입했는데 아랫꼬리에서 손절조건이 만족해 2개의 진입이 모두 청산했습니다. 시스템에서 atstop,atlimit은 완성봉에서 셋팅되서 다음봉의 현재가와 비교해 신호가 발생합니다. 직전 완성봉에서 추가진입과 손절매가 셋팅이 되서 한봉에 모두 신호가 발생한것입니다. 시스템은 봉준간에 발생한 진입에 대해 인지를 하지 못합니다. 해당봉이 완성되어야 그때 평단가를 계산하게 됩니다. 즐거운 하루되세요 > 에구머니 님이 쓴 글입니다. > 제목 : 수식 문의 > 안녕하세요? 즐거운 성탄절 보내셨는지요? 수식 정정을 부탁드립니다. 감사합니다.