커뮤니티

수정부탁드립니다.

프로필 이미지
대구어린울프
2022-08-07 20:17:17
905
글번호 161354
답변완료
안녕하세요? 아래수식에서 보유포지션이 있을때 진입신호가 생기면 반대로 진입하면서 청산되고있는데요, 앞서 진입한 포지션이 익/손절이 완전 되고난 이후에 신호가나올때 다음매매가 진입되게 하고싶습니다. 감사합니다. input : p1(5),p2(20); input : 양봉(4),음봉(4); input : 익절틱수(50),손절틱수(50),진입횟수(3),N(5); var : entry(0),cnt(0); var1 = ma(c,P1); var2 = ma(C,P2); if Bdate != Bdate[1] Then entry = 0; if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if MarketPosition <= 0 and VAR1 < Var2 and entry < 진입횟수 and C[1] <= O[1]-음봉*PriceScale and O != C[1] and C >= O-양봉*PriceScale Then Buy(); if MarketPosition >= 0 and VAR1 > Var2 and entry < 진입횟수 and C[1] >= O[1]+양봉*PriceScale and O != C[1] and C <= O-음봉*PriceScale Then Sell(); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2022-08-08 11:37:04

안녕하세요 예스스탁입니다. input : p1(5),p2(20); input : 양봉(4),음봉(4); input : 익절틱수(50),손절틱수(50),진입횟수(3),N(5); var : entry(0),cnt(0); var1 = ma(c,P1); var2 = ma(C,P2); if Bdate != Bdate[1] Then entry = 0; if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if MarketPosition == 0 and VAR1 < Var2 and entry < 진입횟수 and C[1] <= O[1]-음봉*PriceScale and O != C[1] and C >= O-양봉*PriceScale Then Buy(); if MarketPosition == 0 and VAR1 > Var2 and entry < 진입횟수 and C[1] >= O[1]+양봉*PriceScale and O != C[1] and C <= O-음봉*PriceScale Then Sell(); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 즐거운 하루되세요 > 대구어린울프 님이 쓴 글입니다. > 제목 : 수정부탁드립니다. > 안녕하세요? 아래수식에서 보유포지션이 있을때 진입신호가 생기면 반대로 진입하면서 청산되고있는데요, 앞서 진입한 포지션이 익/손절이 완전 되고난 이후에 신호가나올때 다음매매가 진입되게 하고싶습니다. 감사합니다. input : p1(5),p2(20); input : 양봉(4),음봉(4); input : 익절틱수(50),손절틱수(50),진입횟수(3),N(5); var : entry(0),cnt(0); var1 = ma(c,P1); var2 = ma(C,P2); if Bdate != Bdate[1] Then entry = 0; if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if MarketPosition <= 0 and VAR1 < Var2 and entry < 진입횟수 and C[1] <= O[1]-음봉*PriceScale and O != C[1] and C >= O-양봉*PriceScale Then Buy(); if MarketPosition >= 0 and VAR1 > Var2 and entry < 진입횟수 and C[1] >= O[1]+양봉*PriceScale and O != C[1] and C <= O-음봉*PriceScale Then Sell(); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop);