커뮤니티

수정 부탁드립니다.

프로필 이미지
대구어린울프
2019-09-18 16:28:09
171
글번호 132047
답변완료
안녕하세요? 아래 수식에서 있는거 그대로 놔두고 몇가지 추가를 하고싶습니다. (추가하는 3가지 모두 하나의 방식을 풀어서 설명드린것입니다.) 1) 매수진입 신호와 매도진입 사이에 캔들갯수를 외부변수로 넣고싶습니다. (매수진입신호 나온후 매도진입봉 과의 사이에 있는 캔들갯수 입니다) 2) 위에서 입력한 진입신호와 반대진입봉 과의 캔들갯수 이내에 들어간다는 전제하에, 매수진입후 매도진입 신호가 나오면 청산후 매도진입. 매도진입후 매수진입 신호가 나오면 청산후 매수진입. 3) 만약 위에서 설정한 캔들갯수가 벗어난다면, 반대매매는 나오지않고 입력해둔 익절 손절 라인에 청산. 감사합니다. ---------------------------------------------------------------------------------------- input : 양봉틱(5),음봉틱(5),진입횟수(3); input : 익절틱수(50),손절틱수(50); var : cnt(0); if bdate != bdate[1] Then cnt = 0; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then cnt = cnt+1; if MarketPosition == 0 and cnt < 진입횟수 and C == O+PriceScale*양봉틱 and C[1] == O[1]-PriceScale*음봉틱 Then buy(); if MarketPosition == 0 and cnt < 진입횟수 and C == O-PriceScale*음봉틱 and C[1] == O[1]+PriceScale*양봉틱 Then sell(); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-09-18 17:01:10

안녕하세요 예스스탁입니다. input : 양봉틱(5),음봉틱(5),진입횟수(3),갯수(5); input : 익절틱수(50),손절틱수(50); var : cnt(0); if bdate != bdate[1] Then cnt = 0; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then cnt = cnt+1; if cnt < 진입횟수 and C == O+PriceScale*양봉틱 and C[1] == O[1]-PriceScale*음봉틱 Then { if MarketPosition == 0 or (MarketPosition == -1 and BarsSinceEntry < 갯수) then buy(); } if cnt < 진입횟수 and C == O-PriceScale*음봉틱 and C[1] == O[1]+PriceScale*양봉틱 Then { if MarketPosition == 0 or (MarketPosition == 1 and BarsSinceEntry < 갯수) then sell(); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 즐거운 하루되세요 > 대구어린울프 님이 쓴 글입니다. > 제목 : 수정 부탁드립니다. > 안녕하세요? 아래 수식에서 있는거 그대로 놔두고 몇가지 추가를 하고싶습니다. (추가하는 3가지 모두 하나의 방식을 풀어서 설명드린것입니다.) 1) 매수진입 신호와 매도진입 사이에 캔들갯수를 외부변수로 넣고싶습니다. (매수진입신호 나온후 매도진입봉 과의 사이에 있는 캔들갯수 입니다) 2) 위에서 입력한 진입신호와 반대진입봉 과의 캔들갯수 이내에 들어간다는 전제하에, 매수진입후 매도진입 신호가 나오면 청산후 매도진입. 매도진입후 매수진입 신호가 나오면 청산후 매수진입. 3) 만약 위에서 설정한 캔들갯수가 벗어난다면, 반대매매는 나오지않고 입력해둔 익절 손절 라인에 청산. 감사합니다. ---------------------------------------------------------------------------------------- input : 양봉틱(5),음봉틱(5),진입횟수(3); input : 익절틱수(50),손절틱수(50); var : cnt(0); if bdate != bdate[1] Then cnt = 0; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then cnt = cnt+1; if MarketPosition == 0 and cnt < 진입횟수 and C == O+PriceScale*양봉틱 and C[1] == O[1]-PriceScale*음봉틱 Then buy(); if MarketPosition == 0 and cnt < 진입횟수 and C == O-PriceScale*음봉틱 and C[1] == O[1]+PriceScale*양봉틱 Then sell(); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop);