커뮤니티

수식 부탁드립니다

프로필 이미지
미송
2017-01-23 22:00:56
132
글번호 106217
답변완료

첨부 이미지

아래와 같은 피라미딩 시스템 청산식을 사용할 경우 그림과 같이 최초진입가에서 5p 이상인 지점에서만 청산이 이루어집니다. 만들고자 하는 청산식은 최초 진입가(buy)에서 피라미딩하여 5p 이상인 지점에서 청산이 이루어지고 또한 bs, sb지점에서 추가 진입한 후 피라미딩하여 5p 이상인 지점에서도 청산이 이루어지는 시스템입니다. 부탁드립니다 if MarketPosition == 1 Then { if MaxContracts < 20 and (entryprice >= LatestEntryPrice) or (entryprice <= LatestEntryPrice) Then buy("bb",atstop,LatestEntryPrice(0)+1.5,1); if MaxContracts < 20 Then buy("bs",atlimit,latestEntryPrice(0)-5,1); } if MarketPosition == -1 Then { if MaxContracts < 20 and (entryprice <= LatestEntryPrice) or (entryprice >= LatestEntryPrice) Then sell("ss",atstop,LatestEntryPrice(0)-1.5,1); if MaxContracts < 20 Then sell("sb",atlimit,latestEntryPrice(0)+5,1); } if MarketPosition == 1 Then ExitLong("bp",atlimit,AvgEntryPrice+7.0); if MarketPosition == -1 Then ExitShort("sp",atlimit,AvgEntryPrice-7.0); if MarketPosition == 1 and c > entryprice + 5 and Relative1 >= 65 Then exitlong("bx1",AtStop,c); if MarketPosition == -1 and c < entryprice - 5 and Relative1 <= 35 Then exitShort("sx1",AtStop,c);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2017-01-24 16:57:36

안녕하세요 예스스탁입니다. 1 아래는 가장최근 진입가(피라미딩에서는 최종진입)을 기준으로 청산하게 변경했습니다. if MarketPosition == 1 Then { if MaxContracts < 20 and (entryprice >= LatestEntryPrice) or (entryprice <= LatestEntryPrice) Then buy("bb",atstop,LatestEntryPrice(0)+1.5,1); if MaxContracts < 20 Then buy("bs",atlimit,latestEntryPrice(0)-5,1); } if MarketPosition == -1 Then { if MaxContracts < 20 and (entryprice <= LatestEntryPrice) or (entryprice >= LatestEntryPrice) Then sell("ss",atstop,LatestEntryPrice(0)-1.5,1); if MaxContracts < 20 Then sell("sb",atlimit,latestEntryPrice(0)+5,1); } if MarketPosition == 1 Then ExitLong("bp",atlimit,AvgEntryPrice+7.0); if MarketPosition == -1 Then ExitShort("sp",atlimit,AvgEntryPrice-7.0); if MarketPosition == 1 and c > LatestEntryPrice(0)+5 and Relative1 >= 65 Then exitlong("bx1",AtStop,c); if MarketPosition == -1 and c < LatestEntryPrice(0) - 5 and Relative1 <= 35 Then exitShort("sx1",AtStop,c); 2 만약 각 진입별로 5포인트 수익이면 청산하고자 하시면 일반 청산함수로는 가능하지 않고 setstopProfitTarget함수를 이용해야 합니다. 강제청산만 진입별로 발동하게 할수 있습니다. if MarketPosition == 1 Then { if MaxContracts < 20 and (entryprice >= LatestEntryPrice) or (entryprice <= LatestEntryPrice) Then buy("bb",atstop,LatestEntryPrice(0)+1.5,1); if MaxContracts < 20 Then buy("bs",atlimit,latestEntryPrice(0)-5,1); } if MarketPosition == -1 Then { if MaxContracts < 20 and (entryprice <= LatestEntryPrice) or (entryprice >= LatestEntryPrice) Then sell("ss",atstop,LatestEntryPrice(0)-1.5,1); if MaxContracts < 20 Then sell("sb",atlimit,latestEntryPrice(0)+5,1); } if MarketPosition == 1 Then ExitLong("bp",atlimit,AvgEntryPrice+7.0); if MarketPosition == -1 Then ExitShort("sp",atlimit,AvgEntryPrice-7.0); SetStopProfittarget(5,PointStop); 즐거운 하루되세요 > 미송 님이 쓴 글입니다. > 제목 : 수식 부탁드립니다 > 아래와 같은 피라미딩 시스템 청산식을 사용할 경우 그림과 같이 최초진입가에서 5p 이상인 지점에서만 청산이 이루어집니다. 만들고자 하는 청산식은 최초 진입가(buy)에서 피라미딩하여 5p 이상인 지점에서 청산이 이루어지고 또한 bs, sb지점에서 추가 진입한 후 피라미딩하여 5p 이상인 지점에서도 청산이 이루어지는 시스템입니다. 부탁드립니다 if MarketPosition == 1 Then { if MaxContracts < 20 and (entryprice >= LatestEntryPrice) or (entryprice <= LatestEntryPrice) Then buy("bb",atstop,LatestEntryPrice(0)+1.5,1); if MaxContracts < 20 Then buy("bs",atlimit,latestEntryPrice(0)-5,1); } if MarketPosition == -1 Then { if MaxContracts < 20 and (entryprice <= LatestEntryPrice) or (entryprice >= LatestEntryPrice) Then sell("ss",atstop,LatestEntryPrice(0)-1.5,1); if MaxContracts < 20 Then sell("sb",atlimit,latestEntryPrice(0)+5,1); } if MarketPosition == 1 Then ExitLong("bp",atlimit,AvgEntryPrice+7.0); if MarketPosition == -1 Then ExitShort("sp",atlimit,AvgEntryPrice-7.0); if MarketPosition == 1 and c > entryprice + 5 and Relative1 >= 65 Then exitlong("bx1",AtStop,c); if MarketPosition == -1 and c < entryprice - 5 and Relative1 <= 35 Then exitShort("sx1",AtStop,c);