커뮤니티

수식변경 요청드립니다

프로필 이미지
고박사122
2016-10-19 05:11:06
124
글번호 103064
답변완료
안녕하세요. 다음 수식 중 익/손절조건을 매수/매도을 진입 후 익절틱수는 필요치 않으며 초기에는 손절틱수를 -15틱 설정되며 이익방향으로 진행 시 즉 15틱 이익이나면 손절가를 15틱 따라서 올릴 수 있도록 변경 부탁드립니다. (Input 에 손절틱수를 넣어 사용자가 변경 가능하도록 요청드립니다.) input : 거래시간1(1), 시작시간1(160000), 끝시간1(045500),익절틱수(36),손절틱수(15); input : P1(5),P2(20),N(20),X(0); var : AA(0),BB(0),DD(0); if 거래시간1 == 1 then condition3 = (stime>=시작시간1 or stime<=끝시간1); Else if 거래시간1 == 2 then condition3 = (stime>=시작시간1 and stime<=끝시간1); Else condition3 = true; AA = ma(C,P1); BB = ma(C,P2); DD = Disparity(P2); if MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and BB > BB[1] and C < AA and C > BB and C > O and DD <= 100.5 and highest(BB,N) >= Lowest(BB,N)+PriceScale*X Then buy(); if MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and BB < BB[1] and C > AA and C < BB and C < O and DD >= 99.5 and highest(BB,N) >= Lowest(BB,N)+PriceScale*X Then Sell(); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); if stime == 끝시간1 or (stime > 끝시간1 and stime[1] < 끝시간1) Then{ if MarketPosition == 1 Then ExitLong(); if MarketPosition == -1 Then ExitShort(); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2016-10-19 12:30:29

안녕하세요 예스스탁입니다. input : 거래시간1(1), 시작시간1(160000), 끝시간1(045500),익절틱수(36),손절틱수(15); input : P1(5),P2(20),N(20),X(0); var : AA(0),BB(0),DD(0),HH(0),LL(0); if 거래시간1 == 1 then condition3 = (stime>=시작시간1 or stime<=끝시간1); Else if 거래시간1 == 2 then condition3 = (stime>=시작시간1 and stime<=끝시간1); Else condition3 = true; AA = ma(C,P1); BB = ma(C,P2); DD = Disparity(P2); if MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and BB > BB[1] and C < AA and C > BB and C > O and DD <= 100.5 and highest(BB,N) >= Lowest(BB,N)+PriceScale*X Then buy(); if MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and BB < BB[1] and C > AA and C < BB and C < O and DD >= 99.5 and highest(BB,N) >= Lowest(BB,N)+PriceScale*X Then Sell(); if MarketPosition == 1 Then{ HH = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수)); ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수))+(PriceScale*손절틱수)*HH); } if MarketPosition == -1 Then{ LL = Floor((Lowest(L,BarsSinceEntry)-EntryPrice)/(PriceScale*손절틱수)); ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수)*LL); } SetStopProfittarget(PriceScale*익절틱수,PointStop); if stime == 끝시간1 or (stime > 끝시간1 and stime[1] < 끝시간1) Then{ if MarketPosition == 1 Then ExitLong(); if MarketPosition == -1 Then ExitShort(); } 즐거운 하루되세요 > 고박사122 님이 쓴 글입니다. > 제목 : 수식변경 요청드립니다 > 안녕하세요. 다음 수식 중 익/손절조건을 매수/매도을 진입 후 익절틱수는 필요치 않으며 초기에는 손절틱수를 -15틱 설정되며 이익방향으로 진행 시 즉 15틱 이익이나면 손절가를 15틱 따라서 올릴 수 있도록 변경 부탁드립니다. (Input 에 손절틱수를 넣어 사용자가 변경 가능하도록 요청드립니다.) input : 거래시간1(1), 시작시간1(160000), 끝시간1(045500),익절틱수(36),손절틱수(15); input : P1(5),P2(20),N(20),X(0); var : AA(0),BB(0),DD(0); if 거래시간1 == 1 then condition3 = (stime>=시작시간1 or stime<=끝시간1); Else if 거래시간1 == 2 then condition3 = (stime>=시작시간1 and stime<=끝시간1); Else condition3 = true; AA = ma(C,P1); BB = ma(C,P2); DD = Disparity(P2); if MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and BB > BB[1] and C < AA and C > BB and C > O and DD <= 100.5 and highest(BB,N) >= Lowest(BB,N)+PriceScale*X Then buy(); if MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and BB < BB[1] and C > AA and C < BB and C < O and DD >= 99.5 and highest(BB,N) >= Lowest(BB,N)+PriceScale*X Then Sell(); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); if stime == 끝시간1 or (stime > 끝시간1 and stime[1] < 끝시간1) Then{ if MarketPosition == 1 Then ExitLong(); if MarketPosition == -1 Then ExitShort(); }