커뮤니티

수식문의

프로필 이미지
롤링스
2015-07-21 22:04:22
97
글번호 88738
답변완료
수식문의 드립니다. Condition1 = MarketPosition == 0 and (IsExitName("StopLoss",1) == true or IsExitName("StopProfittarget",1) == true) and MarketPosition(1) == 1; Condition2 = MarketPosition == 0 and (IsExitName("StopLoss",1) == true or IsExitName("StopProfittarget",1) == true) and MarketPosition(1) == -1; var : stok1(0),stod1(0),stok2(0),stod2(0); var : RSIv1(0),RSIs1(0),RSIV2(0),RSIS2(0); stok1 = StochasticsK(10,3); stoD1 = StochasticsD(10,3,3); stok2 = StochasticsK(15,6); stod2 = StochasticsD(15,6,6); rsiv1 = rsi(12); rsis1 = ma(rsiv1,9); rsiv2 = rsi(18); rsis2 = ma(rsiv2,9); if stok1 <= 20 and stok2 <= 20 and rsiv1 <= 40 and rsiv2 <= 40 Then buy("매수"); if stok1 >= 80 and stok2 >= 80 and rsiv1 >= 60 and rsiv2 >= 60 Then sell("매도"); SetStopProfittarget(PriceScale*100,PointStop); SetStopLoss(PriceScale*100,PointStop); 위의 식을 1분봉 설정으로 매매하는데요. 30분봉에서 주가의 위치가 200일 이동평균선 위에 있으면 위의 식에서 매수만 진입해서 청산, 반대로 30분봉에서 주가위치가 200일 이동평균선 밑에 있으면 매도만 진입해서 청산하는 식을 부탁 드립니다. 항상 빠르고 친절한 답변 감사합니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2015-07-22 14:11:23

안녕하세요 예스스탁입니다. 1분봉에서 30분봉의 200이평을 계산하기 위해서는 많은 봉수가 필요합니다. 차트의 조회건수를 10000개봉으로 지정하고 식 적용하시기 바랍니다. input : P(200); var : stok1(0),stod1(0),stok2(0),stod2(0); var : RSIv1(0),RSIs1(0),RSIV2(0),RSIS2(0); var : TM(0),cnt(0),sum(0),mav(0); Array : Cc[250](0); Condition1 = MarketPosition == 0 and (IsExitName("StopLoss",1) == true or IsExitName("StopProfittarget",1) == true) and MarketPosition(1) == 1; Condition2 = MarketPosition == 0 and (IsExitName("StopLoss",1) == true or IsExitName("StopProfittarget",1) == true) and MarketPosition(1) == -1; stok1 = StochasticsK(10,3); stoD1 = StochasticsD(10,3,3); stok2 = StochasticsK(15,6); stod2 = StochasticsD(15,6,6); rsiv1 = rsi(12); rsis1 = ma(rsiv1,9); rsiv2 = rsi(18); rsis2 = ma(rsiv2,9); TM = TimeToMinutes(stime)%30; if dayindex == 0 or (TM < TM[1] and stime > stime[1]) Then{ for cnt = 1 to 249{ CC[cnt] = CC[cnt-1][1]; } } CC[0] = C; if CC[P-1] > 0 Then{ sum = 0; for cnt = 0 to P-1{ sum = sum+CC[cnt]; } mav = sum/P; if stok1 <= 20 and stok2 <= 20 and rsiv1 <= 40 and rsiv2 <= 40 Then{ if CC[0] > mav then buy("매수"); Else ExitShort("sx"); } if stok1 >= 80 and stok2 >= 80 and rsiv1 >= 60 and rsiv2 >= 60 Then{ if CC[0] < mav Then sell("매도"); Else ExitLong("bx"); } } SetStopProfittarget(PriceScale*100,PointStop); SetStopLoss(PriceScale*100,PointStop); 즐거운 하루되세요 > 롤링스 님이 쓴 글입니다. > 제목 : 수식문의 > 수식문의 드립니다. Condition1 = MarketPosition == 0 and (IsExitName("StopLoss",1) == true or IsExitName("StopProfittarget",1) == true) and MarketPosition(1) == 1; Condition2 = MarketPosition == 0 and (IsExitName("StopLoss",1) == true or IsExitName("StopProfittarget",1) == true) and MarketPosition(1) == -1; var : stok1(0),stod1(0),stok2(0),stod2(0); var : RSIv1(0),RSIs1(0),RSIV2(0),RSIS2(0); stok1 = StochasticsK(10,3); stoD1 = StochasticsD(10,3,3); stok2 = StochasticsK(15,6); stod2 = StochasticsD(15,6,6); rsiv1 = rsi(12); rsis1 = ma(rsiv1,9); rsiv2 = rsi(18); rsis2 = ma(rsiv2,9); if stok1 <= 20 and stok2 <= 20 and rsiv1 <= 40 and rsiv2 <= 40 Then buy("매수"); if stok1 >= 80 and stok2 >= 80 and rsiv1 >= 60 and rsiv2 >= 60 Then sell("매도"); SetStopProfittarget(PriceScale*100,PointStop); SetStopLoss(PriceScale*100,PointStop); 위의 식을 1분봉 설정으로 매매하는데요. 30분봉에서 주가의 위치가 200일 이동평균선 위에 있으면 위의 식에서 매수만 진입해서 청산, 반대로 30분봉에서 주가위치가 200일 이동평균선 밑에 있으면 매도만 진입해서 청산하는 식을 부탁 드립니다. 항상 빠르고 친절한 답변 감사합니다.