커뮤니티

시스템식 정정

프로필 이미지
에구머니
2019-10-10 17:55:18
205
글번호 132676
답변완료

첨부 이미지

안녕하세요? vv라고 -11 ~ 11 의 정수값을 가지는 지표가 있습니다. k1(10) 일에 한번씩 체크하여 vv 만큼의 포지션을 갖는 시스템을 만들고 싶습니다. 즉, vv == 3이면 3개 매수, 10일 후, vv = -2 면, 먼저번 매수 3개는 청산하고 2개 매도 10일후 vv = -5면, 현재의 매도 2개에다가 3개의 매도 추가해서 -5 상태로 만들기 10일후 vv = -5면 , 그냥 넘어가기 10일후 vv = 2면, 기존의 매도 5개 청산 및 매수 2개, ... 그림에서처럼 포지션이 -337(매도를 337개 갖고 있는다는 뜻이겠죠?) 이렇게 나오면 안됩니다. vv 값이 -11 ~ 11 이기 때문에 그 안에서 놀아야 하는데, 뭐가 잘못되었는지 모르겠습니다. 아래 수식에서는 익절 Perc(%) 도달하면 다 털고 새로 시작인 것 같은데, 이 Perc 는 들어가도 좋고 없어져도 좋습니다. input: both(true); both == true => 매수, 매도 다 가능, both == false => 매수만 하고, vv <= 0 의 경우, 매도가 아닌 무포지션 이런 식으로 정정해 주시면 정말 감사하겠습니다. 감사합니다. if MarketPosition == 1 and cnt >=10 && C > AvgEntryprice*(1 + Perc/100) then { exitlong(); cnt = 0; } if index > 0 and index%k1 == r1 Then { cnt = cnt + 1; if VV > 0 Then { if MarketPosition == -1 then{ if CurrentContracts >= abs(vv) then ExitShort("sx",OnClose,def,"",abs(vv),2); if CurrentContracts < abs(vv) then buy("sb",OnClose,def,abs(vv)-CurrentContracts); } if MarketPosition == 0 Then buy("b",OnClose,def,abs(vv)); if MarketPosition == 1 then buy("bb",OnClose,def,abs(vv)); } if VV < 0 Then { if MarketPosition == 1 then{ if CurrentContracts >= abs(vv) then ExitLong("bx",OnClose,def,"",abs(vv),2); if CurrentContracts < abs(vv) then sell("bs",OnClose,def,abs(vv)-CurrentContracts); } if MarketPosition == 0 Then sell("s",OnClose,def,abs(vv)); if MarketPosition == -1 then sell("ss",OnClose,def,abs(vv)); } }
시스템
답변 3
프로필 이미지

예스스탁 예스스탁 답변

2019-10-11 13:17:02

안녕하세요 예스스탁입니다. input: both(true); if MarketPosition == 1 and cnt >=10 && C > AvgEntryprice*(1 + Perc/100) then { exitlong(); cnt = 0; } if index > 0 and index%k1 == r1 Then { cnt = cnt + 1; if VV > 0 Then { if MarketPosition <= 0 then { buy("b",OnClose,def,abs(vv)); } if MarketPosition == 1 then { if CurrentContracts < abs(VV) Then buy("bb",OnClose,def,abs(vv)-CurrentContracts); if CurrentContracts > abs(VV) Then ExitLong("bx",OnClose,def,"",CurrentContracts-abs(vv),1); } } if VV < 0 Then { if MarketPosition >= 0 then { if both == true Then sell("s",OnClose,def,abs(vv)); Else Exitlong("bx2"); } if MarketPosition == -1 then { if CurrentContracts < abs(VV) Then sell("ss",OnClose,def,abs(vv)-CurrentContracts); if CurrentContracts > abs(VV) Then ExitShort("sx",OnClose,def,"",CurrentContracts-abs(vv),1); } } } 즐거운 하루되세요 > 에구머니 님이 쓴 글입니다. > 제목 : 시스템식 정정 > 안녕하세요? vv라고 -11 ~ 11 의 정수값을 가지는 지표가 있습니다. k1(10) 일에 한번씩 체크하여 vv 만큼의 포지션을 갖는 시스템을 만들고 싶습니다. 즉, vv == 3이면 3개 매수, 10일 후, vv = -2 면, 먼저번 매수 3개는 청산하고 2개 매도 10일후 vv = -5면, 현재의 매도 2개에다가 3개의 매도 추가해서 -5 상태로 만들기 10일후 vv = -5면 , 그냥 넘어가기 10일후 vv = 2면, 기존의 매도 5개 청산 및 매수 2개, ... 그림에서처럼 포지션이 -337(매도를 337개 갖고 있는다는 뜻이겠죠?) 이렇게 나오면 안됩니다. vv 값이 -11 ~ 11 이기 때문에 그 안에서 놀아야 하는데, 뭐가 잘못되었는지 모르겠습니다. 아래 수식에서는 익절 Perc(%) 도달하면 다 털고 새로 시작인 것 같은데, 이 Perc 는 들어가도 좋고 없어져도 좋습니다. input: both(true); both == true => 매수, 매도 다 가능, both == false => 매수만 하고, vv <= 0 의 경우, 매도가 아닌 무포지션 이런 식으로 정정해 주시면 정말 감사하겠습니다. 감사합니다. if MarketPosition == 1 and cnt >=10 && C > AvgEntryprice*(1 + Perc/100) then { exitlong(); cnt = 0; } if index > 0 and index%k1 == r1 Then { cnt = cnt + 1; if VV > 0 Then { if MarketPosition == -1 then{ if CurrentContracts >= abs(vv) then ExitShort("sx",OnClose,def,"",abs(vv),2); if CurrentContracts < abs(vv) then buy("sb",OnClose,def,abs(vv)-CurrentContracts); } if MarketPosition == 0 Then buy("b",OnClose,def,abs(vv)); if MarketPosition == 1 then buy("bb",OnClose,def,abs(vv)); } if VV < 0 Then { if MarketPosition == 1 then{ if CurrentContracts >= abs(vv) then ExitLong("bx",OnClose,def,"",abs(vv),2); if CurrentContracts < abs(vv) then sell("bs",OnClose,def,abs(vv)-CurrentContracts); } if MarketPosition == 0 Then sell("s",OnClose,def,abs(vv)); if MarketPosition == -1 then sell("ss",OnClose,def,abs(vv)); } }
프로필 이미지

에구머니

2019-10-11 14:26:47

유진 예스트레이더를 쓰고 있는데요, 전략 차트에서는 잘 돌아 가는데, 시뮬레이션 차트에서는 논리값(참/거짓)이나 논리표현식이 와야 합니다. 라는 에러메세지만 뜹니다. 어떻게 해야 하나요? 감사합니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 시스템식 정정 > 안녕하세요 예스스탁입니다. input: both(true); if MarketPosition == 1 and cnt >=10 && C > AvgEntryprice*(1 + Perc/100) then { exitlong(); cnt = 0; } if index > 0 and index%k1 == r1 Then { cnt = cnt + 1; if VV > 0 Then { if MarketPosition <= 0 then { buy("b",OnClose,def,abs(vv)); } if MarketPosition == 1 then { if CurrentContracts < abs(VV) Then buy("bb",OnClose,def,abs(vv)-CurrentContracts); if CurrentContracts > abs(VV) Then ExitLong("bx",OnClose,def,"",CurrentContracts-abs(vv),1); } } if VV < 0 Then { if MarketPosition >= 0 then { if both == true Then sell("s",OnClose,def,abs(vv)); Else Exitlong("bx2"); } if MarketPosition == -1 then { if CurrentContracts < abs(VV) Then sell("ss",OnClose,def,abs(vv)-CurrentContracts); if CurrentContracts > abs(VV) Then ExitShort("sx",OnClose,def,"",CurrentContracts-abs(vv),1); } } } 즐거운 하루되세요 > 에구머니 님이 쓴 글입니다. > 제목 : 시스템식 정정 > 안녕하세요? vv라고 -11 ~ 11 의 정수값을 가지는 지표가 있습니다. k1(10) 일에 한번씩 체크하여 vv 만큼의 포지션을 갖는 시스템을 만들고 싶습니다. 즉, vv == 3이면 3개 매수, 10일 후, vv = -2 면, 먼저번 매수 3개는 청산하고 2개 매도 10일후 vv = -5면, 현재의 매도 2개에다가 3개의 매도 추가해서 -5 상태로 만들기 10일후 vv = -5면 , 그냥 넘어가기 10일후 vv = 2면, 기존의 매도 5개 청산 및 매수 2개, ... 그림에서처럼 포지션이 -337(매도를 337개 갖고 있는다는 뜻이겠죠?) 이렇게 나오면 안됩니다. vv 값이 -11 ~ 11 이기 때문에 그 안에서 놀아야 하는데, 뭐가 잘못되었는지 모르겠습니다. 아래 수식에서는 익절 Perc(%) 도달하면 다 털고 새로 시작인 것 같은데, 이 Perc 는 들어가도 좋고 없어져도 좋습니다. input: both(true); both == true => 매수, 매도 다 가능, both == false => 매수만 하고, vv <= 0 의 경우, 매도가 아닌 무포지션 이런 식으로 정정해 주시면 정말 감사하겠습니다. 감사합니다. if MarketPosition == 1 and cnt >=10 && C > AvgEntryprice*(1 + Perc/100) then { exitlong(); cnt = 0; } if index > 0 and index%k1 == r1 Then { cnt = cnt + 1; if VV > 0 Then { if MarketPosition == -1 then{ if CurrentContracts >= abs(vv) then ExitShort("sx",OnClose,def,"",abs(vv),2); if CurrentContracts < abs(vv) then buy("sb",OnClose,def,abs(vv)-CurrentContracts); } if MarketPosition == 0 Then buy("b",OnClose,def,abs(vv)); if MarketPosition == 1 then buy("bb",OnClose,def,abs(vv)); } if VV < 0 Then { if MarketPosition == 1 then{ if CurrentContracts >= abs(vv) then ExitLong("bx",OnClose,def,"",abs(vv),2); if CurrentContracts < abs(vv) then sell("bs",OnClose,def,abs(vv)-CurrentContracts); } if MarketPosition == 0 Then sell("s",OnClose,def,abs(vv)); if MarketPosition == -1 then sell("ss",OnClose,def,abs(vv)); } }
프로필 이미지

예스스탁 예스스탁 답변

2019-10-11 14:52:19

안녕하세요 예스스탁입니다. 시뮬레이션 차트는 외부변수에 대해 최적화 기능이 있어서 외부변수가 모두 숫자로만 구성되어야 합니다. Both변수를 숫자로 변경했습니다. 1이면 매수 매도 모두 가능하고 0이면 매수만 거래합니다. input: both(1); if MarketPosition == 1 and cnt >=10 && C > AvgEntryprice*(1 + Perc/100) then { exitlong(); cnt = 0; } if index > 0 and index%k1 == r1 Then { cnt = cnt + 1; if VV > 0 Then { if MarketPosition <= 0 then { buy("b",OnClose,def,abs(vv)); } if MarketPosition == 1 then { if CurrentContracts < abs(VV) Then buy("bb",OnClose,def,abs(vv)-CurrentContracts); if CurrentContracts > abs(VV) Then ExitLong("bx",OnClose,def,"",CurrentContracts-abs(vv),1); } } if VV < 0 Then { if MarketPosition >= 0 then { if both == 1 Then sell("s",OnClose,def,abs(vv)); Else Exitlong("bx2"); } if MarketPosition == -1 then { if CurrentContracts < abs(VV) Then sell("ss",OnClose,def,abs(vv)-CurrentContracts); if CurrentContracts > abs(VV) Then ExitShort("sx",OnClose,def,"",CurrentContracts-abs(vv),1); } } } 즐거운 하루되세요 > 에구머니 님이 쓴 글입니다. > 제목 : Re : Re : 시스템식 정정 > 유진 예스트레이더를 쓰고 있는데요, 전략 차트에서는 잘 돌아 가는데, 시뮬레이션 차트에서는 논리값(참/거짓)이나 논리표현식이 와야 합니다. 라는 에러메세지만 뜹니다. 어떻게 해야 하나요? 감사합니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 시스템식 정정 > 안녕하세요 예스스탁입니다. input: both(true); if MarketPosition == 1 and cnt >=10 && C > AvgEntryprice*(1 + Perc/100) then { exitlong(); cnt = 0; } if index > 0 and index%k1 == r1 Then { cnt = cnt + 1; if VV > 0 Then { if MarketPosition <= 0 then { buy("b",OnClose,def,abs(vv)); } if MarketPosition == 1 then { if CurrentContracts < abs(VV) Then buy("bb",OnClose,def,abs(vv)-CurrentContracts); if CurrentContracts > abs(VV) Then ExitLong("bx",OnClose,def,"",CurrentContracts-abs(vv),1); } } if VV < 0 Then { if MarketPosition >= 0 then { if both == true Then sell("s",OnClose,def,abs(vv)); Else Exitlong("bx2"); } if MarketPosition == -1 then { if CurrentContracts < abs(VV) Then sell("ss",OnClose,def,abs(vv)-CurrentContracts); if CurrentContracts > abs(VV) Then ExitShort("sx",OnClose,def,"",CurrentContracts-abs(vv),1); } } } 즐거운 하루되세요 > 에구머니 님이 쓴 글입니다. > 제목 : 시스템식 정정 > 안녕하세요? vv라고 -11 ~ 11 의 정수값을 가지는 지표가 있습니다. k1(10) 일에 한번씩 체크하여 vv 만큼의 포지션을 갖는 시스템을 만들고 싶습니다. 즉, vv == 3이면 3개 매수, 10일 후, vv = -2 면, 먼저번 매수 3개는 청산하고 2개 매도 10일후 vv = -5면, 현재의 매도 2개에다가 3개의 매도 추가해서 -5 상태로 만들기 10일후 vv = -5면 , 그냥 넘어가기 10일후 vv = 2면, 기존의 매도 5개 청산 및 매수 2개, ... 그림에서처럼 포지션이 -337(매도를 337개 갖고 있는다는 뜻이겠죠?) 이렇게 나오면 안됩니다. vv 값이 -11 ~ 11 이기 때문에 그 안에서 놀아야 하는데, 뭐가 잘못되었는지 모르겠습니다. 아래 수식에서는 익절 Perc(%) 도달하면 다 털고 새로 시작인 것 같은데, 이 Perc 는 들어가도 좋고 없어져도 좋습니다. input: both(true); both == true => 매수, 매도 다 가능, both == false => 매수만 하고, vv <= 0 의 경우, 매도가 아닌 무포지션 이런 식으로 정정해 주시면 정말 감사하겠습니다. 감사합니다. if MarketPosition == 1 and cnt >=10 && C > AvgEntryprice*(1 + Perc/100) then { exitlong(); cnt = 0; } if index > 0 and index%k1 == r1 Then { cnt = cnt + 1; if VV > 0 Then { if MarketPosition == -1 then{ if CurrentContracts >= abs(vv) then ExitShort("sx",OnClose,def,"",abs(vv),2); if CurrentContracts < abs(vv) then buy("sb",OnClose,def,abs(vv)-CurrentContracts); } if MarketPosition == 0 Then buy("b",OnClose,def,abs(vv)); if MarketPosition == 1 then buy("bb",OnClose,def,abs(vv)); } if VV < 0 Then { if MarketPosition == 1 then{ if CurrentContracts >= abs(vv) then ExitLong("bx",OnClose,def,"",abs(vv),2); if CurrentContracts < abs(vv) then sell("bs",OnClose,def,abs(vv)-CurrentContracts); } if MarketPosition == 0 Then sell("s",OnClose,def,abs(vv)); if MarketPosition == -1 then sell("ss",OnClose,def,abs(vv)); } }