커뮤니티

시스템식

프로필 이미지
erwe343
2013-12-12 14:40:42
143
글번호 70365
답변완료
아래식에서 분할청산수량을 일일이 넣는 대신에 총매수한 수량에서 매도 되게끔 식을 바꿔주세요 Input : shortPeriod(10), longPeriod(20),Per(0.5),분할청산수량(10); var : N(0); value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); If CrossUp(value1, value2) Then Buy(); If CrossDown(value1, value2) Then ExitLong("bx1"); if MarketPosition == 1 Then{ N = (countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry)+1); ExitLong("bx",Atlimit,EntryPrice*(1+(Per*N)/100),"",분할청산수량,2); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2013-12-11 19:09:34

안녕하세요 예스스탁입니다. Input : shortPeriod(10), longPeriod(20),Per(0.5),Xper(10); var : N(0),Xvol(0); value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); If CrossUp(value1, value2) Then Buy(); If CrossDown(value1, value2) Then ExitLong("bx1"); if MarketPosition == 1 Then{ if CodeCategory == 11 && BasePrice < 50000 Then Xvol = int(int(MaxContracts*(Xper/100))/10)*10; Else Xvol = int(MaxContracts*(Xper/100)); N = (countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry)+1); ExitLong("bx",Atlimit,EntryPrice*(1+(Per*N)/100),"",Xvol,2); } 즐거운 하루되세요 > erwe343 님이 쓴 글입니다. > 제목 : 시스템식 > 아래식에서 분할청산수량을 일일이 넣는 대신에 총매수한 수량에서 가격이 0.5% 오를때마다 총수량의 10%수량씩 분할매도 되게끔 식을 바꿔주세요 Input : shortPeriod(10), longPeriod(20),Per(0.5),분할청산수량(10); var : N(0); value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); If CrossUp(value1, value2) Then Buy(); If CrossDown(value1, value2) Then ExitLong("bx1"); if MarketPosition == 1 Then{ N = (countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry)+1); ExitLong("bx",Atlimit,EntryPrice*(1+(Per*N)/100),"",분할청산수량,2); }