커뮤니티

다시 질문 드립니다.

프로필 이미지
하우즐영
2010-06-16 14:07:07
670
글번호 30454
답변완료
어제 답변 감사히 잘 받았습니다. 답변하신 예식에다가 다음과 같이 하는 것은 맞는 것인지 여부를 부탁드립니다. 원하는 결과가 나오지 않아서 궁굼해서요. if IsEntryName("b1") == true Then { if highest(H,BarsSinceEntry) >= EntryPrice+0.7 and Highest(h,BarsSinceEntry) < EntryPrice+1.5 and ma(c,2) < ma(c,20) Then <--- ##보내주신 식에 이평범위를 첨부했음. SetStopTrailing(0.4,0.7,PointStop); if highest(H,BarsSinceEntry) >= EntryPrice+1.5 and and ma(c,2) < ma(c,20) Then SetStopTrailing(0.7,1.5,PointStop); SetStopProfitTarget(2.3,PointStop); } Else if IsEntryName("s1") == true Then { if highest(H,BarsSinceEntry) >= EntryPrice+0.7 and Highest(h,BarsSinceEntry) < EntryPrice+1.5 Then SetStopTrailing(0.4,0.7,PointStop); if highest(H,BarsSinceEntry) >= EntryPrice+1.5 Then SetStopTrailing(0.7,1.5,PointStop); SetStopProfitTarget(2.3,PointStop); } Else { SetStopTrailing(0,0); SetStopProfitTarget(0,0); } 상단의 ## 부분에 이평범위를 지정해 주었는데 결과가 틀리게 나와서요. 첨부해 준 것이 잘못인지를 알고 싶고요. 그리고 잘못이라면 그 부분에 다른 조건을 넣는 방법을 알고 싶습니다. 감사드립니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2010-06-17 09:19:41

안녕하세요 예스스탁입니다. 강제청산함수는 특정조건이 맞아 한번 발동하면 이후 해제하기 전까지 계속 가게 됩니다. 그러므로 해제해주시는 내용을 추가해 주셔야 합니다. 수익조건 만족하고 이평조건이 만족하지 않으면 해제라는 부분을 추가했습니다 if IsEntryName("b1") == true Then { if highest(H,BarsSinceEntry) >= EntryPrice+0.7 and Highest(h,BarsSinceEntry) < EntryPrice+1.5 and ma(c,2) < ma(c,20) Then SetStopTrailing(0.4,0.7,PointStop); else if highest(H,BarsSinceEntry) >= EntryPrice+1.5 and ma(c,2) < ma(c,20) Then SetStopTrailing(0.7,1.5,PointStop); Else SetStopTrailing(0,0); #위 2개의 조건이 아니면 해제 SetStopProfitTarget(2.3,PointStop); } Else if IsEntryName("s1") == true Then { if highest(H,BarsSinceEntry) >= EntryPrice+0.7 and Highest(h,BarsSinceEntry) < EntryPrice+1.5 Then SetStopTrailing(0.4,0.7,PointStop); if highest(H,BarsSinceEntry) >= EntryPrice+1.5 Then SetStopTrailing(0.7,1.5,PointStop); SetStopProfitTarget(2.3,PointStop); } Else { SetStopTrailing(0,0); SetStopProfitTarget(0,0); } 즐거운 하루되세요 > 하우즐영 님이 쓴 글입니다. > 제목 : 다시 질문 드립니다. > 어제 답변 감사히 잘 받았습니다. 답변하신 예식에다가 다음과 같이 하는 것은 맞는 것인지 여부를 부탁드립니다. 원하는 결과가 나오지 않아서 궁굼해서요. if IsEntryName("b1") == true Then { if highest(H,BarsSinceEntry) >= EntryPrice+0.7 and Highest(h,BarsSinceEntry) < EntryPrice+1.5 and ma(c,2) < ma(c,20) Then <--- ##보내주신 식에 이평범위를 첨부했음. SetStopTrailing(0.4,0.7,PointStop); if highest(H,BarsSinceEntry) >= EntryPrice+1.5 and and ma(c,2) < ma(c,20) Then SetStopTrailing(0.7,1.5,PointStop); SetStopProfitTarget(2.3,PointStop); } Else if IsEntryName("s1") == true Then { if highest(H,BarsSinceEntry) >= EntryPrice+0.7 and Highest(h,BarsSinceEntry) < EntryPrice+1.5 Then SetStopTrailing(0.4,0.7,PointStop); if highest(H,BarsSinceEntry) >= EntryPrice+1.5 Then SetStopTrailing(0.7,1.5,PointStop); SetStopProfitTarget(2.3,PointStop); } Else { SetStopTrailing(0,0); SetStopProfitTarget(0,0); } 상단의 ## 부분에 이평범위를 지정해 주었는데 결과가 틀리게 나와서요. 첨부해 준 것이 잘못인지를 알고 싶고요. 그리고 잘못이라면 그 부분에 다른 조건을 넣는 방법을 알고 싶습니다. 감사드립니다.