커뮤니티

식 수정 문의

프로필 이미지
한글나라
2008-12-03 14:06:59
812
글번호 18530
답변완료
input : inent(10); var : ent(0); var2 = 0; for var1 = 0 to 20 { if sdate == EntryDate(var1) Then var2 = var2+1; } if var2 == 0 Then{ if CrossUp(ma(c,5),ma(c,20)) Then{ ent = inent; buy("매수",OnClose,def,ent); } if CrossDown(ma(c,5),ma(c,20)) Then{ ent = inent; Sell("매도",OnClose,def,ent); } } if var2 > 0 and MarketPosition() == 1 Then{ if CrossDown(ma(c,5),ma(c,20)) and C < EntryPrice() Then{ ent = ent-2; Sell("sell1",OnClose,def,max(ent,4)); } if CrossDown(ma(c,5),ma(c,20)) and C > EntryPrice() Then{ ent = ent+2; Sell("sell2",OnClose,def,max(ent,4)); } } if var2 > 0 and MarketPosition() == -1 Then{ if CrossUp(ma(c,5),ma(c,20)) and C < EntryPrice() Then{ ent = ent+2; buy("buy2",OnClose,def,max(ent,4)); } if CrossUp(ma(c,5),ma(c,20)) and C > EntryPrice() Then{ ent = ent-2; buy("buy1",OnClose,def,max(ent,4)); } } 안녕하세요 제가 표현력이 부정확해서 데이시스템으로 만들어주셨네요 ㅎㅎ 데이용이 아니라 처음에 10계약 넣고 다음부터 승/패에 따라 조절되는 겁니다 귀찮게 해드려서 죄송합니다 이전글 : 제가 만들고 싶은 것은, 이전 결과에 대해 계약수를 조절하는 것입니다. 처음에 10계약을 들어가고, 이익이 나면 +2계약으로 다음에는 12계약 진입 만일 손실이 났다면 -2계약으로 진입하며, 최저 4계약은 하도록 하는 내용입니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2008-12-04 09:52:13

안녕하세요 예스스탁입니다. input : inent(10); var : ent(0); if TotalTrades() == 0 Then{ if CrossUp(ma(c,5),ma(c,20)) Then{ ent = inent; buy("매수",OnClose,def,ent); } if CrossDown(ma(c,5),ma(c,20)) Then{ ent = inent; Sell("매도",OnClose,def,ent); } } if TotalTrades() >= 1 and MarketPosition() == 1 Then{ if CrossDown(ma(c,5),ma(c,20)) and C < EntryPrice() Then{ ent = ent-2; Sell("sell1",OnClose,def,max(ent,4)); } if CrossDown(ma(c,5),ma(c,20)) and C > EntryPrice() Then{ ent = ent+2; Sell("sell2",OnClose,def,max(ent,4)); } } if TotalTrades() >= 1 and MarketPosition() == -1 Then{ if CrossUp(ma(c,5),ma(c,20)) and C < EntryPrice() Then{ ent = ent+2; buy("buy2",OnClose,def,max(ent,4)); } if CrossUp(ma(c,5),ma(c,20)) and C > EntryPrice() Then{ ent = ent-2; buy("buy1",OnClose,def,max(ent,4)); } } 즐거운 하루되세요 > 한글나라 님이 쓴 글입니다. > 제목 : 식 수정 문의 > input : inent(10); var : ent(0); var2 = 0; for var1 = 0 to 20 { if sdate == EntryDate(var1) Then var2 = var2+1; } if var2 == 0 Then{ if CrossUp(ma(c,5),ma(c,20)) Then{ ent = inent; buy("매수",OnClose,def,ent); } if CrossDown(ma(c,5),ma(c,20)) Then{ ent = inent; Sell("매도",OnClose,def,ent); } } if var2 > 0 and MarketPosition() == 1 Then{ if CrossDown(ma(c,5),ma(c,20)) and C < EntryPrice() Then{ ent = ent-2; Sell("sell1",OnClose,def,max(ent,4)); } if CrossDown(ma(c,5),ma(c,20)) and C > EntryPrice() Then{ ent = ent+2; Sell("sell2",OnClose,def,max(ent,4)); } } if var2 > 0 and MarketPosition() == -1 Then{ if CrossUp(ma(c,5),ma(c,20)) and C < EntryPrice() Then{ ent = ent+2; buy("buy2",OnClose,def,max(ent,4)); } if CrossUp(ma(c,5),ma(c,20)) and C > EntryPrice() Then{ ent = ent-2; buy("buy1",OnClose,def,max(ent,4)); } } 안녕하세요 제가 표현력이 부정확해서 데이시스템으로 만들어주셨네요 ㅎㅎ 데이용이 아니라 처음에 10계약 넣고 다음부터 승/패에 따라 조절되는 겁니다 귀찮게 해드려서 죄송합니다 이전글 : 제가 만들고 싶은 것은, 이전 결과에 대해 계약수를 조절하는 것입니다. 처음에 10계약을 들어가고, 이익이 나면 +2계약으로 다음에는 12계약 진입 만일 손실이 났다면 -2계약으로 진입하며, 최저 4계약은 하도록 하는 내용입니다.