커뮤니티

수식 수정부탁합니다~

프로필 이미지
데미안리
2011-07-07 02:07:38
645
글번호 40634
답변완료

첨부 이미지

input : Money1(400000),Money2(600000); if CodeCategory == 1 Then{ var1 = int(int(Money1/C)/10)*10; var2 = int(int(Money2/C)/10)*10; } if CodeCategory == 2 Then{ var1 = int(Money1/C); var2 = int(Money2/C); } if CodeCategory == 6 Then{ var1 = int(Money1/(C*100000)); var2 = int(Money2/(C*100000)); } if MarketPosition==0 and sTime==150000 and NextBarOpen < c*0.99 Then buy("b",AtMarket,def,var1); If MarketPosition==1 and CurrentEntries == 1 Then buy("bb",AtLimit,EntryPrice*0.97,var2); if MarketPosition==1 and stime >= 91000 and CurrentEntries == 2 Then exitlong("loss",AtStop,AvgEntryPrice*0.97); #한번만 매수진입되었을 경우 if MarketPosition==1 and maxEntries == 1 Then exitlong("Profit1",AtLimit,AvgEntryPrice*1.01); #두번 매수진입되었을 경우 if MarketPosition==1 and MaxEntries == 2 Then exitlong("Profit2",AtLimit,AvgEntryPrice*1.005); SetStopProfittarget(1,PercentStop) ; SetStopEndofday(100000); --------------------------------- 1. 시가에 들어간 후 당봉이 1% 상승하면 그 봉에서 처분하고 싶습니다. 그런데 강제청산을 적용하지 않으면 다음봉에 신호가 뜨더군요. 그래서 강제청산 식을 넣어더니 다른문제가 발생합니다. 원래 두 번 매수진입되었을 경우, 평단가 0.5% 상승에 매도 이나 bb매수가 1% 상승되었을 때 bb매수만 먼저 처분되더군요. 그러므로 1) 시가에 진입후 당 봉이 1%상승 하면 그 봉에서 매도 2) 두 번 매수 진입했을 땐, 평단가 0.5% 수익 매도 가 성립되도록 해주세요~
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2011-07-07 09:55:26

안녕하세요 예스스탁입니다. 수정한 식입니다. input : Money1(400000),Money2(600000); if CodeCategory == 1 Then{ var1 = int(int(Money1/C)/10)*10; var2 = int(int(Money2/C)/10)*10; } if CodeCategory == 2 Then{ var1 = int(Money1/C); var2 = int(Money2/C); } if CodeCategory == 6 Then{ var1 = int(Money1/(C*100000)); var2 = int(Money2/(C*100000)); } if MarketPosition==0 and sTime==150000 and NextBarOpen < c*0.99 Then buy("b",AtMarket,def,var1); if stime == 150000 Then ExitLong("bx",atlimit,NextBarOpen*1.01); If MarketPosition==1 and CurrentEntries == 1 Then buy("bb",AtLimit,EntryPrice*0.97,var2); if MarketPosition==1 and stime >= 91000 and CurrentEntries == 2 Then exitlong("loss",AtStop,AvgEntryPrice*0.97); #한번만 매수진입되었을 경우 if MarketPosition==1 and maxEntries == 1 Then exitlong("Profit1",AtLimit,EntryPrice*1.01); #두번 매수진입되었을 경우 if MarketPosition==1 and MaxEntries == 2 Then exitlong("Profit2",AtLimit,AvgEntryPrice*1.005); SetStopEndofday(100000); 즐거운 하루되세요 > 데미안리 님이 쓴 글입니다. > 제목 : 수식 수정부탁합니다~ > input : Money1(400000),Money2(600000); if CodeCategory == 1 Then{ var1 = int(int(Money1/C)/10)*10; var2 = int(int(Money2/C)/10)*10; } if CodeCategory == 2 Then{ var1 = int(Money1/C); var2 = int(Money2/C); } if CodeCategory == 6 Then{ var1 = int(Money1/(C*100000)); var2 = int(Money2/(C*100000)); } if MarketPosition==0 and sTime==150000 and NextBarOpen < c*0.99 Then buy("b",AtMarket,def,var1); If MarketPosition==1 and CurrentEntries == 1 Then buy("bb",AtLimit,EntryPrice*0.97,var2); if MarketPosition==1 and stime >= 91000 and CurrentEntries == 2 Then exitlong("loss",AtStop,AvgEntryPrice*0.97); #한번만 매수진입되었을 경우 if MarketPosition==1 and maxEntries == 1 Then exitlong("Profit1",AtLimit,AvgEntryPrice*1.01); #두번 매수진입되었을 경우 if MarketPosition==1 and MaxEntries == 2 Then exitlong("Profit2",AtLimit,AvgEntryPrice*1.005); SetStopProfittarget(1,PercentStop) ; SetStopEndofday(100000); --------------------------------- 1. 시가에 들어간 후 당봉이 1% 상승하면 그 봉에서 처분하고 싶습니다. 그런데 강제청산을 적용하지 않으면 다음봉에 신호가 뜨더군요. 그래서 강제청산 식을 넣어더니 다른문제가 발생합니다. 원래 두 번 매수진입되었을 경우, 평단가 0.5% 상승에 매도 이나 bb매수가 1% 상승되었을 때 bb매수만 먼저 처분되더군요. 그러므로 1) 시가에 진입후 당 봉이 1%상승 하면 그 봉에서 매도 2) 두 번 매수 진입했을 땐, 평단가 0.5% 수익 매도 가 성립되도록 해주세요~