커뮤니티

이동평균선 추가부탁드립니다.

프로필 이미지
대구어린울프
2018-10-17 08:33:49
160
글번호 122753
답변완료
안녕하세요? 아래의 수식에서 이동평균선을 추가. 아래의 수식대로 매매를 하는데, ma5, ma20, ma60 이 정배열일때 양봉매수 진입, 역배열일때 음봉 매도 진입. input : 익절틱수(10),손절틱수(10); input : 양봉틱수1(10),양봉틱수2(10); input : 음봉틱수1(10),음봉틱수2(10); var : T(0); var1 = abs(C-O); if C > O Then { T = 1; value1 = var1; value2 = value1[1]; } if C < O Then { T = -1; value3 = var1; value4 = value3[1]; } if MarketPosition == 0 and C > O and countif(T == 1,2) == 2 and value1 == PriceScale*양봉틱수1 and value2 == PriceScale*양봉틱수2 then { Buy("b"); } if MarketPosition == 0 and C < O and countif(T == -1,2) == 2 and value3 == PriceScale*음봉틱수1 and value4 == PriceScale*음봉틱수2 then { sell("s"); } SetStopProfittarget(익절틱수*PriceScale,PointStop); SetStopLoss(손절틱수*PriceScale,PointStop);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-10-18 11:30:26

안녕하세요 예스스탁입니다. input : 익절틱수(10),손절틱수(10); input : 양봉틱수1(10),양봉틱수2(10); input : 음봉틱수1(10),음봉틱수2(10); var : T(0),mav1(0),mav2(0),mav3(0); mav1 = ma(C,5); mav2 = ma(C,20); mav3 = ma(C,60); var1 = abs(C-O); if C > O Then { T = 1; value1 = var1; value2 = value1[1]; } if C < O Then { T = -1; value3 = var1; value4 = value3[1]; } if MarketPosition == 0 and mav1 > mav2 and mav2 > mav3 and C > O and countif(T == 1,2) == 2 and value1 == PriceScale*양봉틱수1 and value2 == PriceScale*양봉틱수2 then { Buy("b"); } if MarketPosition == 0 and mav1 < mav2 and mav2 < mav3 and C < O and countif(T == -1,2) == 2 and value3 == PriceScale*음봉틱수1 and value4 == PriceScale*음봉틱수2 then { sell("s"); } SetStopProfittarget(익절틱수*PriceScale,PointStop); SetStopLoss(손절틱수*PriceScale,PointStop); 즐거운 하루되세요 > 대구어린울프 님이 쓴 글입니다. > 제목 : 이동평균선 추가부탁드립니다. > 안녕하세요? 아래의 수식에서 이동평균선을 추가. 아래의 수식대로 매매를 하는데, ma5, ma20, ma60 이 정배열일때 양봉매수 진입, 역배열일때 음봉 매도 진입. input : 익절틱수(10),손절틱수(10); input : 양봉틱수1(10),양봉틱수2(10); input : 음봉틱수1(10),음봉틱수2(10); var : T(0); var1 = abs(C-O); if C > O Then { T = 1; value1 = var1; value2 = value1[1]; } if C < O Then { T = -1; value3 = var1; value4 = value3[1]; } if MarketPosition == 0 and C > O and countif(T == 1,2) == 2 and value1 == PriceScale*양봉틱수1 and value2 == PriceScale*양봉틱수2 then { Buy("b"); } if MarketPosition == 0 and C < O and countif(T == -1,2) == 2 and value3 == PriceScale*음봉틱수1 and value4 == PriceScale*음봉틱수2 then { sell("s"); } SetStopProfittarget(익절틱수*PriceScale,PointStop); SetStopLoss(손절틱수*PriceScale,PointStop);