커뮤니티

시스템 식 부탁드립니다.

프로필 이미지
희망벌
2010-11-30 16:32:40
644
글번호 33989
답변완료
안녕하세요? 수식작성 좀 부탁 드릴께요. 지난번 작성해주신 피라미딩 진입식은 아래와 같이 진입신호에 따라 투자원금 대비 몇 %씩 분할해서 진입되는 것을 확인 했습니다. 부탁1. 청산을 청산조건 1..2..3...중에 아무것이나 먼저 나오는 청산신호에 따라 1차청산은 현재 보유포지션의 30%, 2차청산은 50% ...3차청산은 100% 이런식으로 부탁 드립니다. 2. 1차 이상 청산 중에 진입신호가 나와서 보유량이 늘거나 줄어도 언제나 현재 남아있는 보유량의 비율로 청산 할 수 있게요. //진입조건 if date != date[1] then{ if 장기 >장기[1] and 중기>중기[1] and 단기 >단기[1] Or //진입조건1 crossup(단기, 중기) and (단기[1]<중기[1] or 중기[1]< 장기[1]) //진입조건2 then { //피라미딩 if CurrentEntries == 0 then buy("B1",onclose,def,int(투자원금*0.2/C/100000)); if CurrentEntries == 1 then buy("B2",onclose,def,int(투자원금*0.1/C/100000)); if CurrentEntries >= 2 then buy("B3",onclose,def,int(투자원금*0.05/C/100000)); } } //분할 청산
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2010-11-30 17:12:25

안녕하세요 예스스탁입니다. var : 청산조건(0); 청산조건 = 청산조건1 or 청산조건2 or 청산조건3 or...or ; if MarketPosition == 1 Then{ if CurrentContracts > CurrentContracts[1] Then{#진입에 의해 수량이 상승할때마다 청산비율 재계산 value1 = CurrentContracts; value2 = int(value1*0.3); value3 = int(value1*0.5); value4 = value1-value2-value3; } if CurrentContracts == value1 and 청산조건 Then #최초진입이나 추가진입이후 첫청산 ExitLong("bx1",OnClose,def,"",value2,1); if CurrentContracts == value1-value2 and 청산조건 Then#최초진입이나 추가진입이후 두번째 청산 ExitLong("bx2",OnClose,def,"",value3,1); if CurrentContracts == value4 and 청산조건 Then ##최초진입이나 추가진입이후 세번째 청산 ExitLong("bx3"); } 즐거운 하루되세요 > 희망벌 님이 쓴 글입니다. > 제목 : 시스템 식 부탁드립니다. > 안녕하세요? 수식작성 좀 부탁 드릴께요. 지난번 작성해주신 피라미딩 진입식은 아래와 같이 진입신호에 따라 투자원금 대비 몇 %씩 분할해서 진입되는 것을 확인 했습니다. 부탁1. 청산을 청산조건 1..2..3...중에 아무것이나 먼저 나오는 청산신호에 따라 1차청산은 현재 보유포지션의 30%, 2차청산은 50% ...3차청산은 100% 이런식으로 부탁 드립니다. 2. 1차 이상 청산 중에 진입신호가 나와서 보유량이 늘거나 줄어도 언제나 현재 남아있는 보유량의 비율로 청산 할 수 있게요. //진입조건 if date != date[1] then{ if 장기 >장기[1] and 중기>중기[1] and 단기 >단기[1] Or //진입조건1 crossup(단기, 중기) and (단기[1]<중기[1] or 중기[1]< 장기[1]) //진입조건2 then { //피라미딩 if CurrentEntries == 0 then buy("B1",onclose,def,int(투자원금*0.2/C/100000)); if CurrentEntries == 1 then buy("B2",onclose,def,int(투자원금*0.1/C/100000)); if CurrentEntries >= 2 then buy("B3",onclose,def,int(투자원금*0.05/C/100000)); } } //분할 청산