커뮤니티

시스템식 문의 드립니다.

프로필 이미지
맴맴잉
2021-08-03 22:32:21
914
글번호 151292
답변완료

첨부 이미지

예전에 분봉에서 일봉상 이평선을 터치했을때 매수 하는 시스템식을 도식화해서 요청드린 사람입니다 벌써 똑같은 식으로 3번이나 질문하네요.. 죄송합니다...ㅜ.ㅜ 이정도 실력도 없는 제 자신이 한심스럽네요..ㅜ.ㅜ 기존식에서 추가되는 조건이 생겨서 이리저리 수정을 해봤는데..잘안되어서 또 요청드리게 되었습니다. 새로 추가되는 조건은 1차 매수를 했던, 2차 매수까지 진행되었던건 간에 매수한지 2일차 13:00 가 되면.. 익절 퍼센트를 2% (변수 익절3) 로 수정되는식으로 조건을 추가하고 싶습니다. 예) 8/3일에 1차매수.. 8/3일 2차매수 ==> 익절타점5%가 안오고 횡보하는경우 8/4일 13:00 이후에 익절타점이 2%으로 변경 8/3일에 1차매수.. 8/4일 2차매수 ==> 익절타점5%가 안오고 횡보하는경우 8/4일 13:00 이후에 익절타점이 2%으로 변경 8/3일에 1차매수.. ==> 익절타점5%가 안오고 횡보하는경우 8/4일 13:00 이후에 익절타점이 2%으로 변경 xdate 와 xtime으로 만들어볼려고 이리지리 해봤는데.. 잘안됩니다..ㅜ.ㅜ 매번 감사하고 죄송하네요 요청드렸던 식 다시 올려드립니다. ------------------------------------------------------------------------ input : N(10),금액1(10000000),금액2(10000000); input : 추가진입(-3),익절1(5),익절2(5),손절(-3); input : Xdate(3),Xtime(110000); var : cnt(0),sum(0),mav(0),DD(0); sum = 0; For cnt = 0 to N-1 { sum = sum + DayClose(cnt); } mav = sum/N; if Bdate != Bdate[1] Then { DD = DD+1; Condition1 = False; } if MarketPosition == 0 and TotalTrades > TotalTrades[1] Then Condition1 = true; if Condition1 == False and MarketPosition == 0 and L > mav Then Buy("b1",AtLimit,mav,Floor(금액1/min(NextBarOpen,mav))); if MarketPosition == 1 Then { if DD == DD[BarsSinceEntry]+Xdate and sTime == xtime Then { Condition1 = true; ExitLong("bx"); } if MaxEntries == 1 and Condition1 == False Then { Buy("b2",AtLimit,LatestEntryPrice(0)*(1+추가진입/100),Floor(금액2/min(NextBarOpen,LatestEntryPrice(0)*(1+추가진입/100)))); ExitLong("Bp1",AtLimit,avgEntryPrice*(1+익절1/100)); } if MaxEntries == 2 Then { ExitLong("Bp2",AtLimit,avgEntryPrice*(1+익절2/100)); ExitLong("Bl",AtStop,avgEntryPrice*(1+손절/100)); } }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-08-04 10:03:53

안녕하세요 예스스탁입니다. input : N(10),금액1(10000000),금액2(10000000); input : 추가진입(-3),익절1(5),익절2(5),익절3(3),손절(-3); input : Xdate1(3),Xtime1(110000); input : Xdate2(2),Xtime2(130000); var : cnt(0),sum(0),mav(0),DD(0); sum = 0; For cnt = 0 to N-1 { sum = sum + DayClose(cnt); } mav = sum/N; if Bdate != Bdate[1] Then { DD = DD+1; Condition1 = False; } if MarketPosition == 0 and TotalTrades > TotalTrades[1] Then Condition1 = true; if Condition1 == False and MarketPosition == 0 and L > mav Then Buy("b1",AtLimit,mav,Floor(금액1/min(NextBarOpen,mav))); if MarketPosition == 1 Then { if DD == DD[BarsSinceEntry]+Xdate1 and sTime == xtime1 Then { Condition1 = true; ExitLong("bx"); } #2일차 13시가 되면 condition1변수는 true로 변경 if DD == DD[BarsSinceEntry]+Xdate2 and sTime >= xtime2 Then Condition2 = true; if MaxEntries == 1 and Condition1 == False Then { Buy("b2",AtLimit,LatestEntryPrice(0)*(1+추가진입/100),Floor(금액2/min(NextBarOpen,LatestEntryPrice(0)*(1+추가진입/100)))); #Condition2가 False 일때만 if Condition2 == False Then ExitLong("Bp1",AtLimit,avgEntryPrice*(1+익절1/100)); } if MaxEntries == 2 Then { ExitLong("Bl",AtStop,avgEntryPrice*(1+손절/100)); #Condition2가 False 일때만 if Condition2 == False Then ExitLong("Bp2",AtLimit,avgEntryPrice*(1+익절2/100)); } #condition2변수가 true가 되면 익절3으로 감시 if Condition2 == true Then ExitLong("Bp3",AtLimit,avgEntryPrice*(1+익절3/100)); } Else Condition2 = False;#매수전에는 condition2변수는 false 즐거운 하루되세요 > 맴맴잉 님이 쓴 글입니다. > 제목 : 시스템식 문의 드립니다. > 예전에 분봉에서 일봉상 이평선을 터치했을때 매수 하는 시스템식을 도식화해서 요청드린 사람입니다 벌써 똑같은 식으로 3번이나 질문하네요.. 죄송합니다...ㅜ.ㅜ 이정도 실력도 없는 제 자신이 한심스럽네요..ㅜ.ㅜ 기존식에서 추가되는 조건이 생겨서 이리저리 수정을 해봤는데..잘안되어서 또 요청드리게 되었습니다. 새로 추가되는 조건은 1차 매수를 했던, 2차 매수까지 진행되었던건 간에 매수한지 2일차 13:00 가 되면.. 익절 퍼센트를 2% (변수 익절3) 로 수정되는식으로 조건을 추가하고 싶습니다. 예) 8/3일에 1차매수.. 8/3일 2차매수 ==> 익절타점5%가 안오고 횡보하는경우 8/4일 13:00 이후에 익절타점이 2%으로 변경 8/3일에 1차매수.. 8/4일 2차매수 ==> 익절타점5%가 안오고 횡보하는경우 8/4일 13:00 이후에 익절타점이 2%으로 변경 8/3일에 1차매수.. ==> 익절타점5%가 안오고 횡보하는경우 8/4일 13:00 이후에 익절타점이 2%으로 변경 xdate 와 xtime으로 만들어볼려고 이리지리 해봤는데.. 잘안됩니다..ㅜ.ㅜ 매번 감사하고 죄송하네요 요청드렸던 식 다시 올려드립니다. ------------------------------------------------------------------------ input : N(10),금액1(10000000),금액2(10000000); input : 추가진입(-3),익절1(5),익절2(5),손절(-3); input : Xdate(3),Xtime(110000); var : cnt(0),sum(0),mav(0),DD(0); sum = 0; For cnt = 0 to N-1 { sum = sum + DayClose(cnt); } mav = sum/N; if Bdate != Bdate[1] Then { DD = DD+1; Condition1 = False; } if MarketPosition == 0 and TotalTrades > TotalTrades[1] Then Condition1 = true; if Condition1 == False and MarketPosition == 0 and L > mav Then Buy("b1",AtLimit,mav,Floor(금액1/min(NextBarOpen,mav))); if MarketPosition == 1 Then { if DD == DD[BarsSinceEntry]+Xdate and sTime == xtime Then { Condition1 = true; ExitLong("bx"); } if MaxEntries == 1 and Condition1 == False Then { Buy("b2",AtLimit,LatestEntryPrice(0)*(1+추가진입/100),Floor(금액2/min(NextBarOpen,LatestEntryPrice(0)*(1+추가진입/100)))); ExitLong("Bp1",AtLimit,avgEntryPrice*(1+익절1/100)); } if MaxEntries == 2 Then { ExitLong("Bp2",AtLimit,avgEntryPrice*(1+익절2/100)); ExitLong("Bl",AtStop,avgEntryPrice*(1+손절/100)); } }