커뮤니티

시스템식 수정

프로필 이미지
에구머니
2017-10-31 21:25:01
190
글번호 113761
답변완료
시스템식 수정을 부탁드립니다. 감사합니다.
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2017-10-31 13:57:02

안녕하세요 예스스탁입니다. input: Mode_1_3(3),howmany(5), n1(1), n2(1), n3(2),n4(3),n5(4),k최초(2), k일반(3), k익절(4) ; var : upp(false), dnn(false), T(0), k손절(10), Left(3), right(3); var : ATRV(0),HH(0),LL(0),SHV(0),SHI(0),SLV(0),SLi(0); var1 = 어쩌구; var2 = 저쩌구; if Mode_1_3 == 1 then {upp = (var1 > 0.5); dnn = (var1 < -0.5);} if Mode_1_3 == 2 then {upp = (var2 > 0.5); dnn = (var2 < -0.5);} if Mode_1_3 == 3 then {upp = (var1 > 0.5 && var2 > 0.5); dnn = (var1 < -0.5 && var2 < -0.5);} /////////////////////////////////////////////////////////////////////////////////////////////////////////// ATRV = ATR(96); if upp Then{ T = 1; if MarketPosition == -1 Then ExitShort(); } if dnn Then{ T = -1; if MarketPosition == 1 Then exitlong(); } if SwingHigh(1,h,Left,right,Left+right+1) != -1 Then{ SHV = H[3]; SHI = 0; } if SwingLow(1,l,Left,right,Left+right+1) != -1 Then{ SLV = L[3]; SLI = 0; } SHI = SHI+1; SLI = SLI+1; if T == 1 and T != T[1] Then HH = H; if T == -1 and T != T[1] Then LL = L; if T == 1 Then{ if H > HH Then HH = H; if MarketPosition == 0 and ((C < HH-ATRv*k최초) or (countif(T != T[1],BarsSinceExit(1)) < 1 and BarsSinceExit(1) > SHI and C < SHV-ATRv*k최초)) Then buy("b1",OnClose,def,n1); if MarketPosition == 1 Then{ exitlong("bp",AtLimit,AvgEntryPrice+atrv*k익절); if MaxEntries == 1 and MaxEntries < howmany and C <= LatestEntryPrice(0)-atrv*k일반 Then buy("b2",OnClose,def,n2); if MaxEntries == 2 and MaxEntries < howmany and C <= LatestEntryPrice(0)-atrv*k일반 Then buy("b3",OnClose,def,n3); if MaxEntries == 3 and MaxEntries < howmany and C <= LatestEntryPrice(0)-atrv*k일반 Then buy("b4",OnClose,def,n4); if MaxEntries == 4 and MaxEntries < howmany and C <= LatestEntryPrice(0)-atrv*k일반 Then buy("b5",OnClose,def,n5); if MaxEntries == howmany Then ExitLong("bl",AtStop,LatestEntryPrice(0)-atrv*k손절); } } if T == -1 Then{ if L < LL Then LL = L; if MarketPosition == 0 and ((C > LL+ATRv*k최초) or (countif(T != T[1],BarsSinceExit(1)) < 1 and BarsSinceExit(1) > SLI and C > SLV+ATRv*k최초)) Then sell("s1",OnClose,def,n1); if MarketPosition == -1 Then{ ExitShort("sp",AtLimit,AvgEntryPrice-atrv*k익절); if MaxEntries == 1 and MaxEntries < howmany and C >= LatestEntryPrice(0)+atrv*k일반 Then sell("s2",OnClose,def,n2); if MaxEntries == 2 and MaxEntries < howmany and C >= LatestEntryPrice(0)+atrv*k일반 Then sell("s3",OnClose,def,n3); if MaxEntries == 3 and MaxEntries < howmany and C >= LatestEntryPrice(0)+atrv*k일반 Then sell("s4",OnClose,def,n4); if MaxEntries == 4 and MaxEntries < howmany and C >= LatestEntryPrice(0)+atrv*k일반 Then sell("s5",OnClose,def,n5); if MaxEntries == howmany Then ExitShort("sl",AtStop,LatestEntryPrice(0)+atrv*k손절); } } 즐거운 하루되세요 > 에구머니 님이 쓴 글입니다. > 제목 : 시스템식 수정 > 시스템식 수정을 부탁드립니다. 감사합니다.
프로필 이미지

에구머니

2017-10-31 15:46:11

에구머니 님에 의해 삭제된 답변입니다.