커뮤니티

시스템식 수정부탁드립니다...

프로필 이미지
상위1프로되기
2012-02-20 12:13:15
322
글번호 47948
답변완료
input : 투입금액1(2000000),투입금액2(4000000); if CodeCategory == 1 Then{ #코스피 if BasePrice < 50000 Then{ Var1 = int(int(투입금액1/C)/10)*10; Var2 = int(int(투입금액2/C)/10)*10; } Else{ Var1 = int(투입금액1/C); Var2 = int(투입금액2/C); } } if CodeCategory == 2 Then{ Var1 = int(투입금액1/C); Var2 = int(투입금액2/C); } if CodeCategory == 6 Then{ Var1 = int(투입금액1/(C*BigPointValue)); Var2 = int(투입금액2/(C*BigPointValue)); } var : cnt(0),count(0); value1 = ma(C,240); value2 = ma(c,360); value3 = ma(c,480); VALUE4 = ma(c,600); value5 = ma(c,750); if TotalTrades < 1 and MarketPosition == 0 and ((l < value1*1.005)and(c < value1*1.03) or ( c < Value1*1.01 )) Then buy("1차매수",OnClose,DEF,var1); if MarketPosition == 1 and CurrentEntries ==1 Then{ exitlong("1차수익실현",atlimit,AvgEntryPrice*1.06); } if MarketPosition == 1 and CurrentEntries == 1 and ((l < value2*1.005)and(c < value2*1.015) or ( c < Value2*1.01 )) Then buy("2차매수",OnClose,DEF,var1); if MarketPosition == 1 and CurrentEntries == 2 Then{ exitlong("2차수익실현",atlimit,AvgEntryPrice*1.05); } if MarketPosition == 1 and CurrentEntries == 2 and (((l < value3*1.005)and(c < value3*1.015) or ( c < Value3*1.01 )) and (C < AvgEntryPrice*0.97))Then buy("3차매수",OnClose,DEF,var2); if MarketPosition == 1 and CurrentEntries == 3 Then{ exitlong("3차수익실현",atlimit,AvgEntryPrice*1.05); } if MarketPosition == 1 and CurrentEntries == 3 and (((l < value4*1.005)and(c < value4*1.015) or ( c < Value4*1.01 )) and (C < AvgEntryPrice*0.97))Then buy("4차매수",OnClose,DEF,var2); if MarketPosition == 1 and CurrentEntries == 4 Then{ exitlong("4차수익실현",atlimit,AvgEntryPrice*1.04); if (c<value5) Then exitlong("손절",AtStop,AvgEntryPrice*0.96); } 위에 식에서 매도를 분할매도식으로 바꾸고 싶습니다.. 1차매수후 5프로에서-절반매도 10프로에서-30프로매도 20프로는홀딩 2차매수후 5프로에서-절반매도(전체매수수량) 10프로에서-30프로매도 20프로홀딩 3차매수후 5프로에서-절반매도(전체매수수량) 10프로에서-30프로매도 20프로홀딩 4차매수후 5프로&#50667;서-절반매도(전체매수수량) 10프로에서-30프로매도 나머지홀딩 그리고 750일선 이탈시 전량매도...
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2012-02-20 17:38:15

안녕하세요 예스스탁입니다. 아래식 추가하시면 됩니다. if MarketPosition == 1 Then{ if CurrentContracts > CurrentContracts[1] Then{ value88 = int(CurrentContracts*0.5); value89 = int(CurrentContracts*0.3); } if CurrentContracts == MaxContracts Then exitlong("bx1",AtLimit,AvgEntryPrice*1.05,"",value89,1); if CurrentContracts < MaxContracts and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) == 1 Then exitlong("bx2",AtLimit,AvgEntryPrice*1.10,"",value89,1); } if CrossDown(c,ma(c,750)) Then exitlong(); 즐거운 하루되세요 > 상위1프로되기 님이 쓴 글입니다. > 제목 : 시스템식 수정부탁드립니다... > input : 투입금액1(2000000),투입금액2(4000000); if CodeCategory == 1 Then{ #코스피 if BasePrice < 50000 Then{ Var1 = int(int(투입금액1/C)/10)*10; Var2 = int(int(투입금액2/C)/10)*10; } Else{ Var1 = int(투입금액1/C); Var2 = int(투입금액2/C); } } if CodeCategory == 2 Then{ Var1 = int(투입금액1/C); Var2 = int(투입금액2/C); } if CodeCategory == 6 Then{ Var1 = int(투입금액1/(C*BigPointValue)); Var2 = int(투입금액2/(C*BigPointValue)); } var : cnt(0),count(0); value1 = ma(C,240); value2 = ma(c,360); value3 = ma(c,480); VALUE4 = ma(c,600); value5 = ma(c,750); if TotalTrades < 1 and MarketPosition == 0 and ((l < value1*1.005)and(c < value1*1.03) or ( c < Value1*1.01 )) Then buy("1차매수",OnClose,DEF,var1); if MarketPosition == 1 and CurrentEntries ==1 Then{ exitlong("1차수익실현",atlimit,AvgEntryPrice*1.06); } if MarketPosition == 1 and CurrentEntries == 1 and ((l < value2*1.005)and(c < value2*1.015) or ( c < Value2*1.01 )) Then buy("2차매수",OnClose,DEF,var1); if MarketPosition == 1 and CurrentEntries == 2 Then{ exitlong("2차수익실현",atlimit,AvgEntryPrice*1.05); } if MarketPosition == 1 and CurrentEntries == 2 and (((l < value3*1.005)and(c < value3*1.015) or ( c < Value3*1.01 )) and (C < AvgEntryPrice*0.97))Then buy("3차매수",OnClose,DEF,var2); if MarketPosition == 1 and CurrentEntries == 3 Then{ exitlong("3차수익실현",atlimit,AvgEntryPrice*1.05); } if MarketPosition == 1 and CurrentEntries == 3 and (((l < value4*1.005)and(c < value4*1.015) or ( c < Value4*1.01 )) and (C < AvgEntryPrice*0.97))Then buy("4차매수",OnClose,DEF,var2); if MarketPosition == 1 and CurrentEntries == 4 Then{ exitlong("4차수익실현",atlimit,AvgEntryPrice*1.04); if (c<value5) Then exitlong("손절",AtStop,AvgEntryPrice*0.96); } 위에 식에서 매도를 분할매도식으로 바꾸고 싶습니다.. 1차매수후 5프로에서-절반매도 10프로에서-30프로매도 20프로는홀딩 2차매수후 5프로에서-절반매도(전체매수수량) 10프로에서-30프로매도 20프로홀딩 3차매수후 5프로에서-절반매도(전체매수수량) 10프로에서-30프로매도 20프로홀딩 4차매수후 5프로&#50667;서-절반매도(전체매수수량) 10프로에서-30프로매도 나머지홀딩 그리고 750일선 이탈시 전량매도...